2013-12-20 |
mtd: Add subpagesize to mtd_info_user
...
ubiformat needs the subpagesize to work correctly. The kernel uses
sysfs to pass the subpagesize, but in barebox we have the possibility
to extend struct mtd_info_user. Add a corresponding field and use it
in ubiformat.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Dec 2013
|
mtd: fix mtd_read return value
...
mtd->read returns the number of bitflips as positive numbers.
Instead of returning these numbers Return -EUCLEAN when the bitflip
threshold has been reached, 0 otherwise.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Dec 2013
|
mtd: fix wrong return values in cdev read
...
mtd->read returns the number of bitflips as positive numbers.
Instead of returning these numbers Return -EUCLEAN when the bitflip
threshold has been reached, 0 otherwise.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Dec 2013
|
2013-11-08 |
treewide: Add missing includes
...
A lot of files rely on include/driver.h including include/of.h (and
this including include/errno.h. include the files explicitly so we can
eventually get rid of including of.h from driver.h
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Nov 2013
|
2013-10-29 |
mtd: Pass device_id to add_mtd_device
...
Right now we do not support persistent names for mtd devices. The
base name can be passed to add_mtd_device, but this is always appended
with a dynamic number. With this patch add_mtd_device takes a device_id
argument which can be used to create a mtd device with an exact name.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 29 Oct 2013
|
2013-08-05 |
Merge branch 'for-next/of'
...
Conflicts:
arch/arm/boards/freescale-mx53-loco/board.c
drivers/of/Makefile
Sascha Hauer
committed
on 5 Aug 2013
|
2013-07-22 |
mtd: introduce mtd_read_oob and mtd_write_oob
...
Directly copied from the Kernel as of 3.11-rc1
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Jul 2013
|
2013-07-18 |
mtd: Add devicetree partition parsing
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 18 Jul 2013
|
2013-07-01 |
Merge branch 'for-next/mtd'
Sascha Hauer
committed
on 1 Jul 2013
|
2013-06-21 |
mtd: Fix size_t printf format specifier
...
use 0x%08zx for size_t instead of 0x%08x
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 21 Jun 2013
|
2013-06-06 |
mtd: Align erase_op to eraseblock boundaries
...
Our erase command used to align to eraseblocks when necessary.
This worked well until recently when the m25p80, mtd_dataflash
and cfi flash were added / converted to mtd. This patch aligns
the input to the erase fileoperation to eraseblock boundaries.
Also tested with non uniform flashes with multiple eraseregions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Jun 2013
|
2013-05-27 |
mtd: call mtd_erase with complete area if possible
...
If a device does not have bad blocks loop over the eraseblocks
in the driver instead of the core. This allows the mtd_dataflash
driver to erase blocks instead of pages to gain more speed during
erasing. Also the mtd_dataflash driver modifies the erase_info
struct which causes the outer loop in the core to never end.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 27 May 2013
|
2013-04-11 |
treewide: Use dev_add_param_int_ro where possible
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Apr 2013
|
2013-03-04 |
mtd: Add parameter to allow erasing bad blocks
...
While erasing bad blocks is a potentially dangerous operation
it is sometimes needed during development or when some foreign
code has touched the flash.
This patch adds a device parameter 'erasebad' to allow erasing
bad blocks. Since this is not wanted during production this is
behind a Kconfig option.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Mar 2013
|
Merge branch 'for-next/mtd'
...
Conflicts:
arch/arm/configs/eukrea_cpuimx27_defconfig
drivers/mtd/core.c
Sascha Hauer
committed
on 4 Mar 2013
|
2013-02-21 |
mtd: nand: do not write empty pages
...
Do not write pages which only contain 0xff. UBI expects pages which
seem empty to be writable. This got lost with:
| commit 3139c3e
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date: Thu Nov 29 11:16:40 2012 +0100
|
| mtd core: call driver write function with complete buffer
|
| mtd->write is supposed to loop around pages internally, no need
| to do this in mtd_write. This fixes a huge write performance drop
| with the m25p80 driver when it was converted to a mtd driver recently.
| Since mtd->writesize is 1 for this driver mtd_write ended up doing
| single byte writes on the flash.
Introduce mtd_all_ff as a global function since UBI currently has its own
implementation.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 21 Feb 2013
|
2013-02-14 |
mtd: implement mtd_lock and mtd_unlock
...
Needed for NOR flashes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Feb 2013
|
mtd: Use mtd_* functions where appropriate
...
Instead of dereferencing struct mtd_info members directly use
the wrapper functions which have an additional check if the
callback exists if it is optional, like mark_bad or is_bad.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Feb 2013
|
mtd: Add mtd_* functions
...
The Kernel has mtd_read, mtd_write, mtd_erase and mtd_block_markbad.
Add these functions to barebox aswell to make future mtd synchronizations
with the kernel easier.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Feb 2013
|
mtd: rename mtd file operations callback functions
...
These are currently named mtd_read/write/erase. Functions with
the same name exist as global functions in the kernel. Rename
them to mtd_op_* to avoid name clashes with future mtd updates.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Feb 2013
|
2013-01-17 |
mtd-core: fix compiler warning
...
Got this compile warning if MTD_WRITE support isn't set.
drivers/mtd/core.c: In function 'mtd_ioctl':
drivers/mtd/core.c:117:26: warning: unused variable 'ei' [-Wunused-variable]
Add a #ifdef to declaration of variable 'ei' to solve it.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Alexander Aring
authored
on 16 Jan 2013
Sascha Hauer
committed
on 17 Jan 2013
|
2012-12-19 |
devfs & mtd: add MEMERASE ioctl support
...
To make that, we need to shift mtd_erase before mtd_ioctl.
ubi-utils need that, especially ubiformat.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Wolfram Sang
authored
on 17 Dec 2012
Sascha Hauer
committed
on 19 Dec 2012
|
2012-12-12 |
drivers/base: fix corrupt device tree
...
dev_add_child is a very unsafe function. If called multiple times
it allows setting the same device to different parents thus corrupting
the siblings list. This happens regularly since:
| commit c2e568d
| Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| Date: Sat Nov 3 16:11:05 2012 +0100
|
| bus: add bus device
|
| automatically add it as parent of any bus device if none already specified
|
| we have now a nice output per bus
If for example a FATfs is mounted this nice output per bus often ends with:
> `---- fat0
> `---- 0
> `---- 0x86f0000087020031-0x86f000410df27124: /dev/<NULL>
> `---- sram00
> `---- 0x00000000-0xffffffffffffffff: /dev/<NULL>
> `---- 0x00000000-0xffffffffffffffff: /dev/<NULL>
> unable to handle NULL pointer dereference at address 0x0000000c
> pc : [<87f08a20>] lr : [<87f08a04>]
> sp : 86eff8c0 ip : 87f3fbde fp : ffffffff
> r10: ffffffff r9 : 00000000 r8 : 00000003
> r7 : 86f075b8 r6 : 00000002 r5 : ffffffec r4 : 86f07544
> r3 : 00000000 r2 : 43f900b4 r1 : 00000020 r0 : 00000005
> Flags: Nzcv IRQs off FIQs off Mode SVC_32
> [<87f08a20>] (do_devinfo_subtree+0x90/0x130) from [<87f08a90>] (do_devinfo_subtree+0x100/0x130)
>
> [<87f3e070>] (unwind_backtrace+0x0/0x90) from [<87f28514>] (panic+0x28/0x3c)
> [<87f28514>] (panic+0x28/0x3c) from [<87f3e4b8>] (do_exception+0x10/0x14)
> [<87f3e4b8>] (do_exception+0x10/0x14) from [<87f3e544>] (do_data_abort+0x2c/0x38)
> [<87f3e544>] (do_data_abort+0x2c/0x38) from [<87f3e268>] (data_abort+0x48/0x60)
This patch fixes this by adding a device to its parents children list in
register_device so that dev_add_child is no longer needed. This function
is removed from the tree. Now callers of register_device have to clearly
set the parent *before* registering a device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Jan Lübbe <jlu@pengutronix.de>
Sascha Hauer
committed
on 12 Dec 2012
|
2012-12-07 |
mtd core: call driver write function with complete buffer
...
mtd->write is supposed to loop around pages internally, no need
to do this in mtd_write. This fixes a huge write performance drop
with the m25p80 driver when it was converted to a mtd driver recently.
Since mtd->writesize is 1 for this driver mtd_write ended up doing
single byte writes on the flash.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 7 Dec 2012
|
2012-11-03 |
mtd: introduce mtd_block_isbad
...
this allow to do not provide block_isbad at mtd driver level
as example spi flash
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Jean-Christophe PLAGNIOL-VILLARD
authored
on 1 Nov 2012
Sascha Hauer
committed
on 3 Nov 2012
|
2012-10-17 |
mtd: add parent support
...
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Jean-Christophe PLAGNIOL-VILLARD
authored
on 16 Oct 2012
Sascha Hauer
committed
on 17 Oct 2012
|
2012-10-16 |
mtd: register device a pure device
...
as we do not need to probe them and they have no driver or bus attached
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Jean-Christophe PLAGNIOL-VILLARD
authored
on 16 Oct 2012
Sascha Hauer
committed
on 16 Oct 2012
|
2012-10-13 |
mtd-core: add writesize in MEMGETINFO ioctl
...
Add writesize in MEMGETINFO ioctl.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Alexander Aring
authored
on 13 Oct 2012
Sascha Hauer
committed
on 13 Oct 2012
|
2012-10-04 |
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>
Jean-Christophe PLAGNIOL-VILLARD
authored
on 19 Sep 2012
Sascha Hauer
committed
on 4 Oct 2012
|
2012-09-07 |
mtd: use correct format specifier
...
For the size_t type the format specifier %zu or %zx must be used.
See Documentation/printk-formats.txt in the kernel for details.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Jan Luebbe
authored
on 7 Sep 2012
Sascha Hauer
committed
on 7 Sep 2012
|