X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/08944ed54ad4ea46d66e2fba2f9c032c074f8eee..93a0a2c28863ff520d4c4603f6262de8804606ab:/target/linux/brcm47xx/image/lzma-loader/src/decompress.c diff --git a/target/linux/brcm47xx/image/lzma-loader/src/decompress.c b/target/linux/brcm47xx/image/lzma-loader/src/decompress.c index ce2876a30..05681b152 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];