X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=nand_spl%2Fnand_boot_fsl_elbc.c;h=ff47d55311e21cc57b42d8808c972a11f3668a97;hb=4b99327a4121a28d2bdb2c2b841f5d97931ae905;hp=273478f72c9f74643faf1bcd1f2726e1bf672215;hpb=6d0f6bcf337c5261c08fabe12982178c2c489d76;p=u-boot diff --git a/nand_spl/nand_boot_fsl_elbc.c b/nand_spl/nand_boot_fsl_elbc.c index 273478f72c..ff47d55311 100644 --- a/nand_spl/nand_boot_fsl_elbc.c +++ b/nand_spl/nand_boot_fsl_elbc.c @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -33,7 +32,7 @@ static void nand_wait(void) { - lbus83xx_t *regs = (lbus83xx_t *)(CONFIG_SYS_IMMR + 0x5000); + fsl_lbus_t *regs = (fsl_lbus_t *)(CONFIG_SYS_IMMR + 0x5000); for (;;) { uint32_t status = in_be32(®s->ltesr); @@ -50,7 +49,7 @@ static void nand_wait(void) static void nand_load(unsigned int offs, int uboot_size, uchar *dst) { - lbus83xx_t *regs = (lbus83xx_t *)(CONFIG_SYS_IMMR + 0x5000); + fsl_lbus_t *regs = (fsl_lbus_t *)(CONFIG_SYS_IMMR + 0x5000); uchar *buf = (uchar *)CONFIG_SYS_NAND_BASE; int large = in_be32(®s->bank[0].or) & OR_FCM_PGS; int block_shift = large ? 17 : 14; @@ -120,7 +119,7 @@ static void nand_load(unsigned int offs, int uboot_size, uchar *dst) pos += page_size; offs += page_size; - } while (offs & (block_size - 1)); + } while ((offs & (block_size - 1)) && (pos < uboot_size)); } } @@ -143,6 +142,11 @@ void nand_boot(void) * Jump to U-Boot image */ puts("transfering control\n"); + /* + * Clean d-cache and invalidate i-cache, to + * make sure that no stale data is executed. + */ + flush_cache(CONFIG_SYS_NAND_U_BOOT_DST, CONFIG_SYS_NAND_U_BOOT_SIZE); uboot = (void *)CONFIG_SYS_NAND_U_BOOT_START; uboot(); }