summaryrefslogtreecommitdiff
path: root/board/freescale/mpc8313erdb/mpc8313erdb.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2008-06-30 14:13:28 -0500
committerScott Wood <scottwood@freescale.com>2008-08-12 11:31:31 -0500
commite4c09508545d1c45617ba45391c03c03cbc360b9 (patch)
treee852df200e5d41e954f43c1f315a5cd482173a65 /board/freescale/mpc8313erdb/mpc8313erdb.c
parentacdab5c33f1ea6f5e08f06f08bc64af23ff40d71 (diff)
downloadu-boot-imx-e4c09508545d1c45617ba45391c03c03cbc360b9.zip
u-boot-imx-e4c09508545d1c45617ba45391c03c03cbc360b9.tar.gz
u-boot-imx-e4c09508545d1c45617ba45391c03c03cbc360b9.tar.bz2
NAND boot: MPC8313ERDB support
Note that with older board revisions, NAND boot may only work after a power-on reset, and not after a warm reset. I don't have a newer board to test on; if you have a board with a 33MHz crystal, please let me know if it works after a warm reset. Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'board/freescale/mpc8313erdb/mpc8313erdb.c')
-rw-r--r--board/freescale/mpc8313erdb/mpc8313erdb.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/board/freescale/mpc8313erdb/mpc8313erdb.c b/board/freescale/mpc8313erdb/mpc8313erdb.c
index 7cbdb7b..ebb703d 100644
--- a/board/freescale/mpc8313erdb/mpc8313erdb.c
+++ b/board/freescale/mpc8313erdb/mpc8313erdb.c
@@ -29,6 +29,8 @@
#include <pci.h>
#include <mpc83xx.h>
#include <vsc7385.h>
+#include <ns16550.h>
+#include <nand.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -50,6 +52,7 @@ int checkboard(void)
return 0;
}
+#ifndef CONFIG_NAND_SPL
static struct pci_region pci_regions[] = {
{
bus_start: CFG_PCI1_MEM_BASE,
@@ -128,3 +131,32 @@ void ft_board_setup(void *blob, bd_t *bd)
#endif
}
#endif
+#else /* CONFIG_NAND_SPL */
+void board_init_f(ulong bootflag)
+{
+ board_early_init_f();
+ NS16550_init((NS16550_t)(CFG_IMMR + 0x4500),
+ CFG_NS16550_CLK / 16 / CONFIG_BAUDRATE);
+ puts("NAND boot... ");
+ init_timebase();
+ initdram(0);
+ relocate_code(CFG_NAND_U_BOOT_RELOC + 0x10000, (gd_t *)gd,
+ CFG_NAND_U_BOOT_RELOC);
+}
+
+void board_init_r(gd_t *gd, ulong dest_addr)
+{
+ nand_boot();
+}
+
+void putc(char c)
+{
+ if (gd->flags & GD_FLG_SILENT)
+ return;
+
+ if (c == '\n')
+ NS16550_putc((NS16550_t)(CFG_IMMR + 0x4500), '\r');
+
+ NS16550_putc((NS16550_t)(CFG_IMMR + 0x4500), c);
+}
+#endif