ar71xx: improve WD's My Net Wi-fi Range Extender image creation
authorJohn Crispin <john@openwrt.org>
Wed, 11 Mar 2015 15:56:34 +0000 (15:56 +0000)
committerJohn Crispin <john@openwrt.org>
Wed, 11 Mar 2015 15:56:34 +0000 (15:56 +0000)
Previously, the generated images for the My Net Wi-fi Range Extender
wouldn't always work (and panic) due to the fixed mtd offsets and
sizes for the kernel and rootfs. This patch fixes the problem by
utilizing the shared Cybertan's partition parser to recalculate
the mtd partitions for every image dynamically everytime.

Reported-by: Pascal Paradis <peparadis@yahoo.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
SVN-Revision: 44665

target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-rext.c
target/linux/ar71xx/image/Makefile

index a3deed5baf598f24d4117e004796585287569b30..02d168ef4b0c2c49e7965de5851a00daf23a1d12 100644 (file)
 
 #define MYNET_REXT_ART_ADDR            0x1f7f0000
 
+static const char *mynet_rext_part_probes[] = {
+       "cybertan",
+       NULL,
+};
+
+static struct flash_platform_data mynet_rext_flash_data = {
+       .type           = "s25fl064k",
+       .part_probes    = mynet_rext_part_probes,
+};
+
 static struct gpio_led mynet_rext_leds_gpio[] __initdata = {
        {
                .name           = "wd:blue:power",
@@ -130,7 +140,7 @@ static void __init mynet_rext_setup(void)
        u8 *art = (u8 *) KSEG1ADDR(MYNET_REXT_ART_ADDR);
        u8 tmpmac[ETH_ALEN];
 
-       ath79_register_m25p80(NULL);
+       ath79_register_m25p80(&mynet_rext_flash_data);
 
        /* GPIO configuration from drivers/char/GPIO8.c */
 
index b4b75a10346a07506912959834d1321d338c75f6..204a6e7ec2f359735d0fa7dc1901667e94cf8eb8 100644 (file)
@@ -407,7 +407,7 @@ r6100_mtdlayout=mtdparts=ar934x-nfc:128k(u-boot)ro,256k(caldata),256k(caldata-ba
 wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata),512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),23552k(ubi),25600k@0x6c0000(firmware),256k(caldata_backup),-(reserved)
 zcn1523h_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6208k(rootfs),1472k(kernel),64k(configure)ro,64k(mfg)ro,64k(art)ro,7680k@0x50000(firmware)
 mynet_n600_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro
-mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro,6848k@0x130000(filesystem)
+mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro
 zyx_nbg6716_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(env)ro,64k(RFdata)ro,-(nbu);ar934x-nfc:2048k(zyxel_rfsd),2048k(romd),1024k(header),2048k(kernel),-(ubi)
 qihoo_c301_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(devdata),64k(devconf),15744k(firmware),64k(warm_start),64k(action_image_config),64k(radiocfg)ro;spi0.1:15360k(upgrade2),1024k(privatedata)
 
@@ -1301,7 +1301,7 @@ $(eval $(call SingleProfile,CameoDB120_8M,64kraw,TEW732BR,tew-732br,TEW-732BR,tt
 
 $(eval $(call SingleProfile,CyberTANGZIP,64k,WRT160NL,wrt160nl,WRT160NL,ttyS0,115200,,1.00.01))
 
-$(eval $(call SingleProfile,CyberTANLZMA,64k,MYNETREXT,mynet-rext,MYNET-REXT,ttyS0,115200,$$(mynet_rext_mtdlayout) root=31:4,1.00.01))
+$(eval $(call SingleProfile,CyberTANLZMA,64k,MYNETREXT,mynet-rext,MYNET-REXT,ttyS0,115200,$$(mynet_rext_mtdlayout) root=31:2,1.00.01))
 
 $(eval $(call SingleProfile,CameoAP94,64kraw,DIR825B1,dir-825-b1,DIR-825-B1,ttyS0,115200,$$(cameo_ap94_mtdlayout),$$(cameo_ap94_mtdlayout_fat),01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
 $(eval $(call SingleProfile,CameoAP94,64kraw,TEW673GRU,tew-673gru,TEW-673GRU,ttyS0,115200,$$(cameo_ap94_mtdlayout),$$(cameo_ap94_mtdlayout_fat),01AP94-AR7161-RT-080619-01,00AP94-AR7161-RT-080619-01))