Changeset 30532


Ignore:
Timestamp:
2012-02-14T18:48:04+01:00 (4 years ago)
Author:
blogic
Message:

[lantiq] Support booting the Speedport W502V using BRN-BOOT.

While the disadvantage is less available flash space, it's easy and
safe to flash without opening the device.
Going back to the original firmware is also possible.

This patch add two firmware utilities, mkbrncmdline and mkbrnboot.

mkbrncmdline patches the uncompressed kernel so the registeres a0 to
a3 are initialized and the memory size is passed in.

mkbrnboot takes the lzma compressed kernel and squashfs images and
creates a firmware image that can be flashed using the BRN-BOOT
recovery kernel, which is booted by holding both buttons when
powering up the device and will listen on http://192.168.2.1.

The firmware file from bin/lantiq/ to use is
openwrt-lantiq-danube-ARV4525PW-BRNDTW502-brnImage

The BRN-BOOT recovery kernel does size-check the image, so if it's
too big to fit into flash it will complain accordingly.

A second patch is needed to make the wired network interface work
since there is no u-boot to pre-initialise it.

Signed-off-by: Tobias Diedrich <ranma+openwrt@…>

Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/lantiq/files-3.1/arch/mips/lantiq/xway/mach-arv45xx.c

    r29292 r30532  
    7979}; 
    8080 
     81static struct mtd_partition arv45xx_brnboot_partitions[] = 
     82{ 
     83        { 
     84                .name   = "brn-boot", 
     85                .offset = 0x0, 
     86                .size   = 0x20000, 
     87        }, 
     88        { 
     89                .name   = "config", 
     90                .offset = 0x20000, 
     91                .size   = 0x30000, 
     92        }, 
     93        { 
     94                .name   = "linux", 
     95                .offset = 0x50000, 
     96                .size   = 0x390000, 
     97        }, 
     98        { 
     99                .name   = "reserved", /* 12-byte signature at 0x3efff4 :/ */ 
     100                .offset = 0x3e0000, 
     101                .size   = 0x010000, 
     102        }, 
     103        { 
     104                .name   = "eeprom", 
     105                .offset = 0x3f0000, 
     106                .size   = 0x10000, 
     107        }, 
     108}; 
     109 
    81110static struct mtd_partition arv7525_partitions[] = 
    82111{ 
     
    135164        .nr_parts       = ARRAY_SIZE(arv45xx_partitions), 
    136165        .parts          = arv45xx_partitions, 
     166}; 
     167 
     168static struct physmap_flash_data arv45xx_brnboot_flash_data = { 
     169        .nr_parts       = ARRAY_SIZE(arv45xx_brnboot_partitions), 
     170        .parts          = arv45xx_brnboot_partitions, 
    137171}; 
    138172 
     
    245279static struct gpio_led 
    246280arv4525pw_gpio_leds[] __initdata = { 
    247         { .name = "soc:green:fxs1", .gpio = 4, .active_low = 1, .default_trigger = "default-on" }, 
    248         { .name = "soc:green:fxs2", .gpio = 5, .active_low = 1, .default_trigger = "default-on" }, 
    249         { .name = "soc:red:dsl", .gpio = 6, .active_low = 1, .default_trigger = "default-on" }, 
     281        { .name = "soc:green:dsl", .gpio = 6, .active_low = 1, .default_trigger = "default-on" }, 
    250282        { .name = "soc:green:wifi", .gpio = 8, .active_low = 1, .default_trigger = "default-on" }, 
    251283        { .name = "soc:green:online", .gpio = 9, .active_low = 1, .default_trigger = "default-on" }, 
    252 }; 
     284        { .name = "soc:green:fxs-internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" }, 
     285        { .name = "soc:green:fxs-festnetz", .gpio = 4, .active_low = 1, .default_trigger = "default-on" }, 
     286}; 
     287 
     288#define ARV4525PW_PHYRESET 13 
     289#define ARV4525PW_RELAY    31 
     290 
     291static struct gpio arv4525pw_gpios[] __initdata = { 
     292        { ARV4525PW_PHYRESET, GPIOF_OUT_INIT_HIGH, "phyreset" }, 
     293        { ARV4525PW_RELAY,    GPIOF_OUT_INIT_HIGH, "relay"    }, 
     294}; 
     295 
    253296 
    254297static struct gpio_led 
     
    522565                        arv452Cpw_init); 
    523566 
    524  
    525567static void __init 
    526568arv4525pw_init(void) 
    527569{ 
    528 #define ARV4525PW_MADWIFI_ADDR          0xb07f0400 
     570#define ARV4525PW_MADWIFI_ADDR          0xb03f0400 
     571        if (ltq_brn_boot) 
     572                ltq_register_nor(&arv45xx_brnboot_flash_data); 
     573        else 
     574                ltq_register_nor(&arv45xx_flash_data); 
     575 
    529576        ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4525pw_gpio_leds), arv4525pw_gpio_leds); 
    530         ltq_register_nor(&arv45xx_flash_data); 
     577        gpio_request_array(arv4525pw_gpios, ARRAY_SIZE(arv4525pw_gpios)); 
     578        gpio_export(ARV4525PW_RELAY, false); 
     579        gpio_export(ARV4525PW_PHYRESET, false); 
    531580        ltq_pci_data.clock = PCI_CLOCK_INT; 
    532581        ltq_register_pci(&ltq_pci_data); 
    533582        ltq_register_madwifi_eep(ARV4525PW_MADWIFI_ADDR); 
     583        arv45xx_register_ath5k(); 
     584        ltq_register_ath5k(arv45xx_ath5k_eeprom_data, arv45xx_ath5k_eeprom_mac); 
    534585        ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_MII; 
    535586        arv45xx_register_ethernet(); 
  • trunk/target/linux/lantiq/image/Makefile

    r27694 r30532  
    2424endef 
    2525 
     26define MkBrnImage 
     27        mkbrncmdline -i $(KDIR)/vmlinux-$(4) -o $(KDIR)/vmlinux-$(4)-brn BRN-BOOT $(6) 
     28        $(call CompressLzma,$(KDIR)/vmlinux-$(4)-brn,$(KDIR)/vmlinux-$(4)-brn.lzma) 
     29        mkbrnimg -s $(1) -m $(2) -o $(3) $(KDIR)/vmlinux-$(4)-brn.lzma $(KDIR)/root.$(5) 
     30endef 
     31 
    2632define MkImageLzma 
    2733        mkimage -A mips -O linux -T kernel -a 0x80002000 -C lzma \ 
     
    3339        cat $(KDIR)/uImage-$(2) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image 
    3440        $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image) 
     41        $(if $(3),$(call MkBrnImage,$(3),$(4),$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(3)-brnImage,$(2),$(1),$(5))) 
    3542endef 
    3643 
     
    110117 
    111118define Image/Build/Profile/ARV4525PW 
    112         $(call Image/Build/$(1),$(1),ARV4525PW) 
     119        $(call Image/Build/$(1),$(1),ARV4525PW,BRNDTW502,0x12345678,memsize=32) 
    113120endef 
    114121 
  • trunk/tools/firmware-utils/Makefile

    r29754 r30532  
    5656        $(call cc,mkwrgimg md5, -Wall) 
    5757        $(call cc,mkedimaximg) 
     58        $(call cc,mkbrncmdline) 
     59        $(call cc,mkbrnimg) 
    5860endef 
    5961 
Note: See TracChangeset for help on using the changeset viewer.