mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Juergen Beisert <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: mini2440: Forgotten patches to make it work (2 of 2)
Date: Sun, 13 Feb 2011 20:49:19 +0100	[thread overview]
Message-ID: <201102132049.20291.jbe@pengutronix.de> (raw)
In-Reply-To: <201102132001.04701.jbe@pengutronix.de>

From: Juergen Beisert <juergen@kreuzholzen.de>
Subject: MACH-S3C24XX: Add support for flash based BBT

The default configuration of the current 2.6.37 kernel uses a flash based BBT.
So, barebox must also use one, to be in sync with the kernel about bad blocks
in the flash.

Due to the used OOB layout, the generic BBT description coming with the
framework can be used.

Signed-off-by: Juergen Beisert <juergen@kreuzholzen.de>

---
 arch/arm/boards/mini2440/mini2440.c               |    3 ++-
 arch/arm/mach-s3c24xx/include/mach/s3c24x0-nand.h |    1 +
 drivers/mtd/nand/nand_s3c2410.c                   |    6 ++++++
 3 files changed, 9 insertions(+), 1 deletion(-)

Index: barebox-2011.01.0/arch/arm/boards/mini2440/mini2440.c
===================================================================
--- barebox-2011.01.0.orig/arch/arm/boards/mini2440/mini2440.c
+++ barebox-2011.01.0/arch/arm/boards/mini2440/mini2440.c
@@ -55,7 +55,8 @@ static struct device_d sdram_dev = {
 };
 
 static struct s3c24x0_nand_platform_data nand_info = {
-	.nand_timing = CALC_NFCONF_TIMING(A9M2440_TACLS, A9M2440_TWRPH0, A9M2440_TWRPH1)
+	.nand_timing = CALC_NFCONF_TIMING(A9M2440_TACLS, A9M2440_TWRPH0, A9M2440_TWRPH1),
+	.flash_bbt = 1,	/* same as the kernel */
 };
 
 static struct device_d nand_dev = {
Index: barebox-2011.01.0/arch/arm/mach-s3c24xx/include/mach/s3c24x0-nand.h
===================================================================
--- barebox-2011.01.0.orig/arch/arm/mach-s3c24xx/include/mach/s3c24x0-nand.h
+++ barebox-2011.01.0/arch/arm/mach-s3c24xx/include/mach/s3c24x0-nand.h
@@ -45,6 +45,7 @@ extern void s3c24x0_nand_load_image(void
  */
 struct s3c24x0_nand_platform_data {
 	uint32_t nand_timing;	/**< value for the NFCONF register (timing bits only) */
+	char flash_bbt;	/**< not 0 if a flash based BBT should be used */
 };
 
 /**
Index: barebox-2011.01.0/drivers/mtd/nand/nand_s3c2410.c
===================================================================
--- barebox-2011.01.0.orig/drivers/mtd/nand/nand_s3c2410.c
+++ barebox-2011.01.0/drivers/mtd/nand/nand_s3c2410.c
@@ -349,6 +349,7 @@ static int s3c24x0_nand_inithw(struct s3
 static int s3c24x0_nand_probe(struct device_d *dev)
 {
 	struct nand_chip *chip;
+	struct s3c24x0_nand_platform_data *pdata = dev->platform_data;
 	struct mtd_info *mtd;
 	struct s3c24x0_nand_host *host;
 	int ret;
@@ -393,6 +394,11 @@ static int s3c24x0_nand_probe(struct dev
 	chip->ecc.bytes = 3;
 	chip->ecc.layout = &nand_hw_eccoob;
 
+	if (pdata->flash_bbt) {
+		/* use a flash based bbt */
+		chip->options |= NAND_USE_FLASH_BBT;
+	}
+
 	ret = s3c24x0_nand_inithw(host);
 	if (ret != 0)
 		goto on_error;

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2011-02-13 19:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-13 14:10 RFC: Booting from NAND for mini2440 platform Juergen Beisert
2011-02-13 14:10 ` [PATCH 01/15] S3C24xx: Just remove a trailing whitespace Juergen Beisert
2011-02-13 14:10 ` [PATCH 02/15] MACH-S3C24xx: Fix typo in UART2_SIZE macro Juergen Beisert
2011-02-13 14:10 ` [PATCH 03/15] MACH-S324xx: Change detection method of the second SDRAM bank Juergen Beisert
2011-02-13 14:10 ` [PATCH 04/15] mini2440: Be a little be pedantic with the include file order Juergen Beisert
2011-02-13 14:10 ` [PATCH 05/15] mini2440: Fix a runtime warning when '.id=0' is used Juergen Beisert
2011-02-13 14:10 ` [PATCH 06/15] mini2440: Add some useful documentation Juergen Beisert
2011-02-13 14:10 ` [PATCH 07/15] mini2440: Add PLL settings Juergen Beisert
2011-02-13 14:10 ` [PATCH 08/15] mini2440: Add SDRAM config settings Juergen Beisert
2011-02-13 14:10 ` [PATCH 09/15] mini2440: Configure debug UART pins very early Juergen Beisert
2011-02-13 14:10 ` [PATCH 10/15] mini2440: Add SDRAM size autodetection Juergen Beisert
2011-02-13 14:10 ` [PATCH 11/15] mini2440: Add GPIO settings Juergen Beisert
2011-02-13 14:10 ` [PATCH 12/15] mini2440: Add MCI support Juergen Beisert
2011-02-13 14:10 ` [PATCH 13/15] mini2440: Add booting from NAND support Juergen Beisert
2011-02-13 14:10 ` [PATCH 14/15] mini2440: Remove some A9M2440 platform leftovers Juergen Beisert
2011-02-14  9:35   ` Juergen Beisert
2011-02-13 14:10 ` [PATCH 15/15] mini2440: Use generic environment Juergen Beisert
2011-02-13 19:01   ` mini2440: Forgotten patches to make it work (1 of 2) Juergen Beisert
2011-02-13 19:49     ` Juergen Beisert [this message]

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=201102132049.20291.jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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