From: Juergen Beisert <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Juergen Beisert <juergen@kreuzholzen.de>
Subject: [PATCH 2/2] mini2440: Consider correct NAND page size for boot.
Date: Tue, 22 Feb 2011 22:20:50 +0100 [thread overview]
Message-ID: <1298409650-28408-3-git-send-email-jbe@pengutronix.de> (raw)
In-Reply-To: <1298409650-28408-1-git-send-email-jbe@pengutronix.de>
From: Juergen Beisert <juergen@kreuzholzen.de>
When booting from NAND, its important to know the correct page size.
Signed-off-by: Juergen Beisert <juergen@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
+
+@code
+make ARCH=arm menuconfig
+@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
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-02-22 21:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-22 21:20 [RFC] Add more changes to make the mini2440 work Juergen Beisert
2011-02-22 21:20 ` [PATCH 1/2] mini2440: Add more info about possible SDRAM and flash devices Juergen Beisert
2011-02-22 21:20 ` Juergen Beisert [this message]
2011-02-23 4:00 ` [PATCH 2/2] mini2440: Consider correct NAND page size for boot zoltan
2011-02-23 7:26 ` Juergen Beisert
2011-02-23 15:20 ` Juergen Beisert
2011-02-23 22:08 ` Juergen Beisert
2011-02-24 8:47 ` Zoltán Kócsi
2011-02-24 21:10 [PATCH] S3C24xx: NAND management changes to support booting from NAND Juergen Beisert
2011-02-24 21:10 ` [PATCH 2/2] mini2440: Consider correct NAND page size for boot Juergen Beisert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1298409650-28408-3-git-send-email-jbe@pengutronix.de \
--to=jbe@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=juergen@kreuzholzen.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox