ar71xx: Speed up caldata/eeprom handling
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Thu, 7 Mar 2019 08:40:08 +0000 (09:40 +0100)
committerChristian Lamparter <chunkeey@gmail.com>
Wed, 13 Mar 2019 15:27:41 +0000 (16:27 +0100)
commit51fb186cb3d238bcc73ca14a5240ec091e30d413
treec7e9a0aabf66a64637ce5981d5564accf154808c
parente1ba59ea5c0270c1cce696d5c93bec460cdc7ca3
ar71xx: Speed up caldata/eeprom handling

Reading and writing to and from flash storage is slowed down
enormously by some functions which use a block size of 1.

This patch reworks the extraction scripts to be much faster and
efficient by reading and writing in possibly one big block.

This is based on the initial commit a69e101 for ipq40xx by
Christian Lamparter <chunkeey@gmail.com>.

Speed comparison @ TP-Link TL-WDR4300 (just manually) results
in a time reduction by three orders of magnitude (99.9 %).

> time dd if=/dev/mtd3 of=/lib/firmware/test-slow bs=1 count=4096 skip=4096
4096+0 records in
4096+0 records out
real    0m 15.85s
user    0m 0.06s
sys     0m 13.28s

> time dd if=/dev/mtd3 of=/lib/firmware/test-fast bs=4096 count=1 skip=4096 iflag=skip_bytes
1+0 records in
1+0 records out
real    0m 0.02s
user    0m 0.00s
sys     0m 0.02s

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata