9
0
Fork 0
Commit Graph

24 Commits

Author SHA1 Message Date
Sascha Hauer 9f8aab600d drop CONFIG_PARTITION_NEED_MTD
With CONFIG_PARTITION_NEED_MTD enabled we use mtd rather than devfs
directly to create partitions on mtd devices. Since:

| commit b32cd8df87
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date:   Wed Apr 9 15:49:32 2014 +0200
|
|     mtd: nand: bb: use mtd api directly
|
|     The devfs layer just adds an addition indirection between mtd
|     and the bb devices with no purpose. Drop it.
|
|     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

The bad block aware device creation doesn't work if this option
is disabled. With this we remove CONFIG_PARTITION_NEED_MTD and always
use mtd partitions on mtd devices.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-13 09:19:46 +02:00
Sascha Hauer e6410cd9c4 devfs-core: return new cdev also for mtd partitions
__devfs_add_partition returns the newly created cdev, but in case
of mtd partitions it accidently returns 0. Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-09 22:27:21 +02:00
Sascha Hauer 74213ed9a7 Merge branch 'for-next/partitionhelper'
Conflicts:
	fs/devfs-core.c
2014-03-07 09:25:53 +01:00
Uwe Kleine-König 2a644bed63 devfs: partitioning: add new helper devfs_create_partitions
Compared to devfs_add_partition which adds a single partition
devfs_create_partitions creates several partitions at once. One nice
benefit is that this simplifies appending partitions because the start
of the latter partition doesn't need to be specified explicitly.
Also dev_add_bb_dev() is called by the new helper if the bbname is
specified for a partition.

Note that adding partitions is also more flexible now (also via
devfs_add_partition) because negative values for offset and size now
have a proper meaning instead of creating broken partitions.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 11:19:07 +01:00
Uwe Kleine-König a7f78e7273 devfs_add_partition: make flags parameter unsigned
The value is only used to assign to a (*struct cdev)->flags which is an
unsigned int and it is passed as fourth parameter of mtd_add_partition which
is an unsigned long.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 08:20:26 +01:00
Uwe Kleine-König 835bb02e26 devfs: partitioning: add missing free in error path
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 08:20:26 +01:00
Sascha Hauer 0c76b7e377 mtd: register mtd partitions as real mtd devices
So far mtd partitions were mtd devices, but these were not registered.
This patch changes this. mtd partitions are now registered like real
mtd devices. This makes them part of the device hierarchy.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-26 08:33:18 +01:00
Sascha Hauer d7fe5e2263 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>
2013-12-20 15:04:30 +01:00
Sascha Hauer 0ee203186d cdev: add device_find_partition
device_find_partition allows to find a partition of a device with
a particular name.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:16:14 +02:00
Sascha Hauer 2672c906a4 cdev: allow to open a struct cdev
cdev_open() opens a cdev by name. This introduces cdev_do_open which
allows to open a cdev when the cdev is already found by other means.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:16:09 +02:00
Sascha Hauer bec70b3aaa cdev: introduce partition names
currently most partition cdevs have the name <devname>.<partname>
This makes it hard to find a partition by <partname>. This introduces
a partname field in struct cdev so that.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:16:04 +02:00
Sascha Hauer 121c3d6e9c devfs: let devfs_add_partition return the new partition
Useful for unregistering later or for adding addional flags.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:15:47 +02:00
Wolfram Sang 8c98a5dfb7 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>
2012-12-19 10:31:23 +01:00
Alexander Aring 346b16ba0a devfs-core: add writesize in mtd partition ioctl
Add writesize in mtd partition MEMGETINFO ioctl.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-23 08:25:31 +02:00
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-17 10:57:41 +02:00
Sascha Hauer cfcfc66d54 partitions: Make 64bit capable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:25 +02:00
Sascha Hauer be573120fe make cdev 64bit capable
Next step to 64bit support: Make cdev size a 64bit type.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:24 +02:00
Sascha Hauer e71c343668 mtd: fix arguments to bad block ioctls
In the Kernel the mtd ioctls expect a pointer to the offset, whereas
barebox interprets the pointer itself as an offset. Since we want
to add 64bit support for file sizes a pointer may not be sufficient,
so align with the kernel and convert it to a pointer to the offset.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:16 +02:00
Jean-Christophe PLAGNIOL-VILLARD 7e3a16ef14 complete: add delpart complete support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:40 +08:00
Jean-Christophe PLAGNIOL-VILLARD 440aec700a devfs-code: fix warning
/opt/work/barebox/fs/devfs-core.c: In function 'partition_ioctl':
/opt/work/barebox/fs/devfs-core.c:109:27: warning: unused variable 'reg'

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-16 11:41:52 +01:00
Alexander Aring 364c3aadfd ioctl: add support for ECCGETSTATS and MEMGETREGIONINFO
Support added for ioctl of ECCGETSTATS and MEMGETREGIONINFO.

Fix default handling in core.c to return -EINVAL, if request
was unknown.

Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-06 09:49:37 +01:00
Sascha Hauer 4ecd0003ac cdev: pass flags to open function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:46:50 +01:00
Juergen Beisert 3ca9f1812f Create a unique cdev number for on demand devices
For disk like devices attached to MCI, ATA or USB it depends on the order they
will be recognized. So an unique number for all disk like devices is required.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-28 09:23:24 +01:00
Sascha Hauer 30be97aff2 devfs: factor out core devfs functionality
This makes it possible to compile without devfs. devfs_create/devfs_remove
is used by drivers and thus must still be present even without devfs support.
Also, this patch adds cdev_open/cdev_close/cdev_flush/cdev_ioctl calls to
work with devices without using the file api.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 12:36:07 +02:00