summaryrefslogtreecommitdiffstats
path: root/target/linux/adm5120
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-10-26 07:51:49 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-10-26 07:51:49 +0000
commit943472dc74b5ae3390f80e0960a1503ddc82d9b7 (patch)
tree748f9c92a8296c63f95e057081fa17620b7cd743 /target/linux/adm5120
parentb8bd973764aef108dc049807b32ed61ccf5694bc (diff)
[adm5120] reduce wasted flash space by ~56K on Edimax devices, thanks to Bernhard Held (closes: #2549)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@9450 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/adm5120')
-rw-r--r--target/linux/adm5120/files/drivers/mtd/trxsplit.c9
-rw-r--r--target/linux/adm5120/image/router_le.mk5
2 files changed, 5 insertions, 9 deletions
diff --git a/target/linux/adm5120/files/drivers/mtd/trxsplit.c b/target/linux/adm5120/files/drivers/mtd/trxsplit.c
index 19d1e9da9..748ad86d2 100644
--- a/target/linux/adm5120/files/drivers/mtd/trxsplit.c
+++ b/target/linux/adm5120/files/drivers/mtd/trxsplit.c
@@ -51,7 +51,7 @@ struct trx_header {
u32 offsets[TRX_MAX_OFFSET]; /* Offsets of partitions */
};
-#define BLOCK_LEN_MIN 0x10000
+#define TRX_ALIGN 0x1000
static int trx_nr_parts;
static unsigned long trx_offset;
@@ -104,17 +104,12 @@ err_out:
static void trxsplit_findtrx(struct mtd_info *mtd)
{
unsigned long offset;
- unsigned long blocklen;
int err;
- blocklen = mtd->erasesize;
- if (blocklen < BLOCK_LEN_MIN)
- blocklen = BLOCK_LEN_MIN;
-
printk(KERN_INFO PFX "searching TRX header in '%s'\n", mtd->name);
err = 0;
- for (offset = 0; offset < mtd->size; offset += blocklen) {
+ for (offset = 0; offset < mtd->size; offset += TRX_ALIGN) {
err = trxsplit_checktrx(mtd, offset);
if (err == 0)
break;
diff --git a/target/linux/adm5120/image/router_le.mk b/target/linux/adm5120/image/router_le.mk
index ec7673f6e..0fc630940 100644
--- a/target/linux/adm5120/image/router_le.mk
+++ b/target/linux/adm5120/image/router_le.mk
@@ -14,13 +14,14 @@ define Image/Build/Edimax
$(call Image/Build/Loader,$(2),gz,0x80500000,0x6D8,y,$(2))
$(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1))
$(STAGING_DIR_HOST)/bin/mkcsysimg -B $(2) -d -w \
- -r $(KDIR)/loader-$(2).gz \
+ -r $(KDIR)/loader-$(2).gz::8192 \
-x $(call imgname,$(1),$(2)).trx \
$(call imgname,$(1),$(2))-webui.bin
$(STAGING_DIR_HOST)/bin/mkcsysimg -B $(2) -d \
- -r $(KDIR)/loader-$(2).gz \
+ -r $(KDIR)/loader-$(2).gz::8192 \
-x $(call imgname,$(1),$(2)).trx \
$(call imgname,$(1),$(2))-xmodem.bin
+ rm -f $(call imgname,$(1),$(2)).trx
endef
define Image/Build/Infineon