diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2010-12-02 21:27:54 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2010-12-02 21:27:54 +0000 |
commit | 41b3383499e1ba10c49d77dd0526f1a045128f97 (patch) | |
tree | 660b1ad6a7d8aadc9ac67e3b15dcfde56c0725cc /target/linux/brcm47xx/image | |
parent | 4482f4b5f127fbccfc9771d68617bffd47b49a27 (diff) | |
download | mtk-20170518-41b3383499e1ba10c49d77dd0526f1a045128f97.zip mtk-20170518-41b3383499e1ba10c49d77dd0526f1a045128f97.tar.gz mtk-20170518-41b3383499e1ba10c49d77dd0526f1a045128f97.tar.bz2 |
brcm47xx: Add edimax PS1208mfg support
Thank you clemvangelis for the patches. (closes #7672)
SVN-Revision: 24217
Diffstat (limited to 'target/linux/brcm47xx/image')
-rw-r--r-- | target/linux/brcm47xx/image/Makefile | 5 | ||||
-rw-r--r-- | target/linux/brcm47xx/image/lzma-loader/src/decompress.c | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/target/linux/brcm47xx/image/Makefile b/target/linux/brcm47xx/image/Makefile index f8c09b9..034200c 100644 --- a/target/linux/brcm47xx/image/Makefile +++ b/target/linux/brcm47xx/image/Makefile @@ -49,6 +49,10 @@ define Image/Build/USR $(STAGING_DIR_HOST)/bin/trx2usr $(BIN_DIR)/$(IMG_PREFIX)-$(1).trx $(BIN_DIR)/openwrt-$(2)-$(3).bin endef +define Image/Build/Edi + $(STAGING_DIR_HOST)/bin/trx2edips $(BIN_DIR)/$(IMG_PREFIX)-$(1).trx $(BIN_DIR)/openwrt-$(2)-$(3).bin +endef + define trxalign/jffs2-128k -a 0x20000 -f $(KDIR)/root.$(1) endef @@ -87,6 +91,7 @@ define Image/Build/jffs2-64k $(call Image/Build/CyberTAN,$(1),wrt350n_v1,EWCG,1.04.1,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/Motorola,$(1),wa840g,2,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/Motorola,$(1),we800g,3,$(patsubst jffs2-%,jffs2,$(1))) + $(call Image/Build/Edi,$(1),ps1208mfg,$(patsubst jffs2-%,jffs2,$(1))) endef define Image/Build/squashfs diff --git a/target/linux/brcm47xx/image/lzma-loader/src/decompress.c b/target/linux/brcm47xx/image/lzma-loader/src/decompress.c index ce2876a..05681b1 100644 --- a/target/linux/brcm47xx/image/lzma-loader/src/decompress.c +++ b/target/linux/brcm47xx/image/lzma-loader/src/decompress.c @@ -87,6 +87,9 @@ struct trx_header { unsigned int offsets[3]; /* Offsets of partitions from start of header */ }; +#define EDIMAX_PS_HEADER_MAGIC 0x36315350 /* "PS16" */ +#define EDIMAX_PS_HEADER_LEN 0xc /* 12 bytes long for edimax header */ + /* beyound the image end, size not known in advance */ extern unsigned char workspace[]; @@ -135,8 +138,12 @@ void entry(unsigned long icache_size, unsigned long icache_lsize, /* look for trx header, 32-bit data access */ for (data = ((unsigned char *) KSEG1ADDR(BCM4710_FLASH)); - ((struct trx_header *)data)->magic != TRX_MAGIC; data += 65536); + ((struct trx_header *)data)->magic != TRX_MAGIC && + ((struct trx_header *)data)->magic != EDIMAX_PS_HEADER_MAGIC; + data += 65536); + if (((struct trx_header *)data)->magic == EDIMAX_PS_HEADER_MAGIC) + data += EDIMAX_PS_HEADER_LEN; /* compressed kernel is in the partition 0 or 1 */ if (((struct trx_header *)data)->offsets[1] > 65536) data += ((struct trx_header *)data)->offsets[0]; |