[PATCH 2/2] mini2440: Consider correct NAND page size for boot.

Juergen Beisert jbe at pengutronix.de
Tue Feb 22 16:20:50 EST 2011


From: Juergen Beisert <juergen at kreuzholzen.de>

When booting from NAND, its important to know the correct page size.

Signed-off-by: Juergen Beisert <juergen at kreuzholzen.de>
---
 arch/arm/boards/mini2440/mini2440.c |   22 +++++++++++++++++++++-
 arch/arm/mach-s3c24xx/Kconfig       |   25 +++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boards/mini2440/mini2440.c b/arch/arm/boards/mini2440/mini2440.c
index 6842a79..d710e6d 100644
--- a/arch/arm/boards/mini2440/mini2440.c
+++ b/arch/arm/boards/mini2440/mini2440.c
@@ -279,9 +279,20 @@ static int mini2440_devices_init(void)
 device_initcall(mini2440_devices_init);
 
 #ifdef CONFIG_S3C24XX_NAND_BOOT
+/*
+ * To make barebox booting from NAND the page size must be known, as
+ * there is no way to autodetect it at this early point of boot time.
+ */
+#ifdef CONFIG_MACH_MINI2440_NAND_512B_PAGE_SIZE
+# define NAND_PAGE_SIZE 512
+#endif
+#ifdef CONFIG_MACH_MINI2440_NAND_2048B_PAGE_SIZE
+# define NAND_PAGE_SIZE 2048
+#endif
+
 void __bare_init nand_boot(void)
 {
-	s3c24x0_nand_load_image((void *)TEXT_BASE, 256 * 1024, 0, 512);
+	s3c24x0_nand_load_image((void *)TEXT_BASE, 256 * 1024, 0, NAND_PAGE_SIZE);
 }
 #endif
 
@@ -388,6 +399,15 @@ Using the default configuration:
 make ARCH=arm mini2440_defconfig
 @endcode
 
+To make barebox booting from NAND you must define the page size of the NAND
+in use on your mini2440. Run the menuconfig
+
+ at code
+make ARCH=arm menuconfig
+ at endcode
+
+and select the corresponding NAND device in the 'Board specific settings' menu.
+
 Build the binary image:
 
 @code
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
index 33d230c..eaa955f 100644
--- a/arch/arm/mach-s3c24xx/Kconfig
+++ b/arch/arm/mach-s3c24xx/Kconfig
@@ -67,6 +67,31 @@ config MACH_A9M2410DEV
 
 endchoice
 
+choice
+	prompt "NAND flash size"
+	depends on MACH_MINI2440
+
+config MACH_MINI2440_NAND_512B_PAGE_SIZE
+	bool
+	prompt "is 64 MiB or less"
+	help
+	  Select this if your mini2440 is shipped with a NAND flash with 64 MiB
+	  or less in size. This is true for the Samsung 'K9F1208U0C' device.
+	  Or select this entry, if you are sure, your NAND comes with a page
+	  size of 512 bytes.
+
+config MACH_MINI2440_NAND_2048B_PAGE_SIZE
+	bool
+	prompt "is 128 MiB or more"
+	help
+	  Select this if your mini2440 is shipped with a NAND flash with
+	  128 MiB or more in size. This is true for the Samsung 'K9F1G08UOB',
+	  'K9F2G08UOB' or 'K9K8G08U0A' devices.
+	  Or select this entry, if you are sure, your NAND comes with a page
+	  size of 2048 bytes.
+
+endchoice
+
 endmenu
 
 menu "S3C24X0 Features              "
-- 
1.7.2.3




More information about the barebox mailing list