<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mtk-20170518/target/linux/generic/files/drivers/mtd/mtdsplit, branch v17.01.1</title>
<subtitle>MTK 20170518 : Mediatek SDK based on OpenWRT Barrier Breaker</subtitle>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/'/>
<entry>
<title>ar71xx: Add support for Netgear WNR2000v1</title>
<updated>2016-12-14T09:37:01+00:00</updated>
<author>
<name>Huan Truong</name>
<email>htruong@tnhh.net</email>
</author>
<published>2016-12-12T21:25:01+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=fd62fa752bbff9ae5277098152e7960a14d241e1'/>
<id>fd62fa752bbff9ae5277098152e7960a14d241e1</id>
<content type='text'>
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 &lt;htruong@tnhh.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;htruong@tnhh.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kernel: mtdsplit: add support for WRGG images</title>
<updated>2016-10-26T22:50:42+00:00</updated>
<author>
<name>Stijn Tintel</name>
<email>stijn@linux-ipv6.be</email>
</author>
<published>2016-08-07T11:39:00+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=136319e72d14ed4f77e03db54c0c46dc85d685c3'/>
<id>136319e72d14ed4f77e03db54c0c46dc85d685c3</id>
<content type='text'>
Support splitting WRGG images, found in some D-Link devices (e.g.
DAP-2695).

Signed-off-by: Stijn Tintel &lt;stijn@linux-ipv6.be&gt;
Acked-by: John Crispin &lt;john@phrozen.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Support splitting WRGG images, found in some D-Link devices (e.g.
DAP-2695).

Signed-off-by: Stijn Tintel &lt;stijn@linux-ipv6.be&gt;
Acked-by: John Crispin &lt;john@phrozen.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kernel: mtdsplit_uimage: fix Edimax parser</title>
<updated>2016-10-15T07:01:45+00:00</updated>
<author>
<name>Mathias Kresin</name>
<email>dev@kresin.me</email>
</author>
<published>2016-09-29T17:28:13+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=634d690d740ad2e586701a393d60cc9753808193'/>
<id>634d690d740ad2e586701a393d60cc9753808193</id>
<content type='text'>
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 &lt;dev@kresin.me&gt;

edimax parser fix
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;dev@kresin.me&gt;

edimax parser fix
</pre>
</div>
</content>
</entry>
<entry>
<title>kernel: mtdsplit_uimage: fix rootfs offset</title>
<updated>2016-10-15T07:01:45+00:00</updated>
<author>
<name>Mathias Kresin</name>
<email>dev@kresin.me</email>
</author>
<published>2016-10-02T17:18:56+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=35073d47bb91fc0066a08c85c9206a6338a19b7e'/>
<id>35073d47bb91fc0066a08c85c9206a6338a19b7e</id>
<content type='text'>
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 &lt;dev@kresin.me&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;dev@kresin.me&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kernel: silence a false positive uninitialized variable warning</title>
<updated>2016-08-01T07:52:17+00:00</updated>
<author>
<name>Felix Fietkau</name>
<email>nbd@nbd.name</email>
</author>
<published>2016-07-31T18:43:03+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=ea6a3be62eb980313f009acdc6f4dafddf48a3b7'/>
<id>ea6a3be62eb980313f009acdc6f4dafddf48a3b7</id>
<content type='text'>
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kernel: mtdsplit: calculate kernel partition precisely for Seama</title>
<updated>2016-06-20T05:58:29+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>zajec5@gmail.com</email>
</author>
<published>2016-06-20T05:58:29+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=1aca2912145f0a4539698580e5e6195b4fc3d5c5'/>
<id>1aca2912145f0a4539698580e5e6195b4fc3d5c5</id>
<content type='text'>
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 &lt;zajec5@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;zajec5@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>treewide: replace nbd@openwrt.org with nbd@nbd.name</title>
<updated>2016-06-07T06:58:42+00:00</updated>
<author>
<name>Felix Fietkau</name>
<email>nbd@nbd.name</email>
</author>
<published>2016-06-07T06:58:31+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=7eeb254cc49c4e9f837c980826ec112b9404f341'/>
<id>7eeb254cc49c4e9f837c980826ec112b9404f341</id>
<content type='text'>
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kernel: mtdsplit: support uimage with UBI</title>
<updated>2016-02-24T22:43:16+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>zajec5@gmail.com</email>
</author>
<published>2016-02-24T22:43:16+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=319863f60e7fdd170bcd15720a5bc2d18dbe2cbc'/>
<id>319863f60e7fdd170bcd15720a5bc2d18dbe2cbc</id>
<content type='text'>
This patch adds uimage firmware split support for ubi.

Signed-off-by: YounJae Rho &lt;luxflow@live.com&gt;

SVN-Revision: 48755
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds uimage firmware split support for ubi.

Signed-off-by: YounJae Rho &lt;luxflow@live.com&gt;

SVN-Revision: 48755
</pre>
</div>
</content>
</entry>
<entry>
<title>kernel: mtdsplit: add missing digest field to Seama header</title>
<updated>2016-02-23T14:40:40+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>zajec5@gmail.com</email>
</author>
<published>2016-02-23T14:40:40+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=1a57ce0c03b8c33a69c3a87d537d1a61a666f046'/>
<id>1a57ce0c03b8c33a69c3a87d537d1a61a666f046</id>
<content type='text'>
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 &lt;zajec5@gmail.com&gt;

SVN-Revision: 48754
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;zajec5@gmail.com&gt;

SVN-Revision: 48754
</pre>
</div>
</content>
</entry>
<entry>
<title>kernel: mtdsplit: support Seama entity with UBI</title>
<updated>2016-02-01T12:41:53+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>zajec5@gmail.com</email>
</author>
<published>2016-02-01T12:41:53+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=9220dd5d368efb81132007cca93eb783fd7b48dc'/>
<id>9220dd5d368efb81132007cca93eb783fd7b48dc</id>
<content type='text'>
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 &lt;zajec5@gmail.com&gt;

SVN-Revision: 48600
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;zajec5@gmail.com&gt;

SVN-Revision: 48600
</pre>
</div>
</content>
</entry>
</feed>
