[U-Boot] [PATCH] arm nomadik: rename board and cleanup config

Alessandro Rubini
2009-06-18T20:54:47Z

From: Alessandro Rubini <rubini@unipv.it>

This patch cleans up some glitches in the initial submission:
- nobody calls it "nmdk8815": the board is "nhk8815", so rename
- nand and onenand can coexist, so fix config file accordingly
- configure the chip select for OneNand, so it works properly
- removed a pair of unused defines and reordered the jffs defs
- add some comments and an explanation of the two configs

Signed-off-by: Alessandro Rubini <rubini@unipv.it>
Acked-by: Andrea Gallo <andrea.gallo@stericsson.com>
---

If needed I can split this, but I think it's trivial enough.
Over this I'll send a few additions in the next days.

Makefile | 10 ++--
board/st/{nmdk8815 => nhk8815}/Makefile | 2 +-
board/st/{nmdk8815 => nhk8815}/config.mk | 0
.../st/{nmdk8815/nmdk8815.c => nhk8815/nhk8815.c} | 4 ++
board/st/{nmdk8815 => nhk8815}/platform.S | 0
cpu/arm926ejs/nomadik/reset.S | 12 +----
doc/{README.nmdk8815 => README.nhk8815} | 9 +++
include/configs/{nmdk8815.h => nhk8815.h} | 57 ++++++++++++--------
8 files changed, 55 insertions(+), 39 deletions(-)
rename board/st/{nmdk8815 => nhk8815}/Makefile (98%)
rename board/st/{nmdk8815 => nhk8815}/config.mk (100%)
rename board/st/{nmdk8815/nmdk8815.c => nhk8815/nhk8815.c} (91%)
rename board/st/{nmdk8815 => nhk8815}/platform.S (100%)
rename doc/{README.nmdk8815 => README.nhk8815} (75%)
rename include/configs/{nmdk8815.h => nhk8815.h} (77%)

diff --git a/Makefile b/Makefile
index acec1a0..14ba063 100644
--- a/Makefile
+++ b/Makefile
@@ -2841,17 +2841,17 @@ mx1fs2_config : unconfig
netstar_config: unconfig
@$(MKCONFIG) $(@:_config=) arm arm925t netstar

-nmdk8815_config \
-nmdk8815_onenand_config: unconfig
+nhk8815_config \
+nhk8815_onenand_config: unconfig
@mkdir -p $(obj)include
@ > $(obj)include/config.h
@if [ "$(findstring _onenand, $@)" ] ; then \
echo "#define CONFIG_BOOT_ONENAND" >> $(obj)include/config.h; \
- $(XECHO) "... configured for OneNand Flash"; \
+ $(XECHO) "... configured to boot from OneNand Flash"; \
else \
- $(XECHO) "... configured for Nand Flash"; \
+ $(XECHO) "... configured to boot from Nand Flash"; \
fi
- @$(MKCONFIG) -a nmdk8815 arm arm926ejs nmdk8815 st nomadik
+ @$(MKCONFIG) -a nhk8815 arm arm926ejs nhk8815 st nomadik

omap1510inn_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm925t omap1510inn
diff --git a/board/st/nmdk8815/Makefile b/board/st/nhk8815/Makefile
similarity index 98%
rename from board/st/nmdk8815/Makefile
rename to board/st/nhk8815/Makefile
index be9a424..b37fe53 100644
--- a/board/st/nmdk8815/Makefile
+++ b/board/st/nhk8815/Makefile
@@ -29,7 +29,7 @@ include $(TOPDIR)/config.mk

LIB = $(obj)lib$(BOARD).a

-COBJS := nmdk8815.o
+COBJS := nhk8815.o
SOBJS := platform.o

SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/board/st/nmdk8815/config.mk b/board/st/nhk8815/config.mk
similarity index 100%
rename from board/st/nmdk8815/config.mk
rename to board/st/nhk8815/config.mk
diff --git a/board/st/nmdk8815/nmdk8815.c b/board/st/nhk8815/nhk8815.c
similarity index 91%
rename from board/st/nmdk8815/nmdk8815.c
rename to board/st/nhk8815/nhk8815.c
index edf4626..085a5e0 100644
--- a/board/st/nmdk8815/nmdk8815.c
+++ b/board/st/nhk8815/nhk8815.c
@@ -53,6 +53,10 @@ int board_init(void)
writel(0x0000305b, REG_FSMC_BCR1);
writel(0x00033f33, REG_FSMC_BTR1);

+ /* Set up SMCS0 for OneNand: sram-like once again */
+ writel(0x000030db, NOMADIK_FSMC_BASE + 0x00); /* FSMC_BCR0 */
+ writel(0x02100551, NOMADIK_FSMC_BASE + 0x04); /* FSMC_BTR0 */
+
icache_enable();
return 0;
}
diff --git a/board/st/nmdk8815/platform.S b/board/st/nhk8815/platform.S
similarity index 100%
rename from board/st/nmdk8815/platform.S
rename to board/st/nhk8815/platform.S
diff --git a/cpu/arm926ejs/nomadik/reset.S b/cpu/arm926ejs/nomadik/reset.S
index 948996b..694c32b 100644
--- a/cpu/arm926ejs/nomadik/reset.S
+++ b/cpu/arm926ejs/nomadik/reset.S
@@ -6,20 +6,10 @@
.align 5
.globl reset_cpu
reset_cpu:
-#if defined CONFIG_NOMADIK_8815
- ldr r0, =NOMADIK_SRC_BASE
+ ldr r0, =NOMADIK_SRC_BASE /* System and Reset Controller */
ldr r1, =0x1
str r1, [r0, #0x18]
-#else
- ldr r1, rstctl1 /* get clkm1 reset ctl */
- mov r3, #0x0
- strh r3, [r1] /* clear it */
- mov r3, #0x8
- strh r3, [r1] /* force dsp+arm reset */
-#endif

_loop_forever:
b _loop_forever

-rstctl1:
- .word 0xfffece10
diff --git a/doc/README.nmdk8815 b/doc/README.nhk8815
similarity index 75%
rename from doc/README.nmdk8815
rename to doc/README.nhk8815
index 453cfae..940f24d 100644
--- a/doc/README.nmdk8815
+++ b/doc/README.nhk8815
@@ -15,6 +15,15 @@ SDRAM configuration, PLL setup and initial loading from NAND is
implemented in the X-Loader, so U-Boot is already running in SDRAM
when control is handed over to it.

+The Makefile offers two different configurations to be used if you
+boot from Nand or OneNand.
+
+ make nhk8815_config
+ make nhk8815_onenand_config
+
+Both support OneNand and Nand. Since U-Boot, running in RAM, can't know
+where it was loaded from, the configurations differ in where the filesystem
+is looked for by default.

On www.st.com/nomadik and on www.stnwireless.com there are documents,
summary data and white papers on Nomadik. The full datasheet for
diff --git a/include/configs/nmdk8815.h b/include/configs/nhk8815.h
similarity index 77%
rename from include/configs/nmdk8815.h
rename to include/configs/nhk8815.h
index 6d7b94f..bf1a915 100644
--- a/include/configs/nmdk8815.h
+++ b/include/configs/nhk8815.h
@@ -1,7 +1,8 @@
/*
* (C) Copyright 2005
* STMicroelectronics.
- * Configuration settings for the STn8815 nomadik board.
+ * Configuration settings for the "Nomadik Hardware Kit" NHK-8815,
+ * the evaluation board for the Nomadik 8815 System on Chip.
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -29,9 +30,8 @@

#define CONFIG_ARM926EJS
#define CONFIG_NOMADIK
-#define CONFIG_NOMADIK_8815
-#define CONFIG_NOMADIK_NDK15
-#define CONFIG_NOMADIK_NHK15
+#define CONFIG_NOMADIK_8815 /* cpu variant */
+#define CONFIG_NOMADIK_NHK8815 /* board variant */

#define CONFIG_SKIP_LOWLEVEL_INIT /* we have already been loaded to RAM */

@@ -55,6 +55,7 @@
#define CONFIG_SYS_HUSH_PARSER
#define CONFIG_SYS_PROMPT "Nomadik> "
#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
+#define CONFIG_CMDLINE_EDITING
#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE \
+ sizeof(CONFIG_SYS_PROMPT) + 16)
@@ -90,6 +91,7 @@
#define CONFIG_SYS_MEMTEST_END 0x0FFFFFFF
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 256 * 1024)
#define CONFIG_SYS_GBL_DATA_SIZE 128 /* for initial data */
+#define CONFIG_SYS_64BIT_VSPRINTF /* mtd desires this */

#define CONFIG_MISC_INIT_R /* call misc_init_r during start up */

@@ -120,43 +122,54 @@
#define CONFIG_SMC_USE_32_BIT
#define CONFIG_BOOTFILE "uImage"

-/* flash memory and filesystem information */
-#define CONFIG_DOS_PARTITION
+/* Storage information: onenand and nand */
+#define CONFIG_CMD_ONENAND
#define CONFIG_MTD_ONENAND_VERIFY_WRITE
#define CONFIG_SYS_ONENAND_BASE 0x30000000
+
+#define CONFIG_CMD_NAND
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define CONFIG_SYS_NAND_BASE 0x40000000 /* SMPS0n */

+/*
+ * Filesystem information
+ *
+ * Since U-Boot has been loaded to RAM by vendor code, we could use
+ * either or both OneNand and Nand. However, we need to know where the
+ * filesystem lives. Comments below report vendor-selected partitions
+ */
#ifdef CONFIG_BOOT_ONENAND
-
-# define CONFIG_CMD_ONENAND /* Temporary: nand and onenand can't coexist */
/* Partition Size Start
* XloaderTOC + X-Loader 256KB 0x00000000
* Memory init function 256KB 0x00040000
- * U-Boot 2MB 0x00080000
+ * U-Boot + env 2MB 0x00080000
* Sysimage (kernel + ramdisk) 4MB 0x00280000
* JFFS2 Root filesystem 22MB 0x00680000
* JFFS2 User Data 227.5MB 0x01C80000
*/
-# define CONFIG_JFFS2_PART_SIZE 0x400000
-# define CONFIG_JFFS2_PART_OFFSET 0x280000
-
+# define CONFIG_JFFS2_DEV "onenand0"
+# define CONFIG_JFFS2_PART_SIZE 0x01600000
+# define CONFIG_JFFS2_PART_OFFSET 0x00680000
# define CONFIG_ENV_IS_IN_ONENAND
-# define CONFIG_ENV_SIZE (256 * 1024)
-# define CONFIG_ENV_ADDR 0x30300000
-
-#else /* ! CONFIG_BOOT_ONENAND */
-
-# define CONFIG_CMD_NAND /* Temporary: nand and onenand can't coexist */
+# define CONFIG_ENV_SIZE 0x20000 /* 128 Kb - one sector */
+# define CONFIG_ENV_ADDR (0x00280000 - CONFIG_ENV_SIZE)

+#else /* BOOT_NAND */
+ /* Partition Size Start
+ * XloaderTOC + X-Loader 256KB 0x00000000
+ * Memory init function 256KB 0x00040000
+ * U-Boot + env 2MB 0x00080000
+ * Kernel Image 3MB 0x00280000
+ * JFFS2 Root filesystem 22MB 0x00580000
+ * JFFS2 User Data 100.5MB 0x01b80000
+ */
# define CONFIG_JFFS2_DEV "nand0"
# define CONFIG_JFFS2_NAND 1 /* For the jffs2 support*/
-# define CONFIG_JFFS2_PART_SIZE 0x00300000
-# define CONFIG_JFFS2_PART_OFFSET 0x00280000
-
+# define CONFIG_JFFS2_PART_SIZE 0x01600000
+# define CONFIG_JFFS2_PART_OFFSET 0x00580000
# define CONFIG_ENV_IS_IN_NAND
# define CONFIG_ENV_SIZE 0x20000 /* 128 Kb - one sector */
-# define CONFIG_ENV_OFFSET (0x8000000 - CONFIG_ENV_SIZE)
+# define CONFIG_ENV_OFFSET (0x00280000 - CONFIG_ENV_SIZE)

#endif /* CONFIG_BOOT_ONENAND */

--
1.6.0.2