]> git.sur5r.net Git - u-boot/commitdiff
powerpc: spiflash:Add corenet devices support in eSPI SPL
authorPriyanka Jain <Priyanka.Jain@freescale.com>
Thu, 28 Nov 2013 04:38:12 +0000 (10:08 +0530)
committerYork Sun <yorksun@freescale.com>
Wed, 4 Dec 2013 22:54:34 +0000 (14:54 -0800)
Existing eSPI SPL framework assumes booting from spi-image
with boot_format header which contains final u-boot Image
offset and size. No such header is present in case of
corenet devices like T1040 as corenet deivces use PBI-RCW
based intialization.

So, for corenet deives, SPL bootloader use values provided
at compilation time. These values can be defined in board
specific config file.

Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
Acked-by: York Sun <yorksun@freescale.com>
drivers/mtd/spi/fsl_espi_spl.c

index 6263d8c2217e5385bce3f3778b6c774215c0002b..e5ac79b9520db5e975575229e74266015f099997 100644 (file)
@@ -31,6 +31,10 @@ void spi_boot(void)
                hang();
        }
 
+#ifdef CONFIG_FSL_CORENET
+       offset = CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS;
+       code_len = CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE;
+#else
        /*
        * Load U-Boot image from SPI flash into RAM
        */
@@ -50,6 +54,7 @@ void spi_boot(void)
        code_len = *(u32 *)(buf + ESPI_BOOT_IMAGE_SIZE);
        /* Skip spl code */
        code_len = code_len - CONFIG_SPL_MAX_SIZE;
+#endif
        /* copy code to DDR */
        spi_flash_read(flash, offset, code_len,
                       (void *)CONFIG_SYS_SPI_FLASH_U_BOOT_DST);