aboutsummaryrefslogtreecommitdiffstats
path: root/board/amcc/canyonlands/canyonlands.c
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2008-03-03 17:27:02 +0100
committerStefan Roese <sr@denx.de>2008-03-15 07:28:05 +0100
commit71665ebf88408ff2acb762af47989fd4365b321a (patch)
tree7b728da4cbaf7b5d31d05315cc28ae33fbcbb183 /board/amcc/canyonlands/canyonlands.c
parentc813f1f835a7edfdb929f2843b09db72cd5cd2f2 (diff)
downloadu-boot-midas-71665ebf88408ff2acb762af47989fd4365b321a.tar.gz
u-boot-midas-71665ebf88408ff2acb762af47989fd4365b321a.tar.bz2
u-boot-midas-71665ebf88408ff2acb762af47989fd4365b321a.zip
ppc4xx: Add Canyonlands NAND booting support
460EX doesn't support a fixed bootstrap option to boot from 512 byte page NAND devices. The only bootstrap option for NAND booting is option F for 2k page devices. So to boot from a 512 bype page device, the I2C bootstrap EEPROM needs to be programmed accordingly. This patch adds basic NAND booting support for the AMCC Canyonlands aval board and also adds support to the "bootstrap" command, to enable NAND booting I2C setting. Tested with 512 byte page NAND device (32MByte) on Canyonlands. Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'board/amcc/canyonlands/canyonlands.c')
-rw-r--r--board/amcc/canyonlands/canyonlands.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/board/amcc/canyonlands/canyonlands.c b/board/amcc/canyonlands/canyonlands.c
index 8292d2d1fa..3551429696 100644
--- a/board/amcc/canyonlands/canyonlands.c
+++ b/board/amcc/canyonlands/canyonlands.c
@@ -134,6 +134,18 @@ u32 ddr_clktr(u32 default_val) {
return (SDRAM_CLKTR_CLKP_90_DEG_ADV);
}
+#if defined(CONFIG_NAND_U_BOOT)
+/*
+ * NAND booting U-Boot version uses a fixed initialization, since the whole
+ * I2C SPD DIMM autodetection/calibration doesn't fit into the 4k of boot
+ * code.
+ */
+long int initdram(int board_type)
+{
+ return CFG_MBYTES_SDRAM << 20;
+}
+#endif
+
#if defined(CFG_DRAM_TEST)
int testdram(void)
{
@@ -308,14 +320,14 @@ int board_early_init_r (void)
* EBC address which accepts bigger regions:
*
* 0xfc00.0000 -> 4.cc00.0000
- *
- * For this we have to remap the CS0 and re-relocate the envrironment,
- * since the original FLASH location which was needed upon startup is
- * now not correct anymore.
*/
/* Remap the NOR FLASH to 0xcc00.0000 ... 0xcfff.ffff */
+#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
+ mtebc(pb3cr, CFG_FLASH_BASE_PHYS_L | 0xda000);
+#else
mtebc(pb0cr, CFG_FLASH_BASE_PHYS_L | 0xda000);
+#endif
/* Remove TLB entry of boot EBC mapping */
remove_tlb(CFG_BOOT_BASE_ADDR, 16 << 20);
@@ -329,6 +341,13 @@ int board_early_init_r (void)
* 0xfc00.0000 is possible
*/
+ /*
+ * Clear potential errors resulting from auto-calibration.
+ * If not done, then we could get an interrupt later on when
+ * exceptions are enabled.
+ */
+ set_mcsr(get_mcsr());
+
return 0;
}