summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-08-09 16:48:34 +0200
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-08-09 16:48:34 +0200
commit1899fac925eda817e12234aef3d01d354788662e (patch)
treebaed464b3d9250361cd85e931a16d87b397cc36f /drivers/block
parente76b933e02e1b38e48754c435e9dba1c0deeb3c6 (diff)
parent3340eab26d89176dd0bf543e6d2590665c577423 (diff)
downloadu-boot-imx-1899fac925eda817e12234aef3d01d354788662e.zip
u-boot-imx-1899fac925eda817e12234aef3d01d354788662e.tar.gz
u-boot-imx-1899fac925eda817e12234aef3d01d354788662e.tar.bz2
Merge branch 'u-boot-sunxi/master' into 'u-boot-arm/master'
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/ahci.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
index 4df8046..dce99ad 100644
--- a/drivers/block/ahci.c
+++ b/drivers/block/ahci.c
@@ -129,6 +129,14 @@ int __weak ahci_link_up(struct ahci_probe_ent *probe_ent, u8 port)
return 1;
}
+#ifdef CONFIG_SUNXI_AHCI
+/* The sunxi AHCI controller requires this undocumented setup */
+static void sunxi_dma_init(volatile u8 *port_mmio)
+{
+ clrsetbits_le32(port_mmio + PORT_P0DMACR, 0x0000ff00, 0x00004400);
+}
+#endif
+
static int ahci_host_init(struct ahci_probe_ent *probe_ent)
{
#ifndef CONFIG_SCSI_AHCI_PLAT
@@ -213,6 +221,10 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent)
msleep(500);
}
+#ifdef CONFIG_SUNXI_AHCI
+ sunxi_dma_init(port_mmio);
+#endif
+
/* Add the spinup command to whatever mode bits may
* already be on in the command register.
*/
@@ -545,6 +557,10 @@ static int ahci_port_start(u8 port)
writel_with_flush(pp->rx_fis, port_mmio + PORT_FIS_ADDR);
+#ifdef CONFIG_SUNXI_AHCI
+ sunxi_dma_init(port_mmio);
+#endif
+
writel_with_flush(PORT_CMD_ICC_ACTIVE | PORT_CMD_FIS_RX |
PORT_CMD_POWER_ON | PORT_CMD_SPIN_UP |
PORT_CMD_START, port_mmio + PORT_CMD);