Changeset 45672


Ignore:
Timestamp:
2015-05-11T11:08:33+02:00 (3 years ago)
Author:
nbd
Message:

ar71xx: convert tl-wr741nd v1/v2 to new image building code, add infrastructure for building the loader

Signed-off-by: Felix Fietkau <nbd@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/image/Makefile

    r45646 r45672  
    1414KERNEL_LOADADDR = 0x80060000 
    1515 
    16 DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD NETGEAR_ID CMDLINE CONSOLE IMAGE_SIZE 
     16DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD NETGEAR_ID CMDLINE CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS 
    1717 
    1818define Build/netgear-squashfs 
     
    7373endef 
    7474 
     75define Build/loader-common 
     76        rm -rf $@.src 
     77        $(MAKE) -C lzma-loader \ 
     78                PKG_BUILD_DIR="$@.src" \ 
     79                TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \ 
     80                KERNEL_CMDLINE="$(CMDLINE)" BOARD="$(BOARDNAME)" \ 
     81                LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \ 
     82                $(1) compile loader.gz 
     83        mv "$@.gz" "$@" 
     84        rm -rf $@.src 
     85endef 
     86 
     87define Build/loader-okli-compile 
     88        $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0) 
     89endef 
     90 
     91define Build/loader-kernel 
     92        $(call Build/loader-common,LOADER_DATA="$@") 
     93endef 
     94 
     95define Build/loader-okli 
     96        dd if=$(KDIR)/loader-$(1).gz bs=7680 conv=sync of="$@.new" 
     97        cat "$@" >> "$@.new" 
     98        mv "$@.new" "$@" 
     99endef 
     100 
     101define Build/copy-file 
     102        cat "$(1)" > "$@" 
     103endef 
     104 
    75105DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT 
    76106 
     
    86116  CMDLINE = $$(if $$(BOARDNAME),board=$$(BOARDNAME)) $$(if $$(MTDPARTS),mtdparts=$$(MTDPARTS)) $$(if $$(CONSOLE),console=$$(CONSOLE)) 
    87117  KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma 
     118  COMPILE := 
    88119  IMAGES := sysupgrade.bin 
    89120  IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) 
     
    154185endef 
    155186 
     187define Device/tplink-nolzma 
     188$(Device/tplink) 
     189  LOADER_FLASH_OFFS := 0x22000 
     190  COMPILE := loader-$(1).gz 
     191  COMPILE/loader-$(1).gz := loader-okli-compile 
     192  KERNEL := copy-file $(KDIR)/vmlinux.bin.lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 
     193  KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux-initramfs.bin.lzma | loader-kernel | mktplinkfw-initramfs 
     194endef 
     195 
     196define Device/tplink-4m 
     197$(Device/tplink-nolzma) 
     198  TPLINK_FLASHLAYOUT := 4M 
     199  IMAGE_SIZE := 3904k 
     200endef 
     201 
     202define Device/tplink-8m 
     203$(Device/tplink-nolzma) 
     204  TPLINK_FLASHLAYOUT := 8M 
     205  IMAGE_SIZE := 7936k 
     206endef 
     207 
    156208define Device/tplink-4mlzma 
    157209$(Device/tplink) 
     
    392444endef 
    393445 
     446define Device/tl-wr741nd-v1 
     447    $(Device/tplink-4m) 
     448    BOARDNAME := TL-WR741ND 
     449    DEVICE_PROFILE := TLWR741 
     450    TPLINK_HWID := 0x07410001 
     451endef 
     452 
     453define Device/tl-wr741nd-v2 
     454    $(Device/tplink-4m) 
     455    BOARDNAME := TL-WR741ND 
     456    DEVICE_PROFILE := TLWR741 
     457    TPLINK_HWID := 0x07410001 
     458endef 
     459 
    394460define Device/tl-wr741nd-v4 
    395461    $(Device/tplink-4mlzma) 
     
    407473    CONSOLE := ttyATH0,115200 
    408474endef 
    409 TARGET_DEVICES += tl-wr740n-v4 tl-wr741nd-v4 tl-wr743nd-v2 
     475TARGET_DEVICES += tl-wr740n-v4 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2 
    410476 
    411477define Device/tl-wr841n-v8 
     
    18101876$(eval $(call SingleProfile,TPLINK,64kraw,TLWR740NV1,tl-wr740n-v1,TL-WR741ND,ttyS0,115200,0x07400001,1,4M)) 
    18111877$(eval $(call SingleProfile,TPLINK,64kraw,TLWR740NV3,tl-wr740n-v3,TL-WR741ND,ttyS0,115200,0x07400003,1,4M)) 
    1812 $(eval $(call SingleProfile,TPLINK,64kraw,TLWR741NV1,tl-wr741nd-v1,TL-WR741ND,ttyS0,115200,0x07410001,1,4M)) 
    1813 $(eval $(call SingleProfile,TPLINK,64kraw,TLWR741NV2,tl-wr741nd-v2,TL-WR741ND,ttyS0,115200,0x07410001,1,4M)) 
    18141878$(eval $(call SingleProfile,TPLINK,64kraw,TLWR743NV1,tl-wr743nd-v1,TL-WR741ND,ttyS0,115200,0x07430001,1,4M)) 
    18151879$(eval $(call SingleProfile,TPLINK,64kraw,TLWR841NV3,tl-wr841nd-v3,TL-WR941ND,ttyS0,115200,0x08410003,3,4M)) 
Note: See TracChangeset for help on using the changeset viewer.