openwrtv3/target/linux/ar71xx
John Crispin 24a0269b71 ar71xx: qihoo-c301: reset imageNtrynum after each successful boot.
Qihoo C301 has 2 flash chips of which one is used as primary and the
other is used as backup.  OEM U-Boot will try to boot an activeregion N
with imageNstatus=0 and imageNtrynum <= imagemaxtry.  If such a region
is found, bootloader will try to increment imageNtrynum and boot it.

This patch tries to reset imageNtrynum after each successful boot (if
the boot process reaches the execution of /etc/init.d/done).

	root@OpenWrt:/# hexdump -C -n 128 /dev/mtdblock9
	00000000  9e f3 63 91 61 63 74 69  76 65 72 65 67 69 6f 6e  |..c.activeregion|
	00000010  3d 31 00 69 6d 61 67 65  31 73 74 61 74 75 73 3d  |=1.image1status=|
	00000020  30 00 69 6d 61 67 65 32  73 74 61 74 75 73 3d 30  |0.image2status=0|
	00000030  00 69 6d 61 67 65 32 74  72 79 6e 75 6d 3d 30 00  |.image2trynum=0.|
	00000040  69 6d 61 67 65 6d 61 78  74 72 79 3d 33 00 69 6d  |imagemaxtry=3.im|
	00000050  61 67 65 31 74 72 79 6e  75 6d 3d 30 00 00 00 00  |age1trynum=0....|
	00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>

SVN-Revision: 42914
2014-10-14 12:21:36 +00:00
..
base-files ar71xx: qihoo-c301: reset imageNtrynum after each successful boot. 2014-10-14 12:21:36 +00:00
files ar71xx: Fix LED definitions for the DRAGINO2 board 2014-10-14 10:33:07 +00:00
files-3.10/arch/mips/ath79 ar71xx: add linux 3.14 support 2014-08-07 12:40:53 +00:00
generic ar71xx: add qihoo 360 c301 router support 2014-09-15 10:19:38 +00:00
image ar71xx: add support for TP-LINK TL-WR847N v8 (clone of TL-WR841N/ND v8) 2014-10-06 04:52:57 +00:00
mikrotik ar71xx: added support for TL-WA830RE V2 2014-07-13 07:12:22 +00:00
nand ar71xx: add RTC feature flag to ar71xx/nand 2014-08-01 10:32:55 +00:00
patches-3.10 ar71xx: add wmac callback for reading soc revision on ar934x 2014-09-27 20:52:05 +00:00
patches-3.14 ar71xx: add wmac callback for reading soc revision on ar934x 2014-09-27 20:52:05 +00:00
base-files.mk ar71xx: drop procd_init console hack 2013-06-21 16:53:11 +00:00
config-3.10 ar71xx: add qihoo 360 c301 router support 2014-09-15 10:19:38 +00:00
config-3.14 ar71xx: add qihoo 360 c301 router support 2014-09-15 10:19:38 +00:00
Makefile ar71xx: revert accidental kernel upgrade 2014-09-27 20:54:12 +00:00
modules.mk ar71xx: always enable hw ecc support for the ar934x-nfc module 2013-11-01 18:33:18 +00:00