From b1dfb3f7eb3c6ea58052a9ff0dcea8ae38fcfff1 Mon Sep 17 00:00:00 2001 From: florian Date: Tue, 9 Jun 2009 08:04:52 +0000 Subject: [brcm63xx] rework imagetag firmware generator and MTD partition parser to accomodate with all known imagetag versions from Broadcom and vendors, patch from Daniel Dickinson (fixes #4987). git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16393 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/brcm63xx/image/Makefile | 49 ++++++++---- target/linux/brcm63xx/image/README.images-bcm63xx | 91 +++++++++++++++++++++++ 2 files changed, 126 insertions(+), 14 deletions(-) create mode 100644 target/linux/brcm63xx/image/README.images-bcm63xx (limited to 'target/linux/brcm63xx/image') diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile index 7c4ed4644..9ba137df7 100644 --- a/target/linux/brcm63xx/image/Makefile +++ b/target/linux/brcm63xx/image/Makefile @@ -17,6 +17,8 @@ LOADER_MAKEOPTS= \ KERNEL_ENTRY=$(KERNEL_ENTRY) \ RAMSIZE=$(RAMSIZE) +SVN_REVISION=r$(shell svn info|grep Revision|cut -f1 -d\ ) + define trxalign/jffs2-128k -a 0x20000 endef @@ -30,8 +32,9 @@ endef define Image/Build/CFE # Generate the tagged image $(STAGING_DIR_HOST)/bin/imagetag -i $(KDIR)/vmlinux.lzma.cfe -f $(KDIR)/root.$(1) \ - -o $(BIN_DIR)/openwrt-$(2)-$(1)-cfe.bin \ - -b $(2) -c $(3) -e $(LOADADDR) -l $(LOADADDR) + -o $(BIN_DIR)/openwrt-$(2)-$(1)-$(6)-cfe.bin \ + -b $(2) -c $(3) -e $(LOADADDR) -l $(LOADADDR) \ + -t $(4) -d "$(5)" # -b $(2) -c $(3) -e $(KERNEL_ENTRY) -l $(LOADADDR) endef @@ -39,9 +42,9 @@ endef define Image/Build/CFEAGPF # Generate the tagged image $(STAGING_DIR_HOST)/bin/imagetag -i $(KDIR)/vmlinux.lzma.cfe -f $(KDIR)/root.$(1) \ - -o $(BIN_DIR)/openwrt-$(2)-$(1)-cfe.bin \ + -o $(BIN_DIR)/openwrt-$(2)-$(1)-$(7)-cfe.bin \ -b $(2) -c $(3) -e $(LOADADDR) -l $(LOADADDR) \ - -v 8 -m IMAGE -k 0x20000 -n $(4) -p alice + -v 8 -m IMAGE -k 0x20000 -n $(4) -t $(5) endef define Image/Build/RedBoot @@ -95,24 +98,42 @@ endef define Image/Build $(STAGING_DIR_HOST)/bin/trx -o $(BIN_DIR)/openwrt-$(BOARD)-$(1).trx -f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma $(call trxalign/$(1)) -f $(KDIR)/root.$(1) dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-root.$(1) bs=128k conv=sync - $(call Image/Build/CFE,$(1),96345GW2,6345) - $(call Image/Build/CFE,$(1),96348GW,6348) + # Various routers + $(call Image/Build/CFE,$(1),96345GW2,6345,bccfe,,bccfe) + $(call Image/Build/CFE,$(1),96345GW2,6345,bc300,,bc300) + $(call Image/Build/CFE,$(1),96345GW2,6345,bc310,OpenWRT-$(SVN_REVISION),bc310) + $(call Image/Build/CFE,$(1),96348GW,6348,bccfe,,bcfe) + # BT Voyager V2500V + $(call Image/Build/CFE,$(1),V2500V_BB,6348,bc308,,btvgr) + # Tecom GW6000 + $(call Image/Build/CFE,$(1),96348GW,6348,bc300,,bc300) + # Tecom GW6200 + $(call Image/Build/CFE,$(1),96348GW,6348,bc310,$(shell printf '\x99'),gw6200) # Neufbox4 - $(call Image/Build/CFE,$(1),96358VW,6358) - # Comtrend 536 - $(call Image/Build/CFE,$(1),96348GW-11,6348) + $(call Image/Build/CFE,$(1),96358VW,6358,bccfe,,bccfe) + $(call Image/Build/CFE,$(1),96358VW,6358,bc310,OpenWRT-$(SVN_REVISION),nb4) + # Comtrend 536, 5621 + $(call Image/Build/CFE,$(1),96348GW-11,6348,bccfe,,bccfe) + $(call Image/Build/CFE,$(1),96348GW-11,6348,bc300,,bc300) # Davolink DV201AMR $(call Image/Build/CFEOLD,$(1),DV201AMR,6348) # USR 9108 - $(call Image/Build/CFE,$(1),96348GW-A,6348) - # DG834GT - $(call Image/Build/CFE,$(1),96348GW-10,6348) + $(call Image/Build/CFE,$(1),96348GW-A,6348,bccfe,,bccfe) + $(call Image/Build/CFE,$(1),96348GW-A,6348,bc300,,bc300) + $(call Image/Build/CFE,$(1),96348GW-A,6348,bc310,OpenWRT-$(SVN_REVISION),bc310) + # NetGear DG834GT + $(call Image/Build/CFE,$(1),96348GW-10,6348,bccfe,,bccfe) + $(call Image/Build/CFE,$(1),96348GW-10,6348,bc300,,bc300) + # Sagem F@ST2404 - $(call Image/Build/CFE,$(1),F@ST2404,6348) + $(call Image/Build/CFE,$(1),F@ST2404,6348,bccfe,,bccfe) + $(call Image/Build/CFE,$(1),F@ST2404,6348,bc300,,bc300) + $(call Image/Build/CFE,$(1),F@ST2404,6348,bc310,OpenWRT-$(SVN_REVISION),bc310) # Inventel Livebox $(call Image/Build/RedBoot,livebox) # Pirelli Alice Gate VoIP 2 Plus Wi-Fi AGPF-S0 - $(call Image/Build/CFEAGPF,$(1),AGPF-S0,6358,0x20000) + $(call Image/Build/CFEAGPF,$(1),AGPF-S0,6358,0x20000,bccfe,,bccfe) + $(call Image/Build/CFEAGPF,$(1),AGPF-S0,6358,0x20000,ag306,,agv2+w) endef $(eval $(call BuildImage)) diff --git a/target/linux/brcm63xx/image/README.images-bcm63xx b/target/linux/brcm63xx/image/README.images-bcm63xx new file mode 100644 index 000000000..574d1bdc0 --- /dev/null +++ b/target/linux/brcm63xx/image/README.images-bcm63xx @@ -0,0 +1,91 @@ +The image neede to flash onto a Broadcom 63xx-series board depends on the +board, method you are using to flash, and, for web-based flash, on the version +of the Broadcom code your router uses. + +There are two major revisions of the Broadcom code as far as imagetags are +concerned, before 3.08 and after 3.08, however there are some variations +within in that, either due to vendor differences or due to changes at +Broadcom (it's not clear yet which is the case). In addtion Pirelli modified +the Broadcom code, so Alice Gate models use a different imagetag than any +other vendor. + +The imagetag format for flashing via CFE is the same for almost all the +boards, and is the same for all images generated by the imagetag utility. +Images flashable using cfe are labelled openwrt---cfe.bin + +The imagetags for tftp/ftp flashing is based on Broadcom 3.00-3.04 imagetags +and is known to be correct as the source code GPL and is available for reading. + +Broadcom 3.00-3.02 flashing has been tested on Comtrend CT-5261, CT-536 and +Tecom GW6000, and is the version of the flashing that was present before the +imagetags were split by broadcom code version (early June 2009) + +3.04 is guessed to be the same as 3.00-3.02 based on available information + +Broadom 3.06 is thought to be the same as 3.00-3.02, however the only 3.06 +this author (Daniel Dickinson) has seen is the Alice Gate (Pirelli) firmware +which is known to be different due to vendor (Pirelli) modifications to the +Broadcom code. + +Broadcom 3.08 introduced changes to the imagetag to deal with TR69 (a remote +router management system developed by the DSL Forum). The version we are +using as 3.08 is based on the BT Voyager firmware image I looked at. It may +in fact be BT Voyager-specific, and may in fact not be 3.08, but modified 3.06 +and not apply to all 3.08 versions. + +Broadcom 3.10 uses an imagetag that is believed to apply to all 3.10 and 3.12 +versions, and has been tested on the Tecom GW6200. It is similar to 3.08. +There is a field for vendor-specific information, that at least in some cases +is not optional. It is based on the hexedit of a neufbox4 firmware image, the +information in https://dev.openwrt.org/ticket/4987, and the hexedit of a Tecom +GW6200 image. + +Some boards share the same tag format, but require vendor-specific fields in +the board. In that case the tagid is shared, but the filename of the generated +image reflects the router for which the image was created. + +router |method| codever |tagid |filename ++----------+------+---------+------+------------------------------------------- +|any |cfe | any |bccfe |openwrt---bccfe-cfe.bin +|any |t/ftp | any |bc300 |openwrt---bc300-cfe.bin +| |web |3.00-3.06|bc300 |openwrt---bc300-cfe.bin +| |web |3.08 |bc308 |openwrt---bc308-cfe.bin +| |web |3.10-3.12|bc310 |openwrt---bc310-cfe.bin +|CT536 |web |3.02 |bc300 |openwrt---bc300-cfe.bin +|CT5621 |web |3.02 |bc300 |openwrt---bc300-cfe.bin +|GW6000 |web |3.00 |bc300 |openwrt---bc300-cfe.bin +|USR9108? |web |? |bc300 |openwrt---bc300-cfe.bin +|USR9108? |web |? |bc310 |openwrt---bc310-cfe.bin +|DG834GT |web |3.02 |bc300 |openwrt---bc300-cfe.bin +|V2500V |web |3.08 |bc308 |openwrt---btvgr-cfe.bin +|GW6200 |web |3.10 |bc310 |openwrt---gw6200-cfe.bin +|Neufbox4 |web |3.12 |bc310 |openwrt---nb4-cfe.bin +|F@ST2404 |web |? |bc300 |openwrt---bc300-cfe.bin +|F@ST2404 |web |? |bc310 |openwrt---bc310-cfe.bin +|AGVoIP2+Wi|web |alice3.06|ag306 |openwrt---agv2+w-cfe.bin + +Old imagetag routers +-------------------- +Davolink DV201AMR + +Redboot routers +--------------- +Inventel Livebox + +Known router->code versions +--------------------------- + +Vendor |Model |Code Ver +---------------------------+------------------------------------------+-------- +Comtrend |CT-5261 |3.02 +Comtrend |CT-536 |3.02 +Tecom |GW6000 |3.00 +Tecom |GW6200 |3.10 +Pirelli |Alice Gate Wi-Fi (+VoIP models?) |ag 3.06 +? |TD-88xx |3.06 +BT |Voyager V2500V |3.08 (?) +Belkin |F5D7633 |3.10 +Neuf ? |Neufbox 4 |3.12 +NetGear |DG834GT |3.02 +Sagem |F@ST2404 |? +USR |9108 |? -- cgit v1.2.3