mtd: bcm47part driver for BCM47XX chipsets
RFC PATCH v3 1/1 mtd: bcm47part driver for BCM47XX chipsets
This driver provides parser detecting partitions on BCM47XX flash memories. It has many differences in comparision to older BCM63XX, like:
1) Different CFE with no more trivial MAGICs
2) More partitions types (board_data, ML, POT)
3) Supporting more than 1 flash on a device
which resulted in decision of writing new parser.
It uses generic mtd interface and was successfully tested with Netgear WNDR4500 router which has 2 flash memories: serial one and NAND one.
---
V2: 1) Add support for more partitinos (ML and POT)
2) Optimize: don't scan whole flash (like up to 128 MiB)
3) Optimize: don't scan TRX partitions after detecting header
V3: 1) More defines less magic numbers
2) Less duplication by adding bcm47part_add_part
3) Mask out MTD_WRITEABLE only when needed
Correcting MTD_WRITEABLE discovered some new issue with the current code:
Creating 2 MTD partitions on "NAND 128MiB 3,3V 8-bit":
0x00000000001c-0x00000028a3b4 : "linux"
mtd: partition "linux" doesn't start on an erase block boundary -- force read-only 0x00000028a3b4-0x000008000000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-only
I've to talk with OpenWRT guys about that first. My offsets are theoretically OK, as I don't want TRX header to be part of "linux" partition. Not sure what do to about this.
--- drivers/mtd/Kconfig | 4 + drivers/mtd/Makefile | 1 + drivers/mtd/bcm47part.c | 188 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 193 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/bcm47part.c
drivers/mtd/Kconfig +4 -0
@@ -156,6 +156,10 @@ config MTD_BCM63XX_PARTS This provides partions parsing for BCM63xx devices with CFE bootloaders. +config MTD_BCM47_PARTS + tristate "BCM47XX partitioning support" + depends on BCM47XX + comment "User Modules And Translation Layers" config MTD_CHAR
drivers/mtd/Makefile +1 -0
@@ -12,6 +12,7 @@ obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o obj-$(CONFIG_MTD_AFS_PARTS) += afs.o obj-$(CONFIG_MTD_AR7_PARTS) += ar7part.o obj-$(CONFIG_MTD_BCM63XX_PARTS) += bcm63xxpart.o +obj-$(CONFIG_MTD_BCM47_PARTS) += bcm47part.o # 'Users' - code which presents functionality to userspace. obj-$(CONFIG_MTD_CHAR) += mtdchar.o
drivers/mtd/bcm47part.c new file +188 -0
188 lines not on this page · raw message
Signature · 1 line
1.7.7