Skip to contentSkip to conversation

mx6cuboxi: Add support for sata

PATCH New Peter Robinson 3 participants 5 messages Mar 4, 2017 – May 15, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mx6cuboxi: Add support for sata

The Cubox-i and Hummingboard series of devices have an option of SATA on board, and depending on how the fuses are blown even the option to boot SPL from SATA. So enable support for it so it can be used to boot the OS from if people desire.

---
 board/solidrun/mx6cuboxi/mx6cuboxi.c |  7 +++++++
 include/configs/mx6cuboxi.h          | 12 ++++++++++++
 2 files changed, 19 insertions(+)
board/solidrun/mx6cuboxi/mx6cuboxi.c +7 -0
index 285588d..4d8bc80 100644
@@ -22,6 +22,7 @@
 #include <linux/errno.h>
 #include <asm/gpio.h>
 #include <asm/imx-common/iomux-v3.h>
+#include <asm/imx-common/sata.h>
 #include <asm/imx-common/video.h>
 #include <mmc.h>
 #include <fsl_esdhc.h>
@@ -314,6 +315,12 @@ int board_early_init_f(void)
 	ret = setup_display();
 #endif
 
+#ifdef CONFIG_CMD_SATA
+	/* Only mx6q/mx6q has SATA */
+	if (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D))
+		setup_sata();
+#endif
+
 #ifdef CONFIG_USB_EHCI_MX6
 	setup_usb();
 #endif
include/configs/mx6cuboxi.h +12 -0
index 2782911..cec626a 100644
@@ -21,6 +21,17 @@
 /* MMC Configs */
 #define CONFIG_SYS_FSL_ESDHC_ADDR	USDHC2_BASE_ADDR
 
+/* SATA Configuration */
+#define CONFIG_CMD_SATA
+#ifdef CONFIG_CMD_SATA
+#define CONFIG_DWC_AHSATA
+#define CONFIG_SYS_SATA_MAX_DEVICE      1
+#define CONFIG_DWC_AHSATA_PORT_ID       0
+#define CONFIG_DWC_AHSATA_BASE_ADDR     SATA_ARB_BASE_ADDR
+#define CONFIG_LBA48
+#define CONFIG_LIBATA
+#endif
+
 /* Ethernet Configuration */
 #define CONFIG_FEC_MXC
 #define CONFIG_MII
@@ -119,6 +130,7 @@
 
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 0) \
+	func(SATA, sata, 0) \
 	func(USB, usb, 0) \
 	func(PXE, pxe, na) \
 	func(DHCP, dhcp, na)
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 mx6cuboxi: Add support for sata

board/solidrun/mx6cuboxi/mx6cuboxi.c int board_early_init_f(void) · line 320

Quoted 3 lines · Peter Robinson
board/solidrun/mx6cuboxi/mx6cuboxi.c +3 -0
+#ifdef CONFIG_CMD_SATA
+       /* Only mx6q/mx6q has SATA */
+       if (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D))

Could you use if(is_mx6dq()) instead?

#2 lore raw

PATCH 1/1 mx6cuboxi: Add support for sata

Quoted 7 lines · Fabio Estevam

board/solidrun/mx6cuboxi/mx6cuboxi.c int board_early_init_f(void) · line 320

Quoted 3 lines · Peter Robinson
board/solidrun/mx6cuboxi/mx6cuboxi.c +3 -0
+#ifdef CONFIG_CMD_SATA
+       /* Only mx6q/mx6q has SATA */
+       if (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D))

Could you use if(is_mx6dq()) instead?

Sure

#3 lore raw

PATCH 1/1 mx6cuboxi: Add support for sata

In reply to Peter Robinson
Quoted 9 lines · Peter Robinson

The Cubox-i and Hummingboard series of devices have an option of SATA on board, and depending on how the fuses are blown even the option to boot SPL from SATA. So enable support for it so it can be used to boot the OS from if people desire.

---
 board/solidrun/mx6cuboxi/mx6cuboxi.c |  7 +++++++
 include/configs/mx6cuboxi.h          | 12 ++++++++++++

[snip]

include/configs/mx6cuboxi.h line 26

Quoted 3 lines
include/configs/mx6cuboxi.h +3 -0
+/* SATA Configuration */
+#define CONFIG_CMD_SATA
+#ifdef CONFIG_CMD_SATA

Please move CMD_SATA to cmd/Kconfig. You don't have to migrate everyone over.

include/configs/mx6cuboxi.h line 32

Quoted 6 lines
include/configs/mx6cuboxi.h +6 -0
+#define CONFIG_DWC_AHSATA
+#define CONFIG_SYS_SATA_MAX_DEVICE      1
+#define CONFIG_DWC_AHSATA_PORT_ID       0
+#define CONFIG_DWC_AHSATA_BASE_ADDR     SATA_ARB_BASE_ADDR
+#define CONFIG_LBA48
+#define CONFIG_LIBATA

Bonus points if you move some these over to the existing sata section on drivers/block/Kconfig :)

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170304/cca41ae5/attachment.sig>
#4 lore raw

PATCH 1/1 mx6cuboxi: Add support for sata

Quoted 10 lines · Tom Rini
Quoted 9 lines · Peter Robinson

The Cubox-i and Hummingboard series of devices have an option of SATA on board, and depending on how the fuses are blown even the option to boot SPL from SATA. So enable support for it so it can be used to boot the OS from if people desire.

---
 board/solidrun/mx6cuboxi/mx6cuboxi.c |  7 +++++++
 include/configs/mx6cuboxi.h          | 12 ++++++++++++
Quoted 7 lines

[snip]

include/configs/mx6cuboxi.h line 26

Quoted 3 lines
include/configs/mx6cuboxi.h +3 -0
+/* SATA Configuration */
+#define CONFIG_CMD_SATA
+#ifdef CONFIG_CMD_SATA

Please move CMD_SATA to cmd/Kconfig. You don't have to migrate everyone over.

New patch series, well one for the CMD_SATA stuff, coming that I believe addresses that.

Quoted 9 lines

include/configs/mx6cuboxi.h line 32

Quoted 6 lines
include/configs/mx6cuboxi.h +6 -0
+#define CONFIG_DWC_AHSATA
+#define CONFIG_SYS_SATA_MAX_DEVICE      1
+#define CONFIG_DWC_AHSATA_PORT_ID       0
+#define CONFIG_DWC_AHSATA_BASE_ADDR     SATA_ARB_BASE_ADDR
+#define CONFIG_LBA48
+#define CONFIG_LIBATA

Bonus points if you move some these over to the existing sata section on drivers/block/Kconfig :)

I'm looking at a few of those as well but I'll send that separately.

Patches inbound shortly, sorry for the delays.

Peter