diff options
| author | Tang Yuantian <Yuantian.Tang@nxp.com> | 2016-08-08 21:51:22 -0400 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2016-08-10 00:03:33 -0400 |
| commit | 16af080e47785d14919bf94bf8a4097c5c8529fb (patch) | |
| tree | 76764acbf773889be650df25af68d8f3db9be6af | |
| parent | 107a077d19341b4d47ae06f0bd24883b94e64628 (diff) | |
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>
| -rw-r--r-- | arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi | 3 | ||||
| -rw-r--r-- | arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi | 2 | ||||
| -rw-r--r-- | drivers/ata/ahci_qoriq.c | 6 |
3 files changed, 10 insertions, 1 deletions
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi index e669fbd7f9c3..e8e4c3ed1b7e 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi | |||
| @@ -495,10 +495,11 @@ | |||
| 495 | }; | 495 | }; |
| 496 | 496 | ||
| 497 | sata: sata@3200000 { | 497 | sata: sata@3200000 { |
| 498 | compatible = "fsl,ls1043a-ahci", "fsl,ls1021a-ahci"; | 498 | compatible = "fsl,ls1043a-ahci"; |
| 499 | reg = <0x0 0x3200000 0x0 0x10000>; | 499 | reg = <0x0 0x3200000 0x0 0x10000>; |
| 500 | interrupts = <0 69 0x4>; | 500 | interrupts = <0 69 0x4>; |
| 501 | clocks = <&clockgen 4 0>; | 501 | clocks = <&clockgen 4 0>; |
| 502 | dma-coherent; | ||
| 502 | }; | 503 | }; |
| 503 | 504 | ||
| 504 | msi1: msi-controller1@1571000 { | 505 | msi1: msi-controller1@1571000 { |
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi index 21023a388c29..5ead17c05bb8 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi | |||
| @@ -679,6 +679,7 @@ | |||
| 679 | reg = <0x0 0x3200000 0x0 0x10000>; | 679 | reg = <0x0 0x3200000 0x0 0x10000>; |
| 680 | interrupts = <0 133 0x4>; /* Level high type */ | 680 | interrupts = <0 133 0x4>; /* Level high type */ |
| 681 | clocks = <&clockgen 4 3>; | 681 | clocks = <&clockgen 4 3>; |
| 682 | dma-coherent; | ||
| 682 | }; | 683 | }; |
| 683 | 684 | ||
| 684 | sata1: sata@3210000 { | 685 | sata1: sata@3210000 { |
| @@ -687,6 +688,7 @@ | |||
| 687 | reg = <0x0 0x3210000 0x0 0x10000>; | 688 | reg = <0x0 0x3210000 0x0 0x10000>; |
| 688 | interrupts = <0 136 0x4>; /* Level high type */ | 689 | interrupts = <0 136 0x4>; /* Level high type */ |
| 689 | clocks = <&clockgen 4 3>; | 690 | clocks = <&clockgen 4 3>; |
| 691 | dma-coherent; | ||
| 690 | }; | 692 | }; |
| 691 | 693 | ||
| 692 | usb0: usb3@3100000 { | 694 | usb0: usb3@3100000 { |
diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c index ed357a184ee4..925c4b6a753b 100644 --- a/drivers/ata/ahci_qoriq.c +++ b/drivers/ata/ahci_qoriq.c | |||
| @@ -30,17 +30,20 @@ | |||
| 30 | #define PORT_PHY3 0xB0 | 30 | #define PORT_PHY3 0xB0 |
| 31 | #define PORT_PHY4 0xB4 | 31 | #define PORT_PHY4 0xB4 |
| 32 | #define PORT_PHY5 0xB8 | 32 | #define PORT_PHY5 0xB8 |
| 33 | #define PORT_AXICC 0xBC | ||
| 33 | #define PORT_TRANS 0xC8 | 34 | #define PORT_TRANS 0xC8 |
| 34 | 35 | ||
| 35 | /* port register default value */ | 36 | /* port register default value */ |
| 36 | #define AHCI_PORT_PHY_1_CFG 0xa003fffe | 37 | #define AHCI_PORT_PHY_1_CFG 0xa003fffe |
| 37 | #define AHCI_PORT_TRANS_CFG 0x08000029 | 38 | #define AHCI_PORT_TRANS_CFG 0x08000029 |
| 39 | #define AHCI_PORT_AXICC_CFG 0x3fffffff | ||
| 38 | 40 | ||
| 39 | /* for ls1021a */ | 41 | /* for ls1021a */ |
| 40 | #define LS1021A_PORT_PHY2 0x28183414 | 42 | #define LS1021A_PORT_PHY2 0x28183414 |
| 41 | #define LS1021A_PORT_PHY3 0x0e080e06 | 43 | #define LS1021A_PORT_PHY3 0x0e080e06 |
| 42 | #define LS1021A_PORT_PHY4 0x064a080b | 44 | #define LS1021A_PORT_PHY4 0x064a080b |
| 43 | #define LS1021A_PORT_PHY5 0x2aa86470 | 45 | #define LS1021A_PORT_PHY5 0x2aa86470 |
| 46 | #define LS1021A_AXICC_ADDR 0xC0 | ||
| 44 | 47 | ||
| 45 | #define SATA_ECC_DISABLE 0x00020000 | 48 | #define SATA_ECC_DISABLE 0x00020000 |
| 46 | 49 | ||
| @@ -158,16 +161,19 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv) | |||
| 158 | writel(LS1021A_PORT_PHY4, reg_base + PORT_PHY4); | 161 | writel(LS1021A_PORT_PHY4, reg_base + PORT_PHY4); |
| 159 | writel(LS1021A_PORT_PHY5, reg_base + PORT_PHY5); | 162 | writel(LS1021A_PORT_PHY5, reg_base + PORT_PHY5); |
| 160 | writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); | 163 | writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); |
| 164 | writel(AHCI_PORT_AXICC_CFG, reg_base + LS1021A_AXICC_ADDR); | ||
| 161 | break; | 165 | break; |
| 162 | 166 | ||
| 163 | case AHCI_LS1043A: | 167 | case AHCI_LS1043A: |
| 164 | writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1); | 168 | writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1); |
| 165 | writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); | 169 | writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); |
| 170 | writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); | ||
| 166 | break; | 171 | break; |
| 167 | 172 | ||
| 168 | case AHCI_LS2080A: | 173 | case AHCI_LS2080A: |
| 169 | writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1); | 174 | writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1); |
| 170 | writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); | 175 | writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); |
| 176 | writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); | ||
| 171 | break; | 177 | break; |
| 172 | } | 178 | } |
| 173 | 179 | ||
