NDS32: Generic Board Support and Unsupport
Add nds32 ag101p generic board support.
Signed-off-by: Kun-Hua Huang <kunhua@andestech.com>
diff --git a/common/board_f.c b/common/board_f.c
index fe75656..613332e 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -272,6 +272,8 @@
gd->mon_len = (ulong)&_end - (ulong)_init;
#elif defined(CONFIG_BLACKFIN) || defined(CONFIG_NIOS2)
gd->mon_len = CONFIG_SYS_MONITOR_LEN;
+#elif defined(CONFIG_NDS32)
+ gd->mon_len = (ulong)(&__bss_end) - (ulong)(&_start);
#else
/* TODO: use (ulong)&__bss_end - (ulong)&__text_start; ? */
gd->mon_len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE;
@@ -792,7 +794,8 @@
/* TODO: can we rename this to timer_init()? */
init_timebase,
#endif
-#if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || defined(CONFIG_BLACKFIN)
+#if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || \
+ defined(CONFIG_BLACKFIN) || defined(CONFIG_NDS32)
timer_init, /* initialize timer */
#endif
#ifdef CONFIG_SYS_ALLOC_DPRAM
@@ -858,7 +861,8 @@
#endif
announce_dram_init,
/* TODO: unify all these dram functions? */
-#if defined(CONFIG_ARM) || defined(CONFIG_X86) || defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32)
+#if defined(CONFIG_ARM) || defined(CONFIG_X86) || defined(CONFIG_NDS32) || \
+ defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32)
dram_init, /* configure available RAM banks */
#endif
#if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_M68K)
diff --git a/common/board_r.c b/common/board_r.c
index bf6c725..f8c1baa 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -132,6 +132,8 @@
{
#ifdef __ARM__
monitor_flash_len = _end - __image_copy_start;
+#elif defined(CONFIG_NDS32)
+ monitor_flash_len = (ulong)&_end - (ulong)&_start;
#elif !defined(CONFIG_SANDBOX) && !defined(CONFIG_NIOS2)
monitor_flash_len = (ulong)&__init_end - gd->relocaddr;
#endif
@@ -711,7 +713,7 @@
#ifdef CONFIG_DM
initr_dm,
#endif
-#ifdef CONFIG_ARM
+#if defined(CONFIG_ARM) || defined(CONFIG_NDS32)
board_init, /* Setup chipselects */
#endif
/*
diff --git a/common/command.c b/common/command.c
index 381e6a2..972ae28 100644
--- a/common/command.c
+++ b/common/command.c
@@ -445,7 +445,7 @@
ulong addr;
addr = (ulong)(cmdtp->cmd) + gd->reloc_off;
-#if DEBUG_COMMANDS
+#ifdef DEBUG_COMMANDS
printf("Command \"%s\": 0x%08lx => 0x%08lx\n",
cmdtp->name, (ulong)(cmdtp->cmd), addr);
#endif