Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ahci: qoriq: enable snoopable sata read and write

By default the SATA IP on the qoriq SoCs does not generating
coherent/snoopable transactions. This patch enable it in the
sata axicc register.
In addition, the dma-coherent property must be set on the
SATA controller nodes.

Signed-off-by: Tang Yuantian <yuantian.tang@nxp.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Tang Yuantian and committed by
Tejun Heo
16af080e 107a077d

+10 -1
+2 -1
arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
··· 495 495 }; 496 496 497 497 sata: sata@3200000 { 498 - compatible = "fsl,ls1043a-ahci", "fsl,ls1021a-ahci"; 498 + compatible = "fsl,ls1043a-ahci"; 499 499 reg = <0x0 0x3200000 0x0 0x10000>; 500 500 interrupts = <0 69 0x4>; 501 501 clocks = <&clockgen 4 0>; 502 + dma-coherent; 502 503 }; 503 504 504 505 msi1: msi-controller1@1571000 {
+2
arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi
··· 679 679 reg = <0x0 0x3200000 0x0 0x10000>; 680 680 interrupts = <0 133 0x4>; /* Level high type */ 681 681 clocks = <&clockgen 4 3>; 682 + dma-coherent; 682 683 }; 683 684 684 685 sata1: sata@3210000 { ··· 688 687 reg = <0x0 0x3210000 0x0 0x10000>; 689 688 interrupts = <0 136 0x4>; /* Level high type */ 690 689 clocks = <&clockgen 4 3>; 690 + dma-coherent; 691 691 }; 692 692 693 693 usb0: usb3@3100000 {
+6
drivers/ata/ahci_qoriq.c
··· 30 30 #define PORT_PHY3 0xB0 31 31 #define PORT_PHY4 0xB4 32 32 #define PORT_PHY5 0xB8 33 + #define PORT_AXICC 0xBC 33 34 #define PORT_TRANS 0xC8 34 35 35 36 /* port register default value */ 36 37 #define AHCI_PORT_PHY_1_CFG 0xa003fffe 37 38 #define AHCI_PORT_TRANS_CFG 0x08000029 39 + #define AHCI_PORT_AXICC_CFG 0x3fffffff 38 40 39 41 /* for ls1021a */ 40 42 #define LS1021A_PORT_PHY2 0x28183414 41 43 #define LS1021A_PORT_PHY3 0x0e080e06 42 44 #define LS1021A_PORT_PHY4 0x064a080b 43 45 #define LS1021A_PORT_PHY5 0x2aa86470 46 + #define LS1021A_AXICC_ADDR 0xC0 44 47 45 48 #define SATA_ECC_DISABLE 0x00020000 46 49 ··· 161 158 writel(LS1021A_PORT_PHY4, reg_base + PORT_PHY4); 162 159 writel(LS1021A_PORT_PHY5, reg_base + PORT_PHY5); 163 160 writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); 161 + writel(AHCI_PORT_AXICC_CFG, reg_base + LS1021A_AXICC_ADDR); 164 162 break; 165 163 166 164 case AHCI_LS1043A: 167 165 writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1); 168 166 writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); 167 + writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); 169 168 break; 170 169 171 170 case AHCI_LS2080A: 172 171 writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1); 173 172 writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); 173 + writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); 174 174 break; 175 175 } 176 176