e37941d
From ee16d90048ee985df6199c987e64daeac3378777 Mon Sep 17 00:00:00 2001
e37941d
From: Peter Robinson <pbrobinson@gmail.com>
e37941d
Date: Sat, 4 Mar 2017 14:26:19 +0000
e37941d
Subject: [PATCH] v2 mx6cuboxi: Add support for sata
e37941d
e37941d
The Cubox-i and Hummingboard series of devices have an option of
e37941d
SATA on board, and depending on how the fuses are blown even the
e37941d
option to boot SPL from SATA. So enable support for it so it can
e37941d
be used to boot the OS from if people desire.
e37941d
e37941d
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
e37941d
---
e37941d
 board/solidrun/mx6cuboxi/mx6cuboxi.c |  7 +++++++
e37941d
 include/configs/mx6cuboxi.h          | 12 ++++++++++++
e37941d
 2 files changed, 19 insertions(+)
e37941d
e37941d
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
e37941d
index 285588d..59a78df 100644
e37941d
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
e37941d
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
e37941d
@@ -22,6 +22,7 @@
e37941d
 #include <linux/errno.h>
e37941d
 #include <asm/gpio.h>
e37941d
 #include <asm/imx-common/iomux-v3.h>
e37941d
+#include <asm/imx-common/sata.h>
e37941d
 #include <asm/imx-common/video.h>
e37941d
 #include <mmc.h>
e37941d
 #include <fsl_esdhc.h>
e37941d
@@ -314,6 +315,12 @@ int board_early_init_f(void)
e37941d
 	ret = setup_display();
e37941d
 #endif
e37941d
 
e37941d
+#ifdef CONFIG_CMD_SATA
e37941d
+	/* Only mx6q/mx6q has SATA */
e37941d
+	if (is_mx6dq())
e37941d
+		setup_sata();
e37941d
+#endif
e37941d
+
e37941d
 #ifdef CONFIG_USB_EHCI_MX6
e37941d
 	setup_usb();
e37941d
 #endif
e37941d
diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h
e37941d
index 2782911..cec626a 100644
e37941d
--- a/include/configs/mx6cuboxi.h
e37941d
+++ b/include/configs/mx6cuboxi.h
e37941d
@@ -21,6 +21,17 @@
e37941d
 /* MMC Configs */
e37941d
 #define CONFIG_SYS_FSL_ESDHC_ADDR	USDHC2_BASE_ADDR
e37941d
 
e37941d
+/* SATA Configuration */
e37941d
+#define CONFIG_CMD_SATA
e37941d
+#ifdef CONFIG_CMD_SATA
e37941d
+#define CONFIG_DWC_AHSATA
e37941d
+#define CONFIG_SYS_SATA_MAX_DEVICE      1
e37941d
+#define CONFIG_DWC_AHSATA_PORT_ID       0
e37941d
+#define CONFIG_DWC_AHSATA_BASE_ADDR     SATA_ARB_BASE_ADDR
e37941d
+#define CONFIG_LBA48
e37941d
+#define CONFIG_LIBATA
e37941d
+#endif
e37941d
+
e37941d
 /* Ethernet Configuration */
e37941d
 #define CONFIG_FEC_MXC
e37941d
 #define CONFIG_MII
e37941d
@@ -119,6 +130,7 @@
e37941d
 
e37941d
 #define BOOT_TARGET_DEVICES(func) \
e37941d
 	func(MMC, mmc, 0) \
e37941d
+	func(SATA, sata, 0) \
e37941d
 	func(USB, usb, 0) \
e37941d
 	func(PXE, pxe, na) \
e37941d
 	func(DHCP, dhcp, na)
e37941d
-- 
e37941d
2.9.3
e37941d