Changeset 33447


Ignore:
Timestamp:
2012-09-17T16:17:12+02:00 (5 years ago)
Author:
cshore
Message:

[ar71xx] dir-825-b1: Fix wholeflash images: Attempting to flash a wholeflash (-openwrt) image from the normal image would brick (but recoverable via emergency flash) the router if the wholeflash image was larger than the maximum size for a normal image. First we rename the -openwrt images to -wholeflash since -openwrt is really too generic. We also revert the changes to the regular dir-825-b1 image, which now is the same as before, but add a -towholeflash image which is almost the same as the regular dir-825-b1 image, but copies caldata to new location and allows flashing of images that use the full flash (except u-boot, u-boot-env, and caldata paritition space) (these are the -wholeflash images).

Location:
trunk/target/linux/ar71xx
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/base-files/etc/diag.sh

    r33326 r33447  
    6666                ;; 
    6767        dir-825-b1 |\ 
    68         dir-825-b1-openwrt |\ 
     68        dir-825-b1-towholeflash |\ 
     69        dir-825-b1-wholeflash |\ 
    6970        dir-825-b1-stock) 
    7071                status_led="d-link:orange:power" 
  • trunk/target/linux/ar71xx/base-files/etc/uci-defaults/caldata-migration

    r33326 r33447  
    4545 
    4646case "$board" in 
    47 dir-825-b1) 
     47dir-825-b1-towholeflash) 
    4848        mac1="$(getcalmac caldata 65440)" 
    4949        mac1="$(calcmacX "$mac1" 2)" 
     
    5151 
    5252        if grep -q '"owrt_caldata"' /proc/mtd && [ "$mac1" = "$(getifmac eth0)" ] && [ "$mac2" = "$(getifmac eth1)" ]; then 
     53                mtd erase owrt_caldata 
    5354                dd if=/dev/$(findmtd caldata) of=/dev/$(findmtd owrt_caldata) bs=65536 count=1 
    5455        fi 
     
    5960        mac2="$(calcmacX "$mac1" 1)" 
    6061        if grep -q '"owrt_caldata"' /proc/mtd && [ "$mac1" = "$(getifmac eth0)" ] && [ "$mac2" = "$(getifmac eth1)" ]; then 
     62                mtd erase caldata 
    6163                dd if=/dev/$(findmtd owrt_caldata) of=/dev/$(findmtd caldata) bs=65536 count=1 
    6264        fi 
  • trunk/target/linux/ar71xx/base-files/etc/uci-defaults/leds

    r33308 r33447  
    5555        ;; 
    5656 
    57 dir-825-b1) 
     57dir-825-b1|\ 
     58dir-825-b1-towholeflash|\ 
     59dir-825-b1-wholeflash|\ 
     60dir-825-b1-tostock) 
    5861        ucidef_set_led_usbdev "usb" "USB" "d-link:blue:usb" "1-1" 
    5962        ;; 
  • trunk/target/linux/ar71xx/base-files/etc/uci-defaults/network

    r33349 r33447  
    3434 
    3535dir-825-b1|\ 
    36 dir-825-b1-openwrt|\ 
     36dir-825-b1-towholeflash|\ 
     37dir-825-b1-wholeflash|\ 
    3738dir-825-b1-tostock|\ 
    3839tew-673gru) 
  • trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh

    r33349 r33447  
    202202                name="dir-825-b1" 
    203203                ;; 
    204         *"DIR-825 rev. B1 OpenWrt") 
    205                 name="dir-825-b1-openwrt" 
     204        *"DIR-825 rev. B1 WHOLEFLASH") 
     205                name="dir-825-b1-wholeflash" 
     206                ;; 
     207        *"DIR-825 rev. B1 TOWHOLEFLASH") 
     208                name="dir-825-b1-towholeflash" 
    206209                ;; 
    207210        *"DIR-825 rev. B1 TOSTOCK") 
  • trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh

    r33326 r33447  
    102102        dir-615-e4 | \ 
    103103        dir-825-b1 | \ 
    104         dir-825-b1-openwrt | \ 
     104        dir-825-b1-towholeflash | \ 
     105        dir-825-b1-wholeflash | \ 
    105106        dir-825-b1-tostock | \ 
    106107        ew-dorin | \ 
  • trunk/target/linux/ar71xx/generic/profiles/d-link.mk

    r33326 r33447  
    6969define Profile/DIR825B1/Description 
    7070        Package set optimized for the D-Link DIR-825 rev. B1. 
     71        WARNING: Flashing wholeflash (openwrt optimized) image may brick your router 
     72        .  This will occur if your openwrt optimized image is larger than the 
     73        maximum size for a regular dir-825 b1 image (a little more than 6MB). 
     74        Please flash a TOWHOLEFLASH image instead of this image before flashing 
     75a  
     76        WHOLEFLASH image. 
     77endef 
     78 
     79$(eval $(call Profile,DIR825B1)) 
     80 
     81define Profile/DIR825B1_TOWHOLEFLASH 
     82        NAME:=D-Link DIR-825 rev. B1 designed for transition to image using whole flash 
     83        PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev 
     84endef 
     85 
     86define Profile/DIR825B1_TOWHOLEFLASH/Description 
     87        Package set optimized for the D-Link DIR-825 rev. B1. design for transtion to 
     88        image using whole flash. 
    7189        Copies the calibration data to the last erase block so that, if desired, 
    7290        an image optimized for use with OpenWrt (access to full flash) can be flashed. 
    7391endef 
    7492 
    75 $(eval $(call Profile,DIR825B1)) 
     93$(eval $(call Profile,DIR825B1_TOWHOLEFLASH)) 
    7694 
    77 define Profile/DIR825B1_OPENWRT 
    78         NAME:=D-Link DIR-825 rev. B1 optimized for OpenWrt 
     95define Profile/DIR825B1_WHOLEFLASH 
     96        NAME:=D-Link DIR-825 rev. B1 optimized for OpenWrt which uses full 8M flash 
    7997        PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev 
    8098endef 
    8199 
    82 define Profile/DIR825B1_OPENWRT/Description 
    83         Package set optimized for the D-Link DIR-825 rev. B1. running OpenWrt 
     100define Profile/DIR825B1_WHOLEFLASH/Description 
     101        Package set optimized for the D-Link DIR-825 rev. B1. using wholeflash 
    84102        Can only be flashed from OpenWrt because it requires that the calibration data 
    85103        be on the last sector of the flash (which the 'standard' version that can be flashed from 
     
    87105endef 
    88106 
    89 $(eval $(call Profile,DIR825B1_OPENWRT)) 
     107$(eval $(call Profile,DIR825B1_WHOLEFLASH)) 
    90108 
    91109define Profile/DIR825B1_TOSTOCK 
    92         NAME:=D-Link DIR-825 rev. B1 that undoes OpenWrt optimization 
     110        NAME:=D-Link DIR-825 rev. B1 that undoes OpenWrt optimization (i.e. wholeflash) 
    93111        PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev 
    94112endef 
  • trunk/target/linux/ar71xx/image/Makefile

    r33413 r33447  
    171171cameo933x_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k(nvram)ro,192k(language)ro,896k(kernel),2752k(rootfs),3648k@0x70000(firmware) 
    172172db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware) 
    173 dir825b1_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata)ro,1536k(unknown)ro,64k(owrt_caldata),6208k@0x50000(firmware) 
    174 dir825b1_openwrt_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),6784k(rootfs),64k(caldata)ro,7808k@0x50000(firmware) 
     173dir825b1_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata)ro,1600k(unknown)ro,6208k@0x50000(firmware) 
     174dir825b1_towholeflash_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata)ro,1536k(unknown)ro,64k(owrt_caldata),7808k@0x50000(firmware) 
     175dir825b1_wholeflash_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),6784k(rootfs),64k(caldata)ro,7808k@0x50000(firmware) 
    175176ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),1024k(kernel),2688k(rootfs),64k(art),3712k@0x50000(firmware) 
    176177dir825b1_tostock_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata),1536k(unknown)ro,64k(owrt_caldata)ro,6208k@0x50000(firmware) 
     
    221222endef 
    222223 
    223 define Image/Build/DIR825B1_OPENWRT 
    224         $(call MkuImageLzma,$(2),$(3) $(dir825b1_openwrt_mtdlayout)) 
     224define Image/Build/DIR825B1_TOWHOLEFLASH 
     225        $(call MkuImageLzma,$(2),$(3) $(dir825b1_towholeflash_mtdlayout)) 
     226        $(call Sysupgrade/KRuImage,$(1),$(2),1048576,5308416) 
     227        if [ -e "$(call sysupname,$(1),$(2))" ]; then \ 
     228                ( \ 
     229                        dd if=$(call sysupname,$(1),$(2)); \ 
     230                        echo -n "$(4)"; \ 
     231                ) > $(call imgname,$(1),$(2))-backup-loader.bin; \ 
     232                if [ `stat -c%s $(call sysupname,$(1),$(2))` -gt 4194304 ]; then \ 
     233                        echo "Warning: $(call sysupname,$(1),$(2)) is too big"; \ 
     234                else \ 
     235                        ( \ 
     236                                dd if=$(call sysupname,$(1),$(2)) bs=4096k conv=sync; \ 
     237                                echo -n "$(5)"; \ 
     238                        ) > $(call factoryname,$(1),$(2)); \ 
     239                fi; \ 
     240        fi 
     241endef 
     242 
     243define Image/Build/DIR825B1_WHOLEFLASH 
     244        $(call MkuImageLzma,$(2),$(3) $(dir825b1_wholeflash_mtdlayout)) 
    225245        $(call Sysupgrade/KRuImage,$(1),$(2),1048576,6946816) 
    226246endef 
     
    770790 
    771791$(eval $(call SingleProfile,DIR825B1,$(fs_64k),DIR825B1,dir-825-b1,DIR-825-B1,ttyS0,115200,01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00)) 
    772 $(eval $(call SingleProfile,DIR825B1_OPENWRT,$(fs_64k),DIR825B1_OPENWRT,dir-825-b1-openwrt,DIR-825-B1_OPENWRT,ttyS0,115200,01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00)) 
     792$(eval $(call SingleProfile,DIR825B1_TOWHOLEFLASH,$(fs_64k),DIR825B1_TOWHOLEFLASH,dir-825-b1-towholeflash,DIR-825-B1_TOWHOLEFLASH,ttyS0,115200,01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00)) 
     793$(eval $(call SingleProfile,DIR825B1_WHOLEFLASH,$(fs_64k),DIR825B1_WHOLEFLASH,dir-825-b1-wholeflash,DIR-825-B1_WHOLEFLASH,ttyS0,115200,01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00)) 
    773794$(eval $(call SingleProfile,DIR825B1_TOSTOCK,$(fs_64k),DIR825B1_TOSTOCK,dir-825-b1-tostock,DIR-825-B1_TOSTOCK,ttyS0,115200,01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00)) 
    774795$(eval $(call SingleProfile,DIR825B1,$(fs_64k),TEW673GRU,tew-637gru,TEW-673GRU,ttyS0,115200,01AP94-AR7161-RT-080619-01,00AP94-AR7161-RT-080619-01)) 
     
    862883 
    863884$(eval $(call MultiProfile,AP121,AP121_2M AP121_4M)) 
    864 $(eval $(call MultiProfile,DIR825B1_ALL,DIR825B1 DIR825B1_OPENWRT DIR825B1_TOSTOCK)) 
     885$(eval $(call MultiProfile,DIR825B1_ALL,DIR825B1 DIR825B1_TOWHOLEFLASH DIR825B1_WHOLEFLASH DIR825B1_TOSTOCK)) 
    865886$(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT)) 
    866887$(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY)) 
  • trunk/target/linux/ar71xx/patches-3.3/640-MIPS-ath79-dir-825-b1-for-owrt-board-def.patch

    r33326 r33447  
    55 #define DIR825B1_MAC_LOCATION_1                        0x1f66ffb4 
    66  
    7 +#define DIR825B1_OPENWRT_CAL_LOCATION_0                0x1f7f1000 
    8 +#define DIR825B1_OPENWRT_CAL_LOCATION_1                0x1f7f5000 
     7+#define DIR825B1_WHOLEFLASH_CAL_LOCATION_0             0x1f7f1000 
     8+#define DIR825B1_WHOLEFLASH_CAL_LOCATION_1             0x1f7f5000 
    99+ 
    10 +#define DIR825B1_OPENWRT_MAC_LOCATION_0                0x1f7fffa0 
    11 +#define DIR825B1_OPENWRT_MAC_LOCATION_1                0x1f7fffb4 
     10+#define DIR825B1_WHOLEFLASH_MAC_LOCATION_0             0x1f7fffa0 
     11+#define DIR825B1_WHOLEFLASH_MAC_LOCATION_1             0x1f7fffb4 
    1212+ 
    1313 static struct gpio_led dir825b1_leds_gpio[] __initdata = { 
     
    3131        ath79_register_mdio(0, 0x0); 
    3232  
    33 @@ -165,9 +171,27 @@ static void __init dir825b1_setup(void) 
     33@@ -165,9 +171,30 @@ static void __init dir825b1_setup(void) 
    3434        ap9x_pci_setup_wmac_led_pin(0, 5); 
    3535        ap9x_pci_setup_wmac_led_pin(1, 5); 
     
    4747+} 
    4848+ 
    49 +static void __init dir825b1_openwrt_setup(void) 
     49+static void __init dir825b1_wholeflash_setup(void) 
    5050+{ 
    51 +       dir825b1_common_setup(DIR825B1_OPENWRT_MAC_LOCATION_0, DIR825B1_OPENWRT_MAC_LOCATION_1, 
    52 +               DIR825B1_OPENWRT_CAL_LOCATION_0, DIR825B1_OPENWRT_CAL_LOCATION_1); 
     51+       dir825b1_common_setup(DIR825B1_WHOLEFLASH_MAC_LOCATION_0, DIR825B1_WHOLEFLASH_MAC_LOCATION_1, 
     52+               DIR825B1_WHOLEFLASH_CAL_LOCATION_0, DIR825B1_WHOLEFLASH_CAL_LOCATION_1); 
    5353 } 
    5454  
     
    5656             dir825b1_setup); 
    5757+ 
    58 +MIPS_MACHINE(ATH79_MACH_DIR_825_B1_OPENWRT, "DIR-825-B1_OPENWRT", "D-Link DIR-825 rev. B1 OpenWrt", 
    59 +            dir825b1_openwrt_setup); 
     58+MIPS_MACHINE(ATH79_MACH_DIR_825_B1_TOWHOLEFLASH, "DIR-825-B1_TOWHOLEFLASH", "D-Link DIR-825 rev. B1 TOWHOLEFLASH", 
     59+            dir825b1_setup); 
    6060+ 
    61 +MIPS_MACHINE(ATH79_MACH_DIR_825_B1_TOSTOCK, "DIR-825-B1_TOSTOCK", "D-Link DIR-825 rev. B1 TOSTOCK", dir825b1_openwrt_setup); 
     61+MIPS_MACHINE(ATH79_MACH_DIR_825_B1_WHOLEFLASH, "DIR-825-B1_WHOLEFLASH", "D-Link DIR-825 rev. B1 WHOLEFLASH", 
     62+            dir825b1_wholeflash_setup); 
     63+ 
     64+MIPS_MACHINE(ATH79_MACH_DIR_825_B1_TOSTOCK, "DIR-825-B1_TOSTOCK", "D-Link DIR-825 rev. B1 TOSTOCK", dir825b1_wholeflash_setup); 
    6265+ 
    6366--- a/arch/mips/ath79/machtypes.h 
    6467+++ b/arch/mips/ath79/machtypes.h 
    65 @@ -35,6 +35,8 @@ enum ath79_mach_type { 
     68@@ -35,6 +35,9 @@ enum ath79_mach_type { 
    6669        ATH79_MACH_DIR_615_C1,          /* D-Link DIR-615 rev. C1 */ 
    6770        ATH79_MACH_DIR_615_E4,          /* D-Link DIR-615 rev. E4 */ 
    6871        ATH79_MACH_DIR_825_B1,          /* D-Link DIR-825 rev. B1 */ 
    69 +       ATH79_MACH_DIR_825_B1_OPENWRT,  /* D-Link DIR-825 rev. B1 OpenWrt */ 
     72+       ATH79_MACH_DIR_825_B1_TOWHOLEFLASH, /* D-Link DIR-825 rev. B1 TOWHOLEFLASH */ 
     73+       ATH79_MACH_DIR_825_B1_WHOLEFLASH, /* D-Link DIR-825 rev. B1 WHOLEFLASH */ 
    7074+       ATH79_MACH_DIR_825_B1_TOSTOCK,  /* D-Link DIR-825 rev. B1 TOSTOCK */ 
    7175        ATH79_MACH_EW_DORIN,            /* embedded wireless Dorin Platform */ 
Note: See TracChangeset for help on using the changeset viewer.