2020-04-27 |
treewide: remove references to CREDITS
...
The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97
("Remove the CREDITS file"). Remove references to it from several files.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Uwe Kleine-König
authored
on 23 Apr 2020
Sascha Hauer
committed
on 27 Apr 2020
|
2019-01-29 |
devfs: Drop dev_lseek_default()
...
Only the following cdevs do not declare an .lseek() operation:
- Console devices in common/console.c
- Firmware framework in common/firmware.c
- JTAG driver in drivers/misc/jtag.c
- UBI in drivers/mtd/ubi/barebox.c
Of those four, first two are marked DEVFS_IS_CHARACTER_DEV and
implement only .write() operation and the last two don't implement
anything but .ioctl(). While there's probably no meaningful way to use
lseek() against any of those devices, there doesn't seem to be any
harm in allowing it either.
Change devfs_lseek() to ignore absense of .lseek() callback and drop
dev_lseek_default() and all references to it in the codebase.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Andrey Smirnov
authored
on 29 Jan 2019
Sascha Hauer
committed
on 29 Jan 2019
|
2019-01-15 |
mtd: core: Fix erase area alignment for non power of 2 erasesize
...
On Thu, Jan 10, 2019 at 09:32:07AM +0100, Sascha Hauer wrote:
> On Wed, Jan 09, 2019 at 12:28:14PM +0100, Ladislav Michl wrote:
> > Devices as AT45DB161 DataFlash uses non power of two page size (528)
> > while present alignment algorithm relies on erasesize being power
> > of 2.
> > Fix that by introducing helper functions rounding to any multiply.
> > Note that logic is sligthly changed to be consistent as ending
> > address is moved forward to include also last byte meant to be
> > erased while previous implementation moved it backward.
> >
> > Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
> > ---
> > drivers/mtd/core.c | 28 ++++++++++++++++++++++------
> > include/linux/kernel.h | 5 +++++
> > 2 files changed, 27 insertions(+), 6 deletions(-)
>
> Applied, thanks
Hi Sascha,
I was searching for paper bag, but was unable to find anything thick
enouh to cover behind :-/ This version is buggy and I noticed right
now when testing on another board. Corrected version follows, which
is also 192 bytes shorter for my ARM target. It seems next branch
at https://git.pengutronix.de/ is not yet updated, so perhaps my fault
won't affect anyone.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Ladislav Michl
authored
on 12 Jan 2019
Sascha Hauer
committed
on 15 Jan 2019
|
2018-11-26 |
mtd: return EOPNOTSUPP when attempting to erase an MTD_NO_ERASE device
...
At least some MTD_NO_ERASE devices like MRAM do not specify a sensible
erase block size; instead, erasesize is equal to the whole flash size. This
leads to an EINVAL return from mtd_erase_align() whenever a partial erase
is attempted.
At least on the MRAM I tested, a full flash erase did not return an error,
but it did not have any effect on the flash either. As erase seems to be
entirely unsupported on this class of devices, and it is not necessary
anyways, it's better to return early with EOPNOTSUPP.
This fixes envfs_save() on a partitioned MRAM.
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Matthias Schiffer
authored
on 23 Nov 2018
Sascha Hauer
committed
on 26 Nov 2018
|
2018-10-18 |
drivers: Introduce dev_set_name()
...
Introduce dev_set_name() in order to hide implementation details of
setting device's name so it'd be easier to change it.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Andrey Smirnov
authored
on 16 Oct 2018
Sascha Hauer
committed
on 18 Oct 2018
|
2018-10-08 |
mtd: do not attach already attached UBI
...
in mtd_detect we do not check if the mtd is already attached to UBI. If
it is we get the error:
ERROR: ubi: mtd0 is already attached to ubi0
Check before trying to attach it to avoid this message.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Oct 2018
|
2018-06-07 |
mtd: core: Fix printing partitions in hex
...
When printing the partition size with "0x" prefix the value has to
be displayed in hex.
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Teresa Remmet
authored
on 6 Jun 2018
Sascha Hauer
committed
on 7 Jun 2018
|
2018-04-06 |
rename file_operations -> cdev_operations
...
Linux also has struct file_operations which are something different.
Rename our file_operations to cdev_operations which better matches
what we have.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2018
|
2017-04-11 |
param: make parameter functions more consistent
...
This patch creates a consitent set of device parameter functions.
With this we have: dev_add_param_<type><access>
"type" is one of: int32, uint32, int64, uint64, string, mac, ipv4, enum, bitmask
The improvement here is that we now can exactly specify the width of the
int type parameters and also correctly distinguish between signed and
unsigned variables which means that a variable no longer ends up with
INT_MAX when it's assigned -1.
"access" can be empty for regular read/write parameter, "_ro" for readonly
parameters which get their value from a variable pointer in the
background or "_fixed" for parameters which are set to a fixed value
(without a pointer in the background).
Some more exotic types are not (yet) implemented, like
dev_add_param_ip_ro.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Apr 2017
|
mtd: use dev_add_param_string
...
dev_add_param_string allows to pass a priv * so that the device_d *
argument is not needed and can be removed later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Apr 2017
|
2017-03-30 |
of: partition: Move of_mtd_fixup to drivers/of/
...
Move the fixup code where the parser code is already.
Since the code will not only be used for mtd in the future
drivers/of/ is a better place than drivers/mtd/.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 30 Mar 2017
|
2017-03-23 |
mtd: fix reading data from page that needs cleanup
...
mtd_read´() returns -EUCLEAN to indicate that a page needs cleanup.
This value shouldn't be returned from the mtd read file operation
since this should return the number of bytes read.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2017
|
2016-11-11 |
mtd: Make UBI detection more robust
...
When we want to detect if a mtd device contains an UBI image then
testing the first block is not enough since it can always happen that
UBI has just erased the block before the power failed during last boot.
Since UBI only ever erases one block at a time and directly writes the
ec header to it afterwards, it shouldn't be necessary to scan the whole
device for UBI data. Scan the first 64 blocks. The first non-empty block
then must contain UBI data, if instead we find foreign data we assume
that no UBI is on that mtd device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Nov 2016
|
2016-04-15 |
string: Fix (v)asprintf prototypes
...
Our asprintf and vasprintf have different prototypes than the glibc
functions. This causes trouble when we want to share barebox code
with userspace code. Change the prototypes for (v)asprintf to match
the glibc prototypes. Since the current (v)asprintf are convenient
to use change the existing functions to b(v)asprintf.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Apr 2016
|
2016-03-15 |
mtd: Introduce mtd_check_pattern
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Mar 2016
|
mtd: rename mtd_all_ff -> mtd_buf_all_ff
...
To make clear this function checks a given buffer and not data on a mtd
device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Mar 2016
|
mtd: Introduce function to get mtd type string
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Mar 2016
|
mtd: Add support for marking blocks as good
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Mar 2016
|
2016-03-04 |
mtd: mtd_[read|write|erase]: check for valid input data
...
mtd_[read|write|erase] are input functions to the mtd subsystem, so
check for valid input data here rather than relying on the drivers doing
this. The checks are copied from the Kernel as of 4.5-rc5
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Mar 2016
|
2016-02-23 |
mtd: core: check offset in mtd_block_markbad
...
Check if the given offset is valid for the mtd device. Print an error
message if not to inform the user in the command 'nand'.
Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Stefan Christ
authored
on 15 Feb 2016
Sascha Hauer
committed
on 23 Feb 2016
|
2016-02-09 |
mtd: Fix erasing of devices >4GiB
...
When a device >4GiB is erased, not only the offset can be bigger
than 4GiB, but also the size. This happens with the simplest command
to erase a device: erase /dev/nand0. Make the size argument a 64bit
type to make this work.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Feb 2016
|
mtd: Fix mtd_op_erase for devices >4GiB
...
The mtd erase file operation has a unnecessary conversion to unsigned
long in the offset. Remove it to make it work with chips >4GiB.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Feb 2016
|
mtd: Fix mtd_op_read for devices >4GiB
...
The mtd read file operation has a unnecessary conversion to unsigned
long in the read offset. Remove it to make it work with chips >4GiB
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Feb 2016
|
mtd: Make erase_info structs 64bit where necessary
...
Make the userspace structs 64bit where necessary. Since we do not have
separated kernel/userspace in barebox we can just modifiy the original
structs instead of adding separate 64bit structs.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Feb 2016
|
2015-11-23 |
mtd: core: initialize *retlen in mtd_write()
...
Some mtd drivers like the spi-nor driver do not assign a value
to the retlen pointer but instead only add the bytes written
to *retlen. Users of mtd_write expect the variable to be initialized
by the mtd core though, so we have to do it in mtd_write(). The
same is done in mtd_read already.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Nov 2015
|
2015-07-23 |
mtd: of: put master offset into partition name
...
Partition names should be partition@<offset> with <offset> being the
offset in the master mtd, and not a counting number.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Jul 2015
|
2015-07-20 |
mtd: core: Check partitions for empty string
...
Make setting partitions a litte bit more robust.
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Teresa Remmet
authored
on 17 Jul 2015
Sascha Hauer
committed
on 20 Jul 2015
|
2015-07-03 |
Merge branch 'for-next/mtd'
...
Conflicts:
drivers/mtd/core.c
Sascha Hauer
committed
on 3 Jul 2015
|
2015-06-29 |
mtd: Make devname argument to add_mtd_device const
...
add_mtd_device duplicates the string where necessary, so make it
const.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 29 Jun 2015
|
2015-06-26 |
mtd: detect ubi devices automatically
...
Hook UBI attachment into the mtd class devices detect function. This
makes it possible to attach ubi devices with 'detect nand0.root'.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Jun 2015
|