From c510f2e436008e55a50b063f2180cb1e63984224 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Thu, 28 Apr 2016 10:07:53 +0800 Subject: video: ipu_common: fix build error Some toolchains fail to build "clk->rate = (u64)(clk->parent->rate * 16) / div;" And the cast usage is wrong. Use the following code to fix the issue, " do_div(parent_rate, div); clk->rate = parent_rate; " Reported-by: Peter Robinson Signed-off-by: Peng Fan Cc: Stefano Babic Cc: Fabio Estevam Cc: Tom Rini Cc: Anatolij Gustschin Cc: Peter Robinson Reviewed-by: Tom Rini Tested-by: Peter Robinson --- drivers/video/ipu_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c index 36d4b23bfe..5676a0f083 100644 --- a/drivers/video/ipu_common.c +++ b/drivers/video/ipu_common.c @@ -352,7 +352,9 @@ static int ipu_pixel_clk_set_rate(struct clk *clk, unsigned long rate) */ __raw_writel((div / 16) << 16, DI_BS_CLKGEN1(clk->id)); - clk->rate = (u64)(clk->parent->rate * 16) / div; + do_div(parent_rate, div); + + clk->rate = parent_rate; return 0; } -- cgit v1.2.1 From aaeadd3f7b248aeb1c72c36183ab9c6e77da6ce2 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Wed, 20 Apr 2016 22:48:13 -0300 Subject: mx6ul_evk: Remove CONFIG_SUPPORT_EMMC_BOOT mx6ul_evk does not come with a eMMC populated, so we should not define CONFIG_SUPPORT_EMMC_BOOT as it causes SPL to not be able to boot some brands of SD cards, such as SanDisk microSD HC - 8GB: U-Boot SPL 2016.05-rc1-28384-g108f841 (Apr 19 2016 - 11:19:11) Trying to boot from MMC1 spl: mmc block read error SPL: failed to boot from all boot devices ### ERROR ### Please RESET the board ### When CONFIG_SUPPORT_EMMC_BOOT is defined spl_boot_mode() returns MMCSD_MODE_EMMCBOOT, so remove this option to have a reliable boot via SD card. Signed-off-by: Fabio Estevam --- include/configs/mx6ul_14x14_evk.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/configs/mx6ul_14x14_evk.h b/include/configs/mx6ul_14x14_evk.h index 15976f76cf..b2ba7734be 100644 --- a/include/configs/mx6ul_14x14_evk.h +++ b/include/configs/mx6ul_14x14_evk.h @@ -45,7 +45,6 @@ #define CONFIG_SYS_FSL_USDHC_NUM 2 #endif -#define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */ #endif /* I2C configs */ -- cgit v1.2.1 From 0782a8803d555d80f1a68887a18cc32fc7185627 Mon Sep 17 00:00:00 2001 From: Adrian Alonso Date: Mon, 2 May 2016 10:29:14 -0500 Subject: imx: tools: imximage: fix CLR bit command Fix incorrect parametr in CMD_CHECK_BITS_CLR command Pass CLR parameter to DCD header for CMD_CHECK_BITS_CLR Signed-off-by: Adrian Alonso --- tools/imximage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/imximage.c b/tools/imximage.c index 7c219222e9..092d550002 100644 --- a/tools/imximage.c +++ b/tools/imximage.c @@ -209,7 +209,7 @@ static void set_dcd_param_v2(struct imx_header *imxhdr, uint32_t dcd_len, d = d2; d->write_dcd_command.tag = DCD_CHECK_DATA_COMMAND_TAG; d->write_dcd_command.length = cpu_to_be16(4); - d->write_dcd_command.param = DCD_CHECK_BITS_SET_PARAM; + d->write_dcd_command.param = DCD_CHECK_BITS_CLR_PARAM; break; default: break; -- cgit v1.2.1 From 9f623326eb67b3475797940a21bb405649c0729b Mon Sep 17 00:00:00 2001 From: Eric Nelson Date: Sun, 24 Apr 2016 10:54:19 -0700 Subject: imx: mx6: mx6sl_pins: add GPIO variant for SD1_DAT5 This patch adds the IOMUX setting for using SD1_DAT5 as GPIO5:9. Signed-off-by: Eric Nelson Reviewed-by: Peng Fan --- arch/arm/include/asm/arch-mx6/mx6sl_pins.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/include/asm/arch-mx6/mx6sl_pins.h b/arch/arm/include/asm/arch-mx6/mx6sl_pins.h index 6ba1034b2e..919d83dd90 100644 --- a/arch/arm/include/asm/arch-mx6/mx6sl_pins.h +++ b/arch/arm/include/asm/arch-mx6/mx6sl_pins.h @@ -22,6 +22,7 @@ enum { MX6_PAD_SD1_DAT3__USDHC1_DAT3 = IOMUX_PAD(0x0548, 0x0240, 0, 0x0000, 0, 0), MX6_PAD_SD1_DAT4__USDHC1_DAT4 = IOMUX_PAD(0x054C, 0x0244, 0, 0x0000, 0, 0), MX6_PAD_SD1_DAT5__USDHC1_DAT5 = IOMUX_PAD(0x0550, 0x0248, 0, 0x0000, 0, 0), + MX6_PAD_SD1_DAT5__GPIO_5_9 = IOMUX_PAD(0x0550, 0x0248, 5, 0x0000, 0, 0), MX6_PAD_SD1_DAT6__USDHC1_DAT6 = IOMUX_PAD(0x0554, 0x024C, 0, 0x0000, 0, 0), MX6_PAD_SD1_DAT7__USDHC1_DAT7 = IOMUX_PAD(0x0558, 0x0250, 0, 0x0000, 0, 0), MX6_PAD_KEY_ROW7__GPIO_4_7 = IOMUX_PAD(0x04B0, 0x01A8, 5, 0x0000, 0, 0), -- cgit v1.2.1 From fdb396aae8e024303bb17baa6409c686ffc376be Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 28 Apr 2016 00:50:28 +0200 Subject: ARM: mx6: Enable STDIO deregistering on Novena Novena supports USB keyboard, which is a pluggable device and can be unplugged. Thus, we need to be able to deregister it's stdio device. Signed-off-by: Marek Vasut Cc: Stefano Babic --- include/configs/novena.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/novena.h b/include/configs/novena.h index cfb92d6356..e938fbc901 100644 --- a/include/configs/novena.h +++ b/include/configs/novena.h @@ -150,6 +150,7 @@ #define CONFIG_USB_EHCI_MX6 #define CONFIG_USB_STORAGE #define CONFIG_USB_KEYBOARD +#define CONFIG_SYS_STDIO_DEREGISTER #define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP #define CONFIG_USB_HOST_ETHER #define CONFIG_USB_ETHER_ASIX -- cgit v1.2.1 From 1fb51333952ec59fb83312c777bb3665e68f818d Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 5 May 2016 13:32:09 -0700 Subject: imx: iomux-v3: fix UART input selects Several UART input selects are missing. The fourth input select for UART2_TX_DATA_ALT0 is actually also missing in the documentation. (at least in Rev. B of the i.MX 7Dual Reference Manual). However, when looking at the tables of other input selects, it is very natural that there must be an input select for the UART2_TX_DATA_ALT0 pad. The Colibri iMX7 also uses that pad for UART2 RX (in DTE mode), and it was required to set that particular input select register to get a working UART2. --- arch/arm/include/asm/arch-mx7/mx7d_pins.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/include/asm/arch-mx7/mx7d_pins.h b/arch/arm/include/asm/arch-mx7/mx7d_pins.h index d8b4097262..0ab1246de8 100644 --- a/arch/arm/include/asm/arch-mx7/mx7d_pins.h +++ b/arch/arm/include/asm/arch-mx7/mx7d_pins.h @@ -635,7 +635,7 @@ enum { MX7D_PAD_LCD_DATA23__GPIO3_IO28 = IOMUX_PAD(0x0394, 0x0124, 5, 0x0000, 0, 0), MX7D_PAD_LCD_DATA23__I2C4_SDA = IOMUX_PAD(0x0394, 0x0124, IOMUX_CONFIG_SION | 6, 0x05F0, 1, 0), - MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX = IOMUX_PAD(0x0398, 0x0128, 0, 0x0000, 0, 0), + MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX = IOMUX_PAD(0x0398, 0x0128, 0, 0x06F4, 0, 0), MX7D_PAD_UART1_RX_DATA__UART1_DTE_TX = IOMUX_PAD(0x0398, 0x0128, 0, 0x0000, 0, 0), MX7D_PAD_UART1_RX_DATA__I2C1_SCL = IOMUX_PAD(0x0398, 0x0128, IOMUX_CONFIG_SION | 1, 0x0000, 0, 0), @@ -655,7 +655,7 @@ enum { MX7D_PAD_UART1_TX_DATA__GPIO4_IO1 = IOMUX_PAD(0x039C, 0x012C, 5, 0x0000, 0, 0), MX7D_PAD_UART1_TX_DATA__ENET1_MDC = IOMUX_PAD(0x039C, 0x012C, 6, 0x0000, 0, 0), - MX7D_PAD_UART2_RX_DATA__UART2_DCE_RX = IOMUX_PAD(0x03A0, 0x0130, 0, 0x0000, 0, 0), + MX7D_PAD_UART2_RX_DATA__UART2_DCE_RX = IOMUX_PAD(0x03A0, 0x0130, 0, 0x06FC, 2, 0), MX7D_PAD_UART2_RX_DATA__UART2_DTE_TX = IOMUX_PAD(0x03A0, 0x0130, 0, 0x0000, 0, 0), MX7D_PAD_UART2_RX_DATA__I2C2_SCL = IOMUX_PAD(0x03A0, 0x0130, IOMUX_CONFIG_SION | 1, 0x0000, 0, 0), @@ -667,7 +667,7 @@ enum { MX7D_PAD_UART2_TX_DATA__UART2_DCE_TX = IOMUX_PAD(0x03A4, 0x0134, 0, 0x0000, 0, 0), - MX7D_PAD_UART2_TX_DATA__UART2_DTE_RX = IOMUX_PAD(0x03A4, 0x0134, 0, 0x0000, 0, 0), + MX7D_PAD_UART2_TX_DATA__UART2_DTE_RX = IOMUX_PAD(0x03A4, 0x0134, 0, 0x06FC, 3, 0), MX7D_PAD_UART2_TX_DATA__I2C2_SDA = IOMUX_PAD(0x03A4, 0x0134, IOMUX_CONFIG_SION | 1, 0x05E0, 0, 0), MX7D_PAD_UART2_TX_DATA__SAI3_RX_DATA0 = IOMUX_PAD(0x03A4, 0x0134, 2, 0x06C8, 0, 0), MX7D_PAD_UART2_TX_DATA__ECSPI1_RDY = IOMUX_PAD(0x03A4, 0x0134, 3, 0x0000, 0, 0), @@ -695,7 +695,7 @@ enum { MX7D_PAD_UART3_TX_DATA__GPIO4_IO5 = IOMUX_PAD(0x03AC, 0x013C, 5, 0x0000, 0, 0), MX7D_PAD_UART3_TX_DATA__SD2_LCTL = IOMUX_PAD(0x03AC, 0x013C, 6, 0x0000, 0, 0), - MX7D_PAD_UART3_RTS_B__UART3_DCE_RTS = IOMUX_PAD(0x03B0, 0x0140, 0, 0x0000, 0, 0), + MX7D_PAD_UART3_RTS_B__UART3_DCE_RTS = IOMUX_PAD(0x03B0, 0x0140, 0, 0x0700, 2, 0), MX7D_PAD_UART3_RTS_B__UART3_DTE_CTS = IOMUX_PAD(0x03B0, 0x0140, 0, 0x0000, 0, 0), MX7D_PAD_UART3_RTS_B__USB_OTG2_OC = IOMUX_PAD(0x03B0, 0x0140, 1, 0x0000, 0, 0), -- cgit v1.2.1 From f716bf11f3f96e487772d9e47d413c7b30f26b6c Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 5 May 2016 13:42:45 -0700 Subject: imx: imx7d: fix ahb clock mux 1 The clock parent of the AHB root clock when using mux option 1 is the SYS PLL 270MHz clock. This is specified in Table 5-11 Clock Root Table of the i.MX 7Dual Applications Processor Reference Manual. While it could be a documentation error, the 270MHz parent is also mentioned in the boot ROM configuration in Table 6-28: The clock is by default at 135MHz due to a POST_PODF value of 1 (=> divider of 2). Signed-off-by: Stefan Agner --- arch/arm/cpu/armv7/mx7/clock_slice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/cpu/armv7/mx7/clock_slice.c b/arch/arm/cpu/armv7/mx7/clock_slice.c index ad5d504d28..1665df92ad 100644 --- a/arch/arm/cpu/armv7/mx7/clock_slice.c +++ b/arch/arm/cpu/armv7/mx7/clock_slice.c @@ -55,7 +55,7 @@ static struct clk_root_map root_array[] = { PLL_ENET_MAIN_250M_CLK, PLL_AUDIO_MAIN_CLK} }, {AHB_CLK_ROOT, CCM_AHB_CHANNEL, - {OSC_24M_CLK, PLL_SYS_PFD2_135M_CLK, PLL_DRAM_MAIN_533M_CLK, + {OSC_24M_CLK, PLL_SYS_PFD2_270M_CLK, PLL_DRAM_MAIN_533M_CLK, PLL_SYS_PFD0_392M_CLK, PLL_ENET_MAIN_125M_CLK, PLL_USB_MAIN_480M_CLK, PLL_AUDIO_MAIN_CLK, PLL_VIDEO_MAIN_CLK} }, -- cgit v1.2.1 From 249092fa81f3dd3fee94fd05973833e30405f3c4 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Fri, 6 May 2016 11:21:50 -0700 Subject: imx: imx-common: print i.MX 7 SoC names consistently According to the product website, the full names are i.MX 7Solo and i.MX 7Dual, whereas the short form is i.MX7S and i.MX7D. Be consistent and print the short form for both supported i.MX 7 SoCs. Signed-off-by: Stefan Agner Reviewed-by: Fabio Estevam --- arch/arm/imx-common/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c index 5fb3ed840f..4223187261 100644 --- a/arch/arm/imx-common/cpu.c +++ b/arch/arm/imx-common/cpu.c @@ -138,7 +138,7 @@ const char *get_imx_type(u32 imxtype) { switch (imxtype) { case MXC_CPU_MX7S: - return "7SOLO"; /* Single-core version of the mx7 */ + return "7S"; /* Single-core version of the mx7 */ case MXC_CPU_MX7D: return "7D"; /* Dual-core version of the mx7 */ case MXC_CPU_MX6QP: -- cgit v1.2.1 From 7e0f22674ae871460706f9cc8653487bb51e0804 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 29 Apr 2016 00:44:54 +0200 Subject: SPL: Let spl_parse_image_header() return value Allow the spl_parse_image_header() to return value. This is convenient for controlling the SPL boot flow if the loaded image is corrupted. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Peng Fan Cc: Stefano Babic Cc: Tom Rini --- common/spl/spl.c | 3 ++- common/spl/spl_ext.c | 6 +++++- common/spl/spl_fat.c | 4 +++- common/spl/spl_mmc.c | 6 +++++- common/spl/spl_nand.c | 9 +++++++-- common/spl/spl_net.c | 4 +--- common/spl/spl_nor.c | 9 +++++++-- common/spl/spl_onenand.c | 5 ++++- common/spl/spl_ymodem.c | 7 +++++-- drivers/mtd/spi/spi_spl_load.c | 10 ++++++++-- include/spl.h | 2 +- 11 files changed, 48 insertions(+), 17 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index 82e7f58e80..7259619516 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -73,7 +73,7 @@ void spl_set_header_raw_uboot(void) spl_image.name = "U-Boot"; } -void spl_parse_image_header(const struct image_header *header) +int spl_parse_image_header(const struct image_header *header) { u32 header_size = sizeof(struct image_header); @@ -118,6 +118,7 @@ void spl_parse_image_header(const struct image_header *header) spl_set_header_raw_uboot(); #endif } + return 0; } __weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c index b77dbf4d0c..ade5496600 100644 --- a/common/spl/spl_ext.c +++ b/common/spl/spl_ext.c @@ -48,7 +48,11 @@ int spl_load_image_ext(struct blk_desc *block_dev, goto end; } - spl_parse_image_header(header); + err = spl_parse_image_header(header); + if (err < 0) { + puts("spl: ext4fs_read failed\n"); + goto end; + } err = ext4fs_read((char *)spl_image.load_addr, filelen, &actlen); diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c index d761b264c1..338ea2f092 100644 --- a/common/spl/spl_fat.c +++ b/common/spl/spl_fat.c @@ -57,7 +57,9 @@ int spl_load_image_fat(struct blk_desc *block_dev, if (err <= 0) goto end; - spl_parse_image_header(header); + err = spl_parse_image_header(header); + if (err <= 0) + goto end; err = file_fat_read(filename, (u8 *)spl_image.load_addr, 0); diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 8d588d13a3..360c754050 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -23,8 +23,12 @@ static int mmc_load_legacy(struct mmc *mmc, ulong sector, { u32 image_size_sectors; unsigned long count; + int ret; + + ret = spl_parse_image_header(header); + if (ret) + return ret; - spl_parse_image_header(header); /* convert size to sectors - round up */ image_size_sectors = (spl_image.size + mmc->read_bl_len - 1) / mmc->read_bl_len; diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c index 79388ff326..bbd9546987 100644 --- a/common/spl/spl_nand.c +++ b/common/spl/spl_nand.c @@ -32,7 +32,10 @@ static int spl_nand_load_element(int offset, struct image_header *header) if (err) return err; - spl_parse_image_header(header); + err = spl_parse_image_header(header); + if (err) + return err; + return nand_spl_load_image(offset, spl_image.size, (void *)(unsigned long)spl_image.load_addr); } @@ -77,7 +80,9 @@ int spl_nand_load_image(void) /* load linux */ nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS, sizeof(*header), (void *)header); - spl_parse_image_header(header); + err = spl_parse_image_header(header); + if (err) + return err; if (header->ih_os == IH_OS_LINUX) { /* happy - was a linux */ err = nand_spl_load_image( diff --git a/common/spl/spl_net.c b/common/spl/spl_net.c index 63b20d8200..ae71d26f0a 100644 --- a/common/spl/spl_net.c +++ b/common/spl/spl_net.c @@ -34,7 +34,5 @@ int spl_net_load_image(const char *device) printf("Problem booting with BOOTP\n"); return rv; } - spl_parse_image_header((struct image_header *)load_addr); - - return 0; + return spl_parse_image_header((struct image_header *)load_addr); } diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c index d0bd0b0533..da2422f305 100644 --- a/common/spl/spl_nor.c +++ b/common/spl/spl_nor.c @@ -9,6 +9,7 @@ int spl_nor_load_image(void) { + int ret; /* * Loading of the payload to SDRAM is done with skipping of * the mkimage header in this SPL NOR driver @@ -28,7 +29,9 @@ int spl_nor_load_image(void) if (image_get_os(header) == IH_OS_LINUX) { /* happy - was a Linux */ - spl_parse_image_header(header); + ret = spl_parse_image_header(header); + if (ret) + return ret; memcpy((void *)spl_image.load_addr, (void *)(CONFIG_SYS_OS_BASE + @@ -56,8 +59,10 @@ int spl_nor_load_image(void) * Load real U-Boot from its location in NOR flash to its * defined location in SDRAM */ - spl_parse_image_header( + ret = spl_parse_image_header( (const struct image_header *)CONFIG_SYS_UBOOT_BASE); + if (ret) + return ret; memcpy((void *)(unsigned long)spl_image.load_addr, (void *)(CONFIG_SYS_UBOOT_BASE + sizeof(struct image_header)), diff --git a/common/spl/spl_onenand.c b/common/spl/spl_onenand.c index af7d82eb62..1a28a84e44 100644 --- a/common/spl/spl_onenand.c +++ b/common/spl/spl_onenand.c @@ -17,6 +17,7 @@ int spl_onenand_load_image(void) { struct image_header *header; + int ret; debug("spl: onenand\n"); @@ -25,7 +26,9 @@ int spl_onenand_load_image(void) /* Load u-boot */ onenand_spl_load_image(CONFIG_SYS_ONENAND_U_BOOT_OFFS, CONFIG_SYS_ONENAND_PAGE_SIZE, (void *)header); - spl_parse_image_header(header); + ret = spl_parse_image_header(header); + if (ret) + return ret; onenand_spl_load_image(CONFIG_SYS_ONENAND_U_BOOT_OFFS, spl_image.size, (void *)spl_image.load_addr); diff --git a/common/spl/spl_ymodem.c b/common/spl/spl_ymodem.c index 380d8ddf52..4f26ea5d21 100644 --- a/common/spl/spl_ymodem.c +++ b/common/spl/spl_ymodem.c @@ -40,8 +40,11 @@ int spl_ymodem_load_image(void) if (!ret) { while ((res = xyzModem_stream_read(buf, BUF_SIZE, &err)) > 0) { - if (addr == 0) - spl_parse_image_header((struct image_header *)buf); + if (addr == 0) { + ret = spl_parse_image_header((struct image_header *)buf); + if (ret) + return ret; + } store_addr = addr + spl_image.load_addr; size += res; addr += res; diff --git a/drivers/mtd/spi/spi_spl_load.c b/drivers/mtd/spi/spi_spl_load.c index ca56fe9015..46c98a9cee 100644 --- a/drivers/mtd/spi/spi_spl_load.c +++ b/drivers/mtd/spi/spi_spl_load.c @@ -23,6 +23,8 @@ static int spi_load_image_os(struct spi_flash *flash, struct image_header *header) { + int err; + /* Read for a header, parse or error out. */ spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, 0x40, (void *)header); @@ -30,7 +32,9 @@ static int spi_load_image_os(struct spi_flash *flash, if (image_get_magic(header) != IH_MAGIC) return -1; - spl_parse_image_header(header); + err = spl_parse_image_header(header); + if (err) + return err; spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, spl_image.size, (void *)spl_image.load_addr); @@ -81,7 +85,9 @@ int spl_spi_load_image(void) if (err) return err; - spl_parse_image_header(header); + err = spl_parse_image_header(header); + if (err) + return err; err = spi_flash_read(flash, CONFIG_SYS_SPI_U_BOOT_OFFS, spl_image.size, (void *)spl_image.load_addr); } diff --git a/include/spl.h b/include/spl.h index de4f70a377..7edfab46dc 100644 --- a/include/spl.h +++ b/include/spl.h @@ -56,7 +56,7 @@ void preloader_console_init(void); u32 spl_boot_device(void); u32 spl_boot_mode(void); void spl_set_header_raw_uboot(void); -void spl_parse_image_header(const struct image_header *header); +int spl_parse_image_header(const struct image_header *header); void spl_board_prepare_for_linux(void); void __noreturn jump_to_image_linux(void *arg); int spl_start_uboot(void); -- cgit v1.2.1 From e072751515d489b799c50b8c254367d4373403ee Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 29 Apr 2016 00:44:55 +0200 Subject: SPL: Add CONFIG_SPL_ABORT_ON_RAW_IMAGE When defined, SPL will proceed to another boot method if the image it has loaded does not have a signature. This is useful if the subsequent boot methods are much more complex. Signed-off-by: Marek Vasut Cc: Tom Rini Cc: Stefano Babic Cc: Peng Fan Cc: Fabio Estevam --- README | 4 ++++ common/spl/spl.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/README b/README index 88ff837d7c..d881da2de2 100644 --- a/README +++ b/README @@ -3487,6 +3487,10 @@ FIT uImage format: consider that a completely unreadable NAND block is bad, and thus should be skipped silently. + CONFIG_SPL_ABORT_ON_RAW_IMAGE + When defined, SPL will proceed to another boot method + if the image it has loaded does not have a signature. + CONFIG_SPL_RELOC_STACK Adress of the start of the stack SPL will use after relocation. If unspecified, this is equal to diff --git a/common/spl/spl.c b/common/spl/spl.c index 7259619516..93f9bd13fc 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -111,6 +111,9 @@ int spl_parse_image_header(const struct image_header *header) * is bad, and thus should be skipped silently. */ panic("** no mkimage signature but raw image not supported"); +#elif defined(CONFIG_SPL_ABORT_ON_RAW_IMAGE) + /* Signature not found, proceed to other boot methods. */ + return -EINVAL; #else /* Signature not found - assume u-boot.bin */ debug("mkimage signature not found - ih_magic = %x\n", -- cgit v1.2.1 From 291000894ed4d6257830baba547764b86e335b5c Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 29 Apr 2016 00:44:56 +0200 Subject: ARM: mx6: Enable MMC and SATA extfs boot support Enable support for booting U-Boot image from ext filesystem when either SD/MMC or SATA support is compiled into the SPL. This will allow easy transition from loading U-Boot image from ad-hoc offset on the card to loading U-Boot image from the filesystem. VFAT support is intently not enabled. The boot order is tweaked so that raw is tested first and if the raw has no signature, FS boot is attempted. To install just the SPL on i.MX6 board, perform the following operation $ dd if=SPL of=/dev/sdX seek=2 bs=512 To install the U-Boot image, copy u-boot.img to the first partition of the SD/MMC/SATA drive. The partition must be formated to extfs. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Peng Fan Cc: Stefano Babic Cc: Tom Rini --- include/configs/imx6_spl.h | 4 ++++ include/configs/novena.h | 1 - include/configs/tqma6.h | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/configs/imx6_spl.h b/include/configs/imx6_spl.h index 68d3fd7384..9bd9f6e3e4 100644 --- a/include/configs/imx6_spl.h +++ b/include/configs/imx6_spl.h @@ -48,12 +48,16 @@ #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 800 /* 400 KB */ #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 #define CONFIG_SYS_MONITOR_LEN (CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS/2*1024) +#define CONFIG_SPL_ABORT_ON_RAW_IMAGE +#define CONFIG_SPL_EXT_SUPPORT #endif /* SATA support */ #if defined(CONFIG_SPL_SATA_SUPPORT) #define CONFIG_SPL_SATA_BOOT_DEVICE 0 #define CONFIG_SYS_SATA_FAT_BOOT_PARTITION 1 +#define CONFIG_SPL_ABORT_ON_RAW_IMAGE +#define CONFIG_SPL_EXT_SUPPORT #endif /* Define the payload for FAT/EXT support */ diff --git a/include/configs/novena.h b/include/configs/novena.h index e938fbc901..2382951873 100644 --- a/include/configs/novena.h +++ b/include/configs/novena.h @@ -75,7 +75,6 @@ /* SPL */ #define CONFIG_SPL_FAT_SUPPORT -#define CONFIG_SPL_EXT_SUPPORT #define CONFIG_SPL_MMC_SUPPORT #include "imx6_spl.h" /* common IMX6 SPL configuration */ diff --git a/include/configs/tqma6.h b/include/configs/tqma6.h index badb955241..77ced7179a 100644 --- a/include/configs/tqma6.h +++ b/include/configs/tqma6.h @@ -16,7 +16,6 @@ #define CONFIG_SPL_MMC_SUPPORT #define CONFIG_SPL_SPI_SUPPORT #define CONFIG_SPL_FAT_SUPPORT -#define CONFIG_SPL_EXT_SUPPORT /* common IMX6 SPL configuration */ #include "imx6_spl.h" -- cgit v1.2.1