9
0
Fork 0
Commit Graph

390 Commits

Author SHA1 Message Date
Sascha Hauer 819f416b86 omap: rename GPMC Kconfig entry to OMAP_GPMC
Give this omap specific entry an omap namespace. Also, remove
unnecessary dependency to omap2/3 in nand Kconfig.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-04 15:10:16 +02:00
Sascha Hauer 691dd27f7a Merge branch 'next' 2011-04-04 14:53:08 +02:00
Baruch Siach 79c78016c1 mtd/nand_imx: fix read past buffer end
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-18 08:30:05 +01:00
Baruch Siach 4b4958dbb7 mtd/nand_imx: add support for page size of 4k
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-18 08:29:31 +01:00
Juergen Beisert ef552262ab S3C24xx/NFC: Add OOB/ECC handling documentation for different NANDs
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-14 12:11:19 +01:00
Juergen Beisert b31dd110aa S3C24xx/NFC: Setup ECC handling in accordance to the kernel
Do the same ECC handling and ECC size in barebox than the kernel does.
Currently its done for S3C2440 based systems only, as I have no idea how to
manage it on a S3C2410 based system.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-14 12:11:19 +01:00
Juergen Beisert e0965c4d56 S3C24xx/NFC: Consider correct NAND page size for boot.
When booting from NAND, its important to know the correct page size. When
the NAND is used as the boot source, four dedicated pins are used to configure
the correct page size and address cycles. These pins can be read back in one
of the NFC registers to parametrize the load function.

This patch also extends the read routine to support more than four address
cycles on demand.

BTW: At least some mini2440s are misconfigured to use five address cycles for
a NAND device that is known to need only four address cycles. In this case the
vendor is at our side: This NAND simply ignores any additional address cycles
than required.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-14 12:11:19 +01:00
Juergen Beisert a1dd9be4d1 S3C24xx/NFC: Remove double function setup
Three lines above this setting is already done.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-14 12:11:19 +01:00
Juergen Beisert e9b3179177 S3C24xx/NFC: Remove dead code
Something was to be done here. But I do not remember what. As it works also
without it, remove this dead code.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-14 12:11:19 +01:00
Juergen Beisert 1b1eca6b06 S3C24xx/NFC: Re-enable the controller after NAND boot test
After running the 'nand_boot_test' command, any usage of the NAND fails with
a IO error. This happens due to the load routine disables the NAND controller
after loading the image.

This patch re-enables the NAND controller again after running the test.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-14 12:11:19 +01:00
Sascha Hauer 5fb8333d34 ARM i.MX: cleanup boot modes
The i.MX Processors support two different boot modes, the internal
boot mode and the external boot mode. Traditionally the external
NAND boot mode is handled in drivers/mtd/nand and the internal
boot mode is handled in arch/arm/mach-imx. This patch consolidates
the handling of both boot modes in arch/arm/mach-imx so that
the user does not have to look in the mtd kconfig section for
booting from NAND. Also, selecting between internal and external
boot mode now is a clear choice.
The external NAND boot mode has been independent of the mtd nand
driver, but as the code was contained in the NAND driver it was
not possible to support booting from NAND without a mtd nand driver.
This is changed with this patch.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-03 16:15:57 +01:00
Juergen Beisert e5902f61fc MACH-S3C2440: Speed up NAND controller for this CPU
The S3C2440 provides 32 bit access to the NAND's data. Add specific read
routines to speed up data reading and writing.

These routines are stolen from the Linux kernel.

Signed-off-by: Juergen Beisert <juergen@kreuzholzen.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-03 16:15:53 +01:00
Juergen Beisert c3f4e1d6cb MACH-S3C2440: Fix NAND controller for this CPU
There are a few but important differences in S3C2410 and S3C2440. This patch
fixes them for the S3C2440 CPU.

Signed-off-by: Juergen Beisert <juergen@kreuzholzen.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-03 16:15:53 +01:00
Juergen Beisert 073f39c95e 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>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-03 16:15:52 +01:00
Sascha Hauer 2a23cedfe1 cdev: fix printf compiler warnings
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 10:38:03 +01:00
Sanjeev Premi d4b8e67fcd nand: Fix warnings due to incompatible format strings
This patch fixes warnings due to incompatible format strings
specified in the printf().

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 10:34:27 +01:00
Marek Belisko 5c495ce5e5 nand_s3c2410: Fix sparse warnings.
Patch fix following sparse warnings:
drivers/mtd/nand/nand_s3c2410.c:125:9:
warning: incorrect type in argument 1 (different base types)
	expected void const volatile [noderef] <asn:2>*<noident>
	got unsigned long

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-19 09:35:09 +01:00
Sascha Hauer ce15c024c1 imx nand: Add v3 (i.MX51) support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:02 +01:00
Sascha Hauer 691bff0062 imx nand: introduce overwritable check_int function
needed for v3 support later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:02 +01:00
Sascha Hauer 5fcca46544 imx nand: move initialization to preset function
This has two purposes. First we need to factor out initialization
to be able to do something different on v3 type controllers,
second with this patch we are independent of preinitialized register
values.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:02 +01:00
Sascha Hauer da1ad19c4c mxc_nand: fix correct_data function
The v2 controller has a totally different mechanism to check
whether the data we read had ecc errors or not. Implement this.
The mechanism in the v2 controller happens to be identical to
the v3 controller.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:02 +01:00
Sascha Hauer 87ccd2d109 imx nand: add V1_V2 namespace to registers
This prepares the driver for v3 support. The v3 controller
has a completely different register layout, so add a V1_V2_
namespace to the register defines to avoid confusion with
the v3 regs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:02 +01:00
Sascha Hauer 22180f96b1 imx nand: do not read-modify-write SPAS register
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:01 +01:00
Sascha Hauer a0fc5252a7 imx_nand: make some internally used functions overwriteable
This patch prepares the driver to add v3 controller support
later. The v3 controller is basically the same controller as v1
and v2, but with a completely different register layout.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:01 +01:00
Sascha Hauer 2cb2a68b92 imx nand: remove unnecessary register write
NFC_SP_EN is cleared in probe and never set again, so we do not
need to clear it in other functions again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:01 +01:00
Sascha Hauer bb81ff75d4 imx_nand: rework get_dev_status
We save/restore the value in the buffer anyway, so it makes
no difference whether we use main_area0 or main_area1. So,
we can use main_area0 and remove main_area1 from the driver
which is otherwise unused. Also, clean up the comments in
get_dev_status.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:01 +01:00
Sascha Hauer dd62a0c2d1 imx_nand: remove 0xe00 offset from registers
Add the offset to the register base instead. This is done
in preparation for v3 controller support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:01 +01:00
Sascha Hauer 31ecd16695 NAND: reset chips before usage like the kernel does
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:01 +01:00
Sascha Hauer fe02628658 i.MX nand: optimize nand boot code for size
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-22 19:30:25 +02:00
Jean-Christophe PLAGNIOL-VILLARD eaa223e795 module: move EXPORT_SYMBOL_GPL define to module.h
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-30 14:36:09 +02:00
Michael Grzeschik 0d8d93d7c6 omap: nand remove unnecessary condition
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-18 08:43:57 +02:00
Michael Grzeschik 6937c91935 omap nand: bugfix configure ecc order
This repairs a bug which came with patch "0cb00c1 omap nand: cleanup"
We first have to set ecc.layout before we can use it and should
do the nand_scan_tail after we set the ecc.mode.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-06 19:18:59 +02:00
Jean-Christophe PLAGNIOL-VILLARD 7192259daa nand: driver for Nomadik 8815 SoC
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Andrea GALLO <andrea.gallo@stericsson.com>
Cc: Gael SALLES <gael.salles@stericsson.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-06 19:09:39 +02:00
Sascha Hauer 139ec08127 Merge branch 'next' 2010-08-03 09:31:38 +02:00
Sascha Hauer b8063f72f0 atmel_nand: fix comment where this code is derived from
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-23 08:37:47 +02:00
Sascha Hauer 6ffe2ec8cd Merge remote branch 'origin/omap' into next 2010-07-12 08:22:03 +02:00
Sascha Hauer e0677920d6 barebox ubi changes
This adds the layer between barebox and UBI.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-05 15:07:14 +02:00
Sascha Hauer 8dbed40da9 add ubi support from u-boot. Just enough to compile and scan
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-05 15:07:14 +02:00
Sascha Hauer acc46ca4f0 add partition mtd support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-05 13:00:02 +02:00
Sascha Hauer b332d8565d move drivers/nand to drivers/mtd/nand
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-05 13:00:01 +02:00