summaryrefslogtreecommitdiff
path: root/target/linux/generic/files/drivers/mtd
Commit message (Collapse)AuthorAgeFilesLines
* ar71xx: Add support for Netgear WNR2000v1Huan Truong2016-12-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds supports for the WNR2000v1 board with 4MB flash, and produces device-specific factory, rootfs, and sysupgrade files for the WNR2000v1. This board is errorneously claimed as supported on the OpenWRT wiki as AP81, but AP81 image would not work because of APT81 image requiring having 8MB of flash, while WNR2000v1 has only 4MB. The image requires the u-boot bootloader to be modified to fuhry's bootloader first. Short specification: - CPU: Atheros AR9132 - 4x 10/100 Mbps Ethernet, 1x WAN 10/100 Mbps - 4 MB of Flash - 32 MB of RAM - UART header (J1) on board - 1x button Factory/Initial flash instructions: - Set up a TFTP server on your local machine. - Download the uImage for ar71xx-generic and the rootfs image for ar71xx-generic-wnr2000 and save in the tftp server root. - Gain serial access to the router via the UART port (telnetenable over the network only won't work!). - Upgrade the u-boot bootloader to fuhry's version by running the script: http://fuhry.com/b/wnr2000/install-repart.sh - When the router restarts, interrupt u-boot and gain access to u-boot command line. - Repartititon the board and flash initial uImage and rootfs as follow. Commands to type in u-boot: # tells u-boot that we have a tftp server on 192.168.1.10 setenv serverip 192.168.1.10 # tells u-boot that the router should take the address 192.168.1.1 setenv ipaddr 192.168.1.1 # erase the region from 0x050000-0x3f0000 erase 0xbf050000 +0x3A0000 # loads sqfs.bin on TFTP server, and put it to memory address 0x81000000 tftpboot 0x81000000 sqfs.bin # it will tell you the length of sqfs.bin in hex, let's say ZZZZZZ # copy bit by bit 0xZZZZZZ bytes from offset 0x050000 cp.b 0x81000000 0xbf050000 0xZZZZZZ # same to the uImage.bin, write it right next to sqfs.bin # again, 0xYYYYYY is the length that tftpboot reports tftpboot 0x81000000 uImage.bin cp.b 0x81000000 0xbf2a0000 0xYYYYYY # We need to tell the kernel what board it is booting into, and where to find the partitions setenv bootargs "board=WNR2000 console=ttyS0,115200 mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro rootfstype=squashfs,jffs2 noinitrd" # Tell u-boot where to find the uImage setenv bootcmd "bootm 0xbf2a0000" # Tell u-boot to save parameters to the u-boot-env partitions saveenv # Reset the board reset Tested on: - WNR2000v1 board. - Initial flash works. Known bugs: - I don't know why factory image doesn't work on initial flash on stock firmware in u-boot recovery mode while it should. - Sysupgrade does not yet work, if you do -f it will mess up your installation (requiring a reinstall of sqfs and uImage). Signed-off-by: Huan Truong <htruong@tnhh.net>
* kernel: mtdsplit: add support for WRGG imagesStijn Tintel2016-10-273-0/+115
| | | | | | | | Support splitting WRGG images, found in some D-Link devices (e.g. DAP-2695). Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> Acked-by: John Crispin <john@phrozen.org>
* kernel: mtdsplit_uimage: fix Edimax parserMathias Kresin2016-10-151-13/+7
| | | | | | | | | | | | | | According to the author the code was added to in preparation for adding support for a new board. The patch for the board was never send and the code never really tested. The edimax header starting with the edimax magic is put in front of the uImage header. There is no special uImage header used. Means, default magic and the type field is set to kernel as usual. Signed-off-by: Mathias Kresin <dev@kresin.me> edimax parser fix
* kernel: mtdsplit_uimage: fix rootfs offsetMathias Kresin2016-10-151-1/+1
| | | | | | | | The return value of the find_header function need to be added to the uimage_size, otherwise mtd_find_rootfs_from() might search for a rootfs within a custom header and fails. Signed-off-by: Mathias Kresin <dev@kresin.me>
* kernel: silence a false positive uninitialized variable warningFelix Fietkau2016-08-011-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel: mtdsplit: calculate kernel partition precisely for SeamaRafał Miłecki2016-06-201-2/+2
| | | | | | | | | So far "kernel" partition didn't contain just a kernel. It also included Seama header and meta data. This was making kernel update complex and it wasn't trivial to read kernel size. Fix it by making "kernel" parition contain just a kernel image. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
* treewide: replace nbd@openwrt.org with nbd@nbd.nameFelix Fietkau2016-06-075-5/+5
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel: mtdsplit: support uimage with UBIRafał Miłecki2016-02-241-3/+7
| | | | | | | | This patch adds uimage firmware split support for ubi. Signed-off-by: YounJae Rho <luxflow@live.com> SVN-Revision: 48755
* kernel: mtdsplit: add missing digest field to Seama headerRafał Miłecki2016-02-231-0/+1
| | | | | | | | | | | | | | | | | | | Seama format has 2 similar headers: container (seal) header and entity header. The first one has size always set to 0 and doesn't contain MD5 digest. When dealing with Seama on a flash we deal directly with an entity. You can see mtdsplit_parse_seama reads from offset 0 and expects entity to be there. Seama container is used by bootloader / interface only which extract entity out of it and flash it. That said we should fix our header struct. This is important as we calculate possible rootfs offset assuming it may be placed right after Seama entity. So far calculate offset was always 16B too low. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48754
* kernel: mtdsplit: support Seama entity with UBIRafał Miłecki2016-02-012-3/+8
| | | | | | | | | | Some D-Link routers (e.g. DIR-885L) have NAND and use Seama format. It means OpenWrt will want to have UBI in Sseama entity and should be able to detect it. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48600
* kernel: mtdsplit: detect UBI partition when looking for rootfsRafał Miłecki2016-02-012-0/+7
| | | | | | | | | This allows mtdsplit parsers work with UBI which is very popular on NAND flases. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48599
* kernel: mtdsplit: modify rootfs helpers to provide partition typeRafał Miłecki2016-02-019-26/+42
| | | | | | | | | | Our mtdsplit parsers may want to create partition with name choice based on partition file system (e.g. SquashFS vs. JFFS2). This patch allows passing extra argument pointing to variable that will be set properly. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48598
* kernel: mtdsplit: document Seama splitter a bitRafał Miłecki2016-01-251-8/+10
| | | | | | | | | | Rename kernel_size variable as it includes whole entity size, not just a kernel size. Also update comments to match it and describe better what are we checking/looking for. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48480
* ar71xx: add support for Netgear WPN824NJohn Crispin2016-01-191-0/+2
| | | | | | | | | | | | | | | | Add support for Netgear WPN824N. Hardware specs: * AR7240, 4 LAN ports, 1 WAN port * AR9285 WLAN * 32 MB RAM * 4 MB Flash * 16 LEDs (LAN, WAN and Power/Status contain two LEDs for dual color effect) * 3 Buttons (not supported) Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> SVN-Revision: 48356
* kernel: mtdsplit_squashfs: Align with the erase-block sizeFelix Fietkau2016-01-171-1/+1
| | | | | | | | | | | | | | On most image types the rootfs ends at an erase-block. However, at least with brnImages this is not the case: while the partitions are aligned with the erase-block size there is a 12 byte footer at the end of the partition which must not be touched by any filesystem. This lead to a rootfs_data partition which was not aligned properly (and thus ended up being readonly): 0x000000480000-0x00000085a800 : "rootfs_data" (128 KiB EB) Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> SVN-Revision: 48263
* kernel: mtdsplit: add support for EVA imagesFelix Fietkau2016-01-173-0/+102
| | | | | | | | | This allows splitting EVA images (usually found in fritz devices). The firmware will be split into a kernel and a separate rootfs partition. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> SVN-Revision: 48262
* kernel: mtdsplit: add support for brnImagesFelix Fietkau2016-01-173-0/+110
| | | | | | | | | | | | | | | | | This adds brnImage (used with the brnboot bootloader) firmware parsing support. brnboot verifies the integrity of the firmware stored on the "Code Image" partitions by looking at the 12 byte footer at the very end of the partition. This footer contains the checksum of the original brnImage (kernel + rootfs/squashfs) and must not be touched (by our JFFS2 rootfs_data - otherwise the image will not be bootable anymore). Big thanks to Mathias Kresin for analyzing the brnImage structure and finding out the information how to keep images valid even when adding a nested rootfs_data partition. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> SVN-Revision: 48261
* kernel: mtdsplit: add support for FIT imageJohn Crispin2015-03-153-0/+146
| | | | | | | | | | | If this option is enabled, the FIT image format will be detected and split by the mtdsplit code. Detection is based upon the FDT magic, which will trigger the parsing and detection of the rootfs, ending-up in the creation of the 2 new partitions. Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org> SVN-Revision: 44792
* kernel: mtdsplit_uimage: fix passed info about buf sizeRafał Miłecki2015-02-121-2/+2
| | | | | | | | We obviously can't use sizeof(*buf) which is always 1. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 44424
* kernel: mtdsplit_uimage: read more data to match Edimax needsRafał Miłecki2015-02-121-8/+12
| | | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 44415
* kernel: mtdsplit_uimage: use separated buffer for reading dataRafał Miłecki2015-02-121-18/+16
| | | | | | | | | We shouldn't read data directly into the header struct, as some devices (e.g. Edimax) need more bytes due to some extra header. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 44414
* kernel: mtdsplit_uimage: add parser for Edimax devicesRafał Miłecki2015-02-121-0/+53
| | | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 44413
* mtdsplit_uimage: more generic header verify functionRafał Miłecki2015-02-121-11/+26
| | | | | | | | | | Some devices have uImage headers after some extra headers (e.g. Edimax devices). To support such cases our verify callback function should be allowed to return header offset, not just a boolean value. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 44412
* ar71xx: add Netgear WNR1000v2/WNR1000v2-VC support (#18633)John Crispin2015-01-301-0/+4
| | | | | | | | | | | The board is already supported by OpenWrt. WNR1000v2/WNR1000v2-VC are pretty much the same as WNR2000v3/WNR612v2, therefore the same initialization code and flash layout is used. Signed-off-by: Ștefan Rusu <saltwaterc@gmail.com> Tested-by: Douglas Fraser <1dsfraser@gmail.com> SVN-Revision: 44221
* kernel: add mtd split support for trx imagesFelix Fietkau2015-01-023-0/+153
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 43809
* kernel: add a mtdsplit implementation for tp-link firmware headersFelix Fietkau2015-01-023-0/+175
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 43806
* kernel: move mtdsplit files to drivers/mtd/mtdsplit/ to simplify ↵Felix Fietkau2015-01-028-0/+17
| | | | | | | | maintenance, unify patches across kernel versions Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 43805
* ar71xx: add support for Netgear WNR2000v4John Crispin2014-11-031-1/+6
| | | | | | Signed-off-by: Michaël Burtin <mburtin@gmail.com> SVN-Revision: 43173
* kernel: add own Kconfig for OpenWrt mtdsplit driversJohn Crispin2014-08-251-0/+24
| | | | | | | | | | | | | There are pretty many OpenWrt patches against mtd subsystem resulting in a bit of mess and growing maintenance cost. My idea is to use an extra "mtdsplit" directory with OpenWrt specific files (including Kconfig). This is the first step to achieve this. This patch adds a "mtdsplit" directory with Kconfig and replaces 4 patches with a single one. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 42287
* kernel/generic: modify mtd related patches for 3.14Hauke Mehrtens2014-05-085-25/+19
| | | | | | | | | | | | | | | | | Function register_mtd_parser always returned 0 (at least since v3.3) before being changed to return void in v3.14-rc1~65^2~93 (mtd: make register_mtd_parser return void), so it's not needed to check the return value of this function. Also add __init flag to caller. This fix compile errors in 3.14 kernel like: drivers/mtd/mtdsplit_seama.c: In function 'mtdsplit_seama_init': drivers/mtd/mtdsplit_seama.c:99:2: error: void value not ignored as it ought to be return register_mtd_parser(&mtdsplit_seama_parser); ^ Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> SVN-Revision: 40731
* kernel/3.1x: add split code for LZMA compressed kernel based firmwaresGabor Juhos2014-01-241-0/+95
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 39387
* Revert "kernel: create firmware partition from MyLoader partition parser"Gabor Juhos2014-01-241-13/+2
| | | | | | | | | | | | | | | This reverts r38197. The automatically created firmware partition includes the partition_table partition. Apart from the partition table, this partition contains sensitive data on some Compex devices which data can be destroyed when the firmware partition gets modified. Revert the change to prevent that. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 39382
* generic: mtdsplit_uimage: add uImage magic for the WRN2200 boardGabor Juhos2013-10-301-0/+2
| | | | | | | | | Should fix boot failure on the WNR2200 boards. Compile tested only. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 38594
* kernel: create firmware partition from MyLoader partition parserGabor Juhos2013-09-251-2/+13
| | | | | | | | This is in preparation for sysupgrade support for Compex devices. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 38197
* kernel/3.10: add partition parser for Seama firmwaresGabor Juhos2013-09-211-0/+102
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 38114
* kernel/3.10: add partition parser for uImage firmwaresGabor Juhos2013-09-211-0/+291
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 38113
* kernel/3.10: add default partition name defines to mtdsplit.hGabor Juhos2013-09-211-0/+3
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 38112
* kernel/3.10: add more helpers to the mtdsplit codeGabor Juhos2013-09-212-1/+72
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 38111
* kernel/3.10: add separate rootfs partition parserGabor Juhos2013-09-211-0/+71
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 38110
* kernel/3.10: move squashfs check from rootfs split code into a separate fileGabor Juhos2013-09-212-0/+97
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 38109
* generic: remove linux version checks from myloader.cGabor Juhos2013-09-021-6/+0
| | | | | | | | | | | The myloader partition parser code uses ifdef wrappers to make the code usable on kernels below version 3.2. All targets are using kernel 3.3 at least so the wraper is not needed. Remove that. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 37880
* generic: use mtd_read in myloader parserGabor Juhos2012-10-271-2/+2
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 33952
* generic: allow to build myloader mtd parser for 3.2+Gabor Juhos2012-01-221-3/+11
| | | | SVN-Revision: 29858
* rename target/linux/generic-2.6 to genericFelix Fietkau2010-06-261-0/+178
SVN-Revision: 21952