9
0
Fork 0
Commit Graph

39 Commits

Author SHA1 Message Date
Alexander Shiyan 6a256321b8 Use new device_platform_driver() macro for drivers
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-13 09:23:28 +01:00
Sascha Hauer 19b6121a56 ARM omap: include individual SoC files
- remove mach/silicon.h and include omap?-silicon.h directly
- include mach/omap?-clock.h directly where needed

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-19 21:51:49 +01:00
Jean-Christophe PLAGNIOL-VILLARD 006538e7c2 mtd: add parent support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-17 20:16:58 +02:00
Jean-Christophe PLAGNIOL-VILLARD 3c5327e660 switch all platform_bus device/driver registering to platform_driver/device_register
now register_driver and register_device are for bus only usage.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-04 15:19:12 +02:00
Sascha Hauer cf63079a2b mtd OMAP NAND: implement buswidth autodetection support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-03 19:32:07 +02:00
Sascha Hauer 5a693051df mtd OMAP NAND: Use prefetch engine
Use the prefetch engine to improve NAND performance. The howto
is derived from the Kernel. Unlike the kernel we do not make
the access mode configurable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-03 19:32:07 +02:00
Sascha Hauer ee5a0fcded mtd OMAP NAND: Fix dev_ready handling
- dev_ready is supposed to return whether the device is ready or
  not, not to poll until the device is ready.
- dev_ready should return true for ready and false for not ready
- waitpin polarity is not needed (at least the kernel does not have it)
- wait_mon_mask must be 32bit.

The code was unused since no board specified a wait pin, so no breakage
included. This also removes the now unused timeout variable from
platformdata.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-02 12:00:51 +02:00
Sascha Hauer 2f1d3b49d1 mtd omap: add prefix to omap specific decode_bch function
So that it does not collide with our generic decode_bch function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:28 +02:00
Jean-Christophe PLAGNIOL-VILLARD 2c9bc534ce Revert "mtd omap nand: fix driver without CONFIG_PARAMETER"
This reverts commit 7762f9627a.

already applied by d002818ae3

    fix gpmc_nand_probe without param support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-19 09:44:50 +01:00
Sascha Hauer 7762f9627a mtd omap nand: fix driver without CONFIG_PARAMETER
With CONFIG_PARAMETER unset the driver never calls omap_gpmc_eccmode.
Fix it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-17 18:51:04 +01:00
Jan Weitzel d002818ae3 fix gpmc_nand_probe without param support
commit 30de24d79fc6e659d0070f6e863ae0e53567ba0e param: add config to disable it
removes param support for xloader configurations. Set param eccmode calls
omap_gpmc_eccmode and so nand_scan_tail. So nand fails without param support

Call omap_gpmc_eccmode directly if CONFIG_PARAMETER is not enabled
to fix that.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-16 11:33:22 +01:00
Alexander Aring 7017838be5 nand_omap_gpmc: fix return value
Fix return value, to notify if ecc
correction appeared.

Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-05 10:31:24 +01:00
Robert Jarzmik 88ce7ef769 drivers/mtd: transfer NAND notions to MTD core
Change NAND_WRITE into MTD_WRITE.
Change "page_shift" references in the core, which are purely
NAND, into mtd->writesize which is MTD generic.
Rename all "info" (struct mtd_info) into "mtd".

Also provide a parameter to add_mtd_device() so that legacy
nand devices still appear as nand<N>.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-22 10:11:11 +01:00
Sascha Hauer 03f18f3115 mtd nand omap: use NAND_OWN_BUFFERS option
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-08 13:17:44 +01:00
Sascha Hauer 624a44a618 mtd nand omap: add read function for the OMAP4 romcode ecc mode
The OMAP4 romcode expects some unusual ecc layout which we could
write but not read. This patch adds a function which uses the
manual mode to read a page written with this ecc layout.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-08 13:17:08 +01:00
Sascha Hauer ecbc8a32ce mtd nand omap: factor out an internal __omap_calculate_ecc function
We can't use the ECC_RESULTx_0 register set for manual mode which
we'll need in the next patch. So factor out an internal function
which makes the register set to use configurable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-08 11:13:11 +01:00
Sascha Hauer 01bedb6772 mtd nand omap: make debugging output more useful
- add missing '\n' at line ends
- fix wrong argument type warnings
- remove too noisy debug in omap_hwcontrol
- add function names to debug printfs
- add 0x prefixes to hex values

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-08 11:13:11 +01:00
Sascha Hauer 5b959a3e85 mtd nand omap: use register defines for ecc registers
We need this register bits later in another function, so
use register bit defines now.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-08 11:13:11 +01:00
Sascha Hauer 02fa86e9bc mtd nand omap: fail on bch decode failure
The driver used to print an error when bch decoing failed, but
did not actually throw an error. Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-08 11:13:10 +01:00
Sascha Hauer 4cb1b120bf mtd nand omap: call ecc calculate function outside omap_correct_bch
Move omap_calculate_ecc outside omap_correct_bch. When implementing
the romcode bch read page we have to call omap_calculate_ecc with
different arguments than in the standard case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-08 11:11:34 +01:00
Sascha Hauer af01926739 mtd nand omap: factor out hamming correct function
To be consistent also factor out the hamming correct function
and also safe an indention level.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-08 11:08:07 +01:00
Sascha Hauer 1b79fee4f3 mtd nand omap: factor out bch correct function
We need the bch correct algorithm in the next patches, so
factor out a seperate function for this and also safe an
indention level.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-08 11:06:53 +01:00
Sascha Hauer 4a0a5df356 mtd nand omap: use blocknum calculation to where it's used
Just some refactoring to make the next patches better readable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-08 11:05:43 +01:00
Sascha Hauer 3ee7877a48 introduce io.h
To allow for some generic io accessors introduce io.h and use
this instead of asm/io.h throughout the tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-22 19:03:05 +02:00
Jean-Christophe PLAGNIOL-VILLARD d4d8705636 nand: convert to struct resource
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-23 13:52:19 +08:00
Juergen Kilb 42207a9cbb Improved gpmc_nand driver to show the current eccmode.
Now a 'devinfo gpmc_nand0' shows the current used eccmode
instead of <NULL>.

The function omap_gpmc_eccmode is now called by dev_set_param.

Signed-off-by: Juergen Kilb <J.Kilb@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-06-10 08:58:39 +02:00
Jan Weitzel c318b0fad4 ARM: omap4: fix dev_width for omap_enable_hwecc
NAND_BUSWIDTH_16 should result in dev_width = 1 according to the kernel driver
omap_enable_hwecc: dev_width = (chip->options & NAND_BUSWIDTH_16) ? 1 : 0;

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-20 08:59:42 +02:00
Sascha Hauer 3ab2b35477 nand omap: handle erased pages correctly in hamming ecc mode
do not throw ecc errors on erased pages.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:56 +02:00
Sascha Hauer 4b9544013e nand omap: use xzalloc instead of calloc
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:56 +02:00
Sascha Hauer 3bad67dd60 nand omap: use standard debug functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:56 +02:00
Sascha Hauer a7cbbaf19a nand omap: turn debug messages into dev_dbg
The information from the probe function is useful for developers
only, so turn them into dev_dbg to safe binary space.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:55 +02:00
Sascha Hauer 2053e35f20 nand omap: fix hamming romcode ecc code
This got broken in commit:

6943635 mtd nand omap: make ecc mode runtime configurable

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:55 +02:00
Sascha Hauer 6e7eba2c61 mtd nand omap: Add BCH ecc support
This patch adds BCH ecc support to the omap nand driver. The BCH
error correction allows for up to 8 bit error correction. It is
also needed for booting from nand on omap4.

This is based on code from Sukumar Ghorai <s-ghorai@ti.com>:

[PATCH] omap3: nand: bch ecc support added

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-04 15:28:49 +02:00
Sascha Hauer 694363574e mtd nand omap: make ecc mode runtime configurable
On omap we use different ecc modes for different purposes. The initial
boot code has to be written with hardware ecc whereas Linux usually uses
software ecc. To be able to write in both modes with a sinlge barebox
image introduce a eccmode device parameter.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-04 15:28:49 +02:00
Sascha Hauer 2a1db7330a mtd nand omap: Pass ecc mode from platform
As we will get more ecc modes pass through the exact mode from
the platform, not only a flag.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-04 15:28:49 +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
Sascha Hauer 6ffe2ec8cd Merge remote branch 'origin/omap' into next 2010-07-12 08:22:03 +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