summaryrefslogtreecommitdiff
path: root/board/freescale/mpc8569mds/mpc8569mds.c
diff options
context:
space:
mode:
authorHaiying Wang <Haiying.Wang@freescale.com>2010-09-29 13:31:35 -0400
committerKumar Gala <galak@kernel.crashing.org>2010-10-07 09:49:47 -0500
commit3aed55074211b4e886d97f16773f186a019d508d (patch)
treed2190f2ebb454371f411328097a44ddb0ddb58e2 /board/freescale/mpc8569mds/mpc8569mds.c
parent1b8e4fa1a093c818b53c8b6d959bcfde41fbe065 (diff)
downloadu-boot-imx-3aed55074211b4e886d97f16773f186a019d508d.zip
u-boot-imx-3aed55074211b4e886d97f16773f186a019d508d.tar.gz
u-boot-imx-3aed55074211b4e886d97f16773f186a019d508d.tar.bz2
mpc8569mds: fix consuming long time while relocating code.
The original code maps boot flash as non-cacheable region. When calling relocate_code in flash to copy u-boot from flash to ddr, every loop copy command is read from flash. The flash read speed will be the bottleneck, which consuming long time to do this operation. To resovle this, map the boot flash as write-through cache via tlb. And set tlb to remap the flash after code executing in ddr, to confirm flash erase operation properly done. Signed-off-by: Kai.Jiang <Kai.Jiang@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'board/freescale/mpc8569mds/mpc8569mds.c')
-rw-r--r--board/freescale/mpc8569mds/mpc8569mds.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/board/freescale/mpc8569mds/mpc8569mds.c b/board/freescale/mpc8569mds/mpc8569mds.c
index 01b7dcb..795e565 100644
--- a/board/freescale/mpc8569mds/mpc8569mds.c
+++ b/board/freescale/mpc8569mds/mpc8569mds.c
@@ -27,6 +27,7 @@
#include <pci.h>
#include <asm/processor.h>
#include <asm/mmu.h>
+#include <asm/cache.h>
#include <asm/immap_85xx.h>
#include <asm/fsl_pci.h>
#include <asm/fsl_ddr_sdram.h>
@@ -211,6 +212,31 @@ int board_early_init_f (void)
return 0;
}
+int board_early_init_r(void)
+{
+ const unsigned int flashbase = CONFIG_SYS_NAND_BASE;
+ const u8 flash_esel = 0;
+
+ /*
+ * Remap Boot flash to caching-inhibited
+ * so that flash can be erased properly.
+ */
+
+ /* Flush d-cache and invalidate i-cache of any FLASH data */
+ flush_dcache();
+ invalidate_icache();
+
+ /* invalidate existing TLB entry for flash */
+ disable_tlb(flash_esel);
+
+ set_tlb(1, flashbase, CONFIG_SYS_NAND_BASE, /* tlb, epn, rpn */
+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, /* perms, wimge */
+ 0, flash_esel, /* ts, esel */
+ BOOKE_PAGESZ_64M, 1); /* tsize, iprot */
+
+ return 0;
+}
+
int checkboard (void)
{
printf ("Board: 8569 MDS\n");