From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Gray Date: Tue, 16 May 2017 15:50:38 +1000 Subject: [U-Boot] [PATCH 2/2] mx6cuboxi: Add support for sata In-Reply-To: <20170515172446.1014-3-pbrobinson@gmail.com> References: <20170515172446.1014-1-pbrobinson@gmail.com> <20170515172446.1014-3-pbrobinson@gmail.com> Message-ID: <20170516055038.GB28731@largo.jsg.id.au> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, May 15, 2017 at 06:24:46PM +0100, Peter Robinson wrote: > 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. > > Signed-off-by: Peter Robinson > --- > board/solidrun/mx6cuboxi/mx6cuboxi.c | 7 +++++++ > configs/mx6cuboxi_defconfig | 23 ++++++++++++----------- > include/configs/mx6cuboxi.h | 11 +++++++++++ > 3 files changed, 30 insertions(+), 11 deletions(-) > > diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c > index 285588d80a..59a78dfa6a 100644 > --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c > +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c > @@ -22,6 +22,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -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_mx6dq()) > + setup_sata(); Comment was intended to be mx6d/mx6q? Though the test here may not be needed as setup_sata() returns early if not available. And mx6cuboxi.c wouldn't need to be updated here if a i.MX 6DualPlus or i.MX 6QuadPlus board from SolidRun shows up at some point in the future. u-boot/arch/arm/imx-common/sata.c int setup_sata(void) { struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR; int ret; if (!is_mx6dq() && !is_mx6dqp()) return 1; > +#endif > + > #ifdef CONFIG_USB_EHCI_MX6 > setup_usb(); > #endif > diff --git a/configs/mx6cuboxi_defconfig b/configs/mx6cuboxi_defconfig > index c34beb74e2..ca5f5189f6 100644 > --- a/configs/mx6cuboxi_defconfig > +++ b/configs/mx6cuboxi_defconfig > @@ -1,30 +1,31 @@ > CONFIG_ARM=y > CONFIG_ARCH_MX6=y > +CONFIG_TARGET_MX6CUBOXI=y > +CONFIG_SPL=y > +CONFIG_SPL_EXT_SUPPORT=y > CONFIG_SPL_GPIO_SUPPORT=y > +CONFIG_SPL_I2C_SUPPORT=y > CONFIG_SPL_LIBCOMMON_SUPPORT=y > +CONFIG_SPL_LIBDISK_SUPPORT=y > CONFIG_SPL_LIBGENERIC_SUPPORT=y > -CONFIG_TARGET_MX6CUBOXI=y > CONFIG_SPL_MMC_SUPPORT=y > +# CONFIG_SPL_PARTITION_UUIDS is not set > CONFIG_SPL_SERIAL_SUPPORT=y > -CONFIG_SPL_LIBDISK_SUPPORT=y > CONFIG_SPL_WATCHDOG_SUPPORT=y > -# CONFIG_CMD_BMODE is not set > CONFIG_VIDEO=y > CONFIG_DISTRO_DEFAULTS=y > CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL" > # CONFIG_SYS_STDIO_DEREGISTER is not set > CONFIG_BOARD_EARLY_INIT_F=y > -CONFIG_SPL=y > -CONFIG_SPL_EXT_SUPPORT=y > -CONFIG_SPL_I2C_SUPPORT=y > -# CONFIG_CMD_IMLS is not set > +# CONFIG_CMD_BMODE is not set > +CONFIG_CMD_CACHE=y > +CONFIG_CMD_EXT4_WRITE=y > # CONFIG_CMD_FLASH is not set > +CONFIG_CMD_GPIO=y > +# CONFIG_CMD_IMLS is not set > CONFIG_CMD_MMC=y > +CONFIG_CMD_SATA=y > CONFIG_CMD_USB=y > -CONFIG_CMD_GPIO=y > -CONFIG_CMD_CACHE=y > -CONFIG_CMD_EXT4_WRITE=y > -# CONFIG_SPL_PARTITION_UUIDS is not set > CONFIG_DM=y > CONFIG_DM_THERMAL=y > CONFIG_USB=y > diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h > index 84fdf656cd..be071769fc 100644 > --- a/include/configs/mx6cuboxi.h > +++ b/include/configs/mx6cuboxi.h > @@ -21,6 +21,16 @@ > /* MMC Configs */ > #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC2_BASE_ADDR > > +/* SATA Configuration */ > +#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 +129,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) > -- > 2.13.0 > > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > https://lists.denx.de/listinfo/u-boot