Changeset 30703


Ignore:
Timestamp:
2012-02-23T20:58:12+01:00 (5 years ago)
Author:
juhosg
Message:

ramips: image: introduce mkmtd/{,phys,spi} helpers

File:
1 edited

Legend:

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

    r30702 r30703  
    7272define Sysupgrade/KRuImage 
    7373        $(call CatFiles,$(KDIR)/vmlinux-$(2).uImage,$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(2))) 
     74endef 
     75 
     76define mkmtd 
     77mtdparts=$(1):$(2) 
     78endef 
     79 
     80define mkmtd/phys 
     81$(call mkmtd,physmap-flash.0,$(1)) 
     82endef 
     83 
     84define mkmtd/spi 
     85$(call mkmtd,spi0.0,$(1)) 
    7486endef 
    7587 
     
    165177endef 
    166178 
    167 mtdlayout_4M=mtdparts=physmap-flash.0:192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,832k(kernel),2944k(rootfs),3776k@0x50000(firmware) 
     179mtdlayout_4M=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,832k(kernel),2944k(rootfs),3776k@0x50000(firmware) 
    168180define Image/Build/Template/GENERIC_4M 
    169         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(mtdlayout_4M),851968,3014656) 
     181        $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_4M)),851968,3014656) 
    170182endef 
    171183 
    172184define Image/Build/Template/GENERIC_4M/initramfs 
    173         $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(mtdlayout_4M)) 
    174 endef 
    175  
    176 mtdlayout_8M=mtdparts=physmap-flash.0:192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),6976k(rootfs),7872k@0x50000(firmware) 
     185        $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_4M))) 
     186endef 
     187 
     188mtdlayout_8M=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),6976k(rootfs),7872k@0x50000(firmware) 
    177189kernel_size_8M=917504 
    178190rootfs_size_8M=7143424 
    179191define Image/Build/Template/GENERIC_8M 
    180         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(mtdlayout_8M),$(kernel_size_8M),$(rootfs_size_8M)) 
     192        $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_8M)),$(kernel_size_8M),$(rootfs_size_8M)) 
    181193endef 
    182194 
    183195define Image/Build/Template/GENERIC_8M/initramfs 
    184         $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(mtdlayout_8M)) 
    185 endef 
    186  
    187 mtdlayout_dir300b1=mtdparts=physmap-flash.0:192k(u-boot)ro,64k(devdata)ro,64k(devconf)ro,896k(kernel),2880k(rootfs),3776k@0x50000(firmware) 
     196        $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_8M))) 
     197endef 
     198 
     199mtdlayout_dir300b1=192k(u-boot)ro,64k(devdata)ro,64k(devconf)ro,896k(kernel),2880k(rootfs),3776k@0x50000(firmware) 
    188200mtd_dir300b1_kernel_part_size=917504 
    189201mtd_dir300b1_rootfs_part_size=2949120 
    190202define Image/Build/Template/DIR300B1 
    191         $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(mtdlayout_dir300b1),$(mtd_dir300b1_kernel_part_size),$(mtd_dir300b1_rootfs_part_size)) 
     203        $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(call mkmtd/phys,$(mtdlayout_dir300b1)),$(mtd_dir300b1_kernel_part_size),$(mtd_dir300b1_rootfs_part_size)) 
    192204        mkwrgimg -s $(4) -d /dev/mtdblock/2 \ 
    193205                -i $(call sysupname,$(1),$(2)) \ 
     
    195207endef 
    196208 
    197 mtdlayout_nw718=mtdparts=spi0.0:192k(u-boot)ro,128k(config)ro,64k(factory)ro,832k(kernel),2880k(rootfs),3712k@0x60000(firmware) 
     209mtdlayout_nw718=192k(u-boot)ro,128k(config)ro,64k(factory)ro,832k(kernel),2880k(rootfs),3712k@0x60000(firmware) 
     210mtdparts_nw718=$(mkmtd/spi,$(mtdlayout_nw718)) 
    198211define Image/Build/Template/NW718 
    199         $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(mtdlayout_nw718),851968,2949120) 
    200         $(call BuildFirmware/NW718,$(1),$(2),board=$(3) $(mtdlayout_nw718),851968,2949120) 
     212        $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(mtdparts_nw718),851968,2949120) 
     213        $(call BuildFirmware/NW718,$(1),$(2),board=$(3) $(mtdparts_nw718),851968,2949120) 
    201214endef 
    202215 
    203216define Image/Build/Profile/WR6202 
    204         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,wr6202,WR6202,ttyS1,115200) 
    205 endef 
    206  
    207 mtdlayout_sercomm_4M=mtdparts=physmap-flash.0:128k(u-boot)ro,64k(board-nvram)ro,64k(u-boot-env)ro,832k(kernel),2944k(rootfs),64k(signature-eRcOmM),3776k@0x40000(firmware),4096k@0x0(fullflash) 
     217        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,wr6202,WR6202,ttyS1,115200,phys) 
     218endef 
     219 
     220mtdlayout_sercomm_4M=128k(u-boot)ro,64k(board-nvram)ro,64k(u-boot-env)ro,832k(kernel),2944k(rootfs),64k(signature-eRcOmM),3776k@0x40000(firmware),4096k@0x0(fullflash) 
     221mtdparts_sercomm_4M=$(call mkmtd/phys,$(mtdlayout_sercomm_4M)) 
    208222define Image/Build/Template/WL341V3 
    209         $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(mtdlayout_sercomm_4M),851968,3014656) 
    210         $(call BuildFirmware/WL341V3,$(1),$(2),board=$(3) $(mtdlayout_sercomm_4M),851968,3014656) 
     223        $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(mtdparts_sercomm_4M),851968,3014656) 
     224        $(call BuildFirmware/WL341V3,$(1),$(2),board=$(3) $(mtdparts_sercomm_4M),851968,3014656) 
    211225endef 
    212226 
     
    221235endef 
    222236 
    223 mtdlayout_rtg32b1=mtdparts=spi0.0:192k(u-boot)ro,64k(devdata)ro,64k(devconf)ro,832k(kernel),2944k(rootfs),3776k@0x50000(firmware) 
     237mtdlayout_rtg32b1=192k(u-boot)ro,64k(devdata)ro,64k(devconf)ro,832k(kernel),2944k(rootfs),3776k@0x50000(firmware) 
    224238mtd_rtg32b1_kernel_part_size=851968 
    225239mtd_rtg32b1_rootfs_part_size=3014656 
    226240define Image/Build/Template/RTG32B1 
    227         $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(mtdlayout_rtg32b1),$(mtd_rtg32b1_kernel_part_size),$(mtd_rtg32b1_rootfs_part_size)) 
     241        $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(call mkmtd/spi,$(mtdlayout_rtg32b1)),$(mtd_rtg32b1_kernel_part_size),$(mtd_rtg32b1_rootfs_part_size)) 
    228242endef 
    229243 
     
    233247 
    234248define Image/Build/Profile/ESR9753 
    235         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,esr-9753,ESR-9753,ttyS1,57600) 
     249        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,esr-9753,ESR-9753,ttyS1,57600,phys) 
    236250endef 
    237251 
    238252define Image/Build/Template/FONERA20N 
    239         $(call Image/Build/Template/GENERIC_8M,$(1),fonera20n,FONERA20N,ttyS1,57600) 
     253        $(call Image/Build/Template/GENERIC_8M,$(1),fonera20n,FONERA20N,ttyS1,57600,phys) 
    240254        $(call BuildFirmware/Edimax,$(1),fonera20n,RSDK,NL1T,0x50000,0xc0000) 
    241255endef 
     
    246260 
    247261define Image/Build/Profile/BC2 
    248         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,bc2,BC2,ttyS1,57600) 
    249 endef 
    250  
    251 mtdlayout_all0256n=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,832k(kernel),2944k(rootfs),3776k@0x50000(firmware) 
     262        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,bc2,BC2,ttyS1,57600,phys) 
     263endef 
     264 
    252265define Image/Build/Template/ALL0256N 
    253         $(call BuildFirmware/Generic,$(1),all0256n,board=ALL0256N $(mtdlayout_all0256n),851968,3014656) 
     266        $(call BuildFirmware/Generic,$(1),all0256n,board=ALL0256N $(call mkmtd/spi,$(mtdlayout_4M)),851968,3014656) 
    254267endef 
    255268 
     
    259272 
    260273define Image/Build/Profile/NBG419N 
    261         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,nbg-419n,NBG419N,ttyS1,57600) 
     274        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,nbg-419n,NBG419N,ttyS1,57600,phys) 
    262275endef 
    263276 
    264277define Image/Build/Profile/WL351 
    265         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,wl-351,WL-351,ttyS1,57600) 
     278        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,wl-351,WL-351,ttyS1,57600,phys) 
    266279endef 
    267280 
     
    271284 
    272285define Image/Build/Profile/OMNIEMB 
    273         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,omni-emb,OMNI-EMB,ttyS1,57600) 
     286        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,omni-emb,OMNI-EMB,ttyS1,57600,phys) 
    274287endef 
    275288 
    276289define Image/Build/Profile/PWH2004 
    277         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,pwh2004,PWH2004,ttyS1,57600) 
     290        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,pwh2004,PWH2004,ttyS1,57600,phys) 
    278291endef 
    279292 
    280293define Image/Build/Profile/V22RW2X2 
    281         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,v22rw-2x2,V22RW-2X2,ttyS1,57600) 
    282 endef 
    283  
    284 mtdlayout_whrg300n=mtdparts=physmap-flash.0:192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,960k(kernel),2752k(rootfs),64k(user)ro,3712k@0x50000(firmware) 
     294        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,v22rw-2x2,V22RW-2X2,ttyS1,57600,phys) 
     295endef 
     296 
     297mtdlayout_whrg300n=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,960k(kernel),2752k(rootfs),64k(user)ro,3712k@0x50000(firmware) 
    285298define Image/Build/Template/WHRG300N 
    286         $(call Image/Build/Template/GENERIC_4M,$(1),whr-g300n,WHR-G300N,ttyS1,57600) 
    287         $(call BuildFirmware/Buffalo,$(1),whr-g300n,$(call mkcmdline,WHR-G300N,ttyS1,57600) $(mtdlayout_whrg300n),983040,3801088) 
     299        $(call Image/Build/Template/GENERIC_4M,$(1),whr-g300n,WHR-G300N,ttyS1,57600,phys) 
     300        $(call BuildFirmware/Buffalo,$(1),whr-g300n,$(call mkcmdline,WHR-G300N,ttyS1,57600) $(call mkmtd/phys,$(mtdlayout_whrg300n)),983040,3801088) 
    288301        ( \ 
    289302                echo -n -e "# Airstation FirmWare\nrun u_fw\nreset\n\n" | \ 
     
    300313 
    301314define Image/Build/Profile/HW5503G 
    302         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,hw550-3g,HW550-3G,ttyS1,57600) 
     315        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,hw550-3g,HW550-3G,ttyS1,57600,phys) 
    303316endef 
    304317 
    305318define Image/Build/Profile/MOFI35003GN 
    306         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,mofi3500-3gn,MOFI3500-3GN,ttyS1,57600) 
     319        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,mofi3500-3gn,MOFI3500-3GN,ttyS1,57600,phys) 
    307320endef 
    308321 
    309322define Image/Build/Profile/WCR150GN 
    310         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,wcr150gn,WCR150GN,ttyS1,57600) 
     323        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,wcr150gn,WCR150GN,ttyS1,57600,phys) 
    311324endef 
    312325 
    313326define Image/Build/Profile/W502U 
    314         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,w502u,W502U,ttyS1,115200) 
    315 endef 
    316  
    317 mtdlayout_argus_atp52b=mtdparts=physmap-flash.0:192k(bootloader)ro,64k(config),64k(factory),1152k(kernel),6656k(rootfs),7808k@0x50000(firmware) 
     327        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,w502u,W502U,ttyS1,115200,phys) 
     328endef 
     329 
     330mtdlayout_argus_atp52b=192k(bootloader)ro,64k(config),64k(factory),1152k(kernel),6656k(rootfs),7808k@0x50000(firmware) 
    318331mtd_argus_atp52b_kernel_part_size=1179648 
    319332mtd_argus_atp52b_rootfs_part_size=6815744 
    320333define Image/Build/Template/ARGUS_ATP52B 
    321         $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(mtdlayout_argus_atp52b),$(mtd_argus_atp52b_kernel_part_size),$(mtd_argus_atp52b_rootfs_part_size)) 
     334        $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(call mkmtd/phys,$(mtdlayout_argus_atp52b)),$(mtd_argus_atp52b_kernel_part_size),$(mtd_argus_atp52b_rootfs_part_size)) 
    322335endef 
    323336 
     
    326339endef 
    327340 
    328 mtdlayout_f5d8235=mtdparts=physmap-flash.0:320k(u-boot)ro,1536k(kernel),6208k(rootfs),64k(nvram),64k(factory),7744k@0x50000(firmware) 
     341mtdlayout_f5d8235=320k(u-boot)ro,1536k(kernel),6208k(rootfs),64k(nvram),64k(factory),7744k@0x50000(firmware) 
    329342mtd_f5d8235_kernel_part_size=1572864 
    330343mtd_f5d8235_rootfs_part_size=6356992 
    331344define Image/Build/Template/F5D8235 
    332         $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(mtdlayout_f5d8235),$(mtd_f5d8235_kernel_part_size),$(mtd_f5d8235_rootfs_part_size)) 
     345        $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(call mkmtd/phys,$(mtdlayout_f5d8235)),$(mtd_f5d8235_kernel_part_size),$(mtd_f5d8235_rootfs_part_size)) 
    333346endef 
    334347 
     
    338351 
    339352define Image/Build/Profile/WR5123GN 
    340         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,wr512-3gn-4M,WR512-3GN,ttyS1,57600) 
    341         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,wr512-3gn-8M,WR512-3GN,ttyS1,57600) 
     353        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,wr512-3gn-4M,WR512-3GN,ttyS1,57600,phys) 
     354        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,wr512-3gn-8M,WR512-3GN,ttyS1,57600,phys) 
    342355endef 
    343356 
    344357define Image/Build/Profile/SLR7205 
    345         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,sl-r7205,SL-R7205,ttyS1,57600) 
     358        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,sl-r7205,SL-R7205,ttyS1,57600,phys) 
    346359endef 
    347360 
     
    379392 
    380393define Image/Build/Profile/RTN15 
    381         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,rt-n15,RT-N15,ttyS1,57600) 
     394        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,rt-n15,RT-N15,ttyS1,57600,phys) 
    382395endef 
    383396 
    384397define Image/Build/Profile/V11STFE 
    385         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,v11st-fe,V11ST-FE,ttyS1,57600) 
    386 endef 
    387  
    388 mtdlayout_wlitx4ag300n=mtdparts=physmap-flash.0:192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,832k(kernel),2880k(rootfs),64k(user)ro,3712k@0x50000(firmware) 
     398        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,v11st-fe,V11ST-FE,ttyS1,57600,phys) 
     399endef 
     400 
     401mtdlayout_wlitx4ag300n=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,832k(kernel),2880k(rootfs),64k(user)ro,3712k@0x50000(firmware) 
    389402define Image/Build/Template/WLITX4AG300N 
    390         $(call BuildFirmware/Buffalo2,$(1),wli-tx4-ag300n,WLI-TX4-AG300N,$(mtdlayout_wlitx4ag300n),851968,2949120) 
     403        $(call BuildFirmware/Buffalo2,$(1),wli-tx4-ag300n,WLI-TX4-AG300N,$(call mkmtd/phys,$(mtdlayout_wlitx4ag300n)),851968,2949120) 
    391404endef 
    392405 
Note: See TracChangeset for help on using the changeset viewer.