[U-Boot] [PATCH 2/3] ARM: zynqmp: Wire up SATA for the board

Michal Simek michal.simek at xilinx.com
Thu Jul 23 13:53:08 CEST 2015


Enable SATA for the ZynqMP targets.

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 arch/arm/include/asm/arch-zynqmp/hardware.h |  2 ++
 board/xilinx/zynqmp/zynqmp.c                | 10 ++++++++++
 include/configs/xilinx_zynqmp.h             | 11 +++++++++++
 include/configs/xilinx_zynqmp_ep.h          |  1 +
 4 files changed, 24 insertions(+)

diff --git a/arch/arm/include/asm/arch-zynqmp/hardware.h b/arch/arm/include/asm/arch-zynqmp/hardware.h
index 5d191e848cca..7640eabad13e 100644
--- a/arch/arm/include/asm/arch-zynqmp/hardware.h
+++ b/arch/arm/include/asm/arch-zynqmp/hardware.h
@@ -25,6 +25,8 @@
 #define ZYNQ_SDHCI_BASEADDR0	0xFF160000
 #define ZYNQ_SDHCI_BASEADDR1	0xFF170000
 
+#define ZYNQMP_SATA_BASEADDR	0xFD0C0000
+
 #define ZYNQMP_CRL_APB_BASEADDR	0xFF5E0000
 #define ZYNQMP_CRL_APB_TIMESTAMP_REF_CTRL_CLKACT	0x1000000
 
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index fb43cb0b9aa2..88fe3e844f5b 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -7,6 +7,8 @@
 
 #include <common.h>
 #include <netdev.h>
+#include <ahci.h>
+#include <scsi.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/io.h>
@@ -51,6 +53,14 @@ void reset_cpu(ulong addr)
 {
 }
 
+#ifdef CONFIG_SCSI_AHCI_PLAT
+void scsi_init(void)
+{
+	ahci_init((void __iomem *)ZYNQMP_SATA_BASEADDR);
+	scsi_scan(1);
+}
+#endif
+
 int board_eth_init(bd_t *bis)
 {
 	u32 ret = 0;
diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
index 9ed8771ff507..68853b64de53 100644
--- a/include/configs/xilinx_zynqmp.h
+++ b/include/configs/xilinx_zynqmp.h
@@ -169,6 +169,17 @@
 # define CONFIG_SYS_EEPROM_SIZE			(64 * 1024)
 #endif
 
+#ifdef CONFIG_AHCI
+#define CONFIG_LIBATA
+#define CONFIG_SCSI_AHCI
+#define CONFIG_SCSI_AHCI_PLAT
+#define CONFIG_SYS_SCSI_MAX_SCSI_ID	1
+#define CONFIG_SYS_SCSI_MAX_LUN		1
+#define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
+					 CONFIG_SYS_SCSI_MAX_LUN)
+#define CONFIG_CMD_SCSI
+#endif
+
 #define CONFIG_FIT
 #define CONFIG_FIT_VERBOSE       /* enable fit_format_{error,warning}() */
 
diff --git a/include/configs/xilinx_zynqmp_ep.h b/include/configs/xilinx_zynqmp_ep.h
index 40a110dab2fd..c872f7ce8aac 100644
--- a/include/configs/xilinx_zynqmp_ep.h
+++ b/include/configs/xilinx_zynqmp_ep.h
@@ -20,6 +20,7 @@
 #define CONFIG_ZYNQ_I2C0
 #define CONFIG_SYS_I2C_ZYNQ
 #define CONFIG_ZYNQ_EEPROM
+#define CONFIG_AHCI
 
 #include <configs/xilinx_zynqmp.h>
 
-- 
2.3.5



More information about the U-Boot mailing list