mpc85xx: disable initramfs image in TL-WDR4900
[openwrt/openwrt.git] / target / linux / mpc85xx / image / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 #
5 include $(TOPDIR)/rules.mk
6 include $(INCLUDE_DIR)/image.mk
7
8 DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT
9
10 define rootfs_align
11 $(patsubst %-256k,0x40000,$(patsubst %-128k,0x20000,$(patsubst %-64k,0x10000,$(patsubst squashfs%,0x4,$(patsubst root.%,%,$(1))))))
12 endef
13
14 # combine kernel and rootfs into one image
15 # mktplinkfw <type> <optional extra arguments to mktplinkfw binary>
16 # <type> is "sysupgrade" or "factory"
17 #
18 # -a align the rootfs start on an <align> bytes boundary
19 # -j add jffs2 end-of-filesystem markers
20 # -s strip padding from end of the image
21 # -X reserve <size> bytes in the firmware image (hexval prefixed with 0x)
22 define Build/mktplinkfw
23 -$(STAGING_DIR_HOST)/bin/mktplinkfw \
24 -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) \
25 -k $(IMAGE_KERNEL) \
26 -r $@ \
27 -o $@.new \
28 -j -X 0x40000 \
29 -a $(call rootfs_align,$(FILESYSTEM)) \
30 $(wordlist 2,$(words $(1)),$(1)) \
31 $(if $(findstring sysupgrade,$(word 1,$(1))),-s) && mv $@.new $@ || rm -f $@
32 endef
33
34 define Device/Default
35 PROFILES := Default
36 DEVICE_DTS := $(1)
37 KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
38 KERNEL_ENTRY := 0x00000000
39 KERNEL_LOADADDR := 0x00000000
40 KERNEL := kernel-bin
41 endef
42
43 ifeq ($(SUBTARGET),generic)
44
45 define Device/tl-wdr4900-v1
46 DEVICE_TITLE := TP-Link TL-WDR4900
47 DEVICE_PACKAGES := kmod-ath9k wpad-basic
48 TPLINK_HWID := 0x49000001
49 TPLINK_HWREV := 1
50 TPLINK_FLASHLAYOUT := 16Mppc
51 KERNEL_NAME := cuImage.tl-wdr4900-v1
52 KERNEL_INITRAMFS :=
53 SUPPORTED_DEVICES:=tl-wdr4900-v1 tplink,tl-wdr4900-v1
54 IMAGES := fdt.bin factory.bin sysupgrade.bin
55 IMAGE/fdt.bin := append-dtb
56 IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade | append-metadata
57 IMAGE/factory.bin := append-rootfs | mktplinkfw factory
58 endef
59 TARGET_DEVICES += tl-wdr4900-v1
60
61 endif
62
63 ifeq ($(SUBTARGET),p1020)
64
65 define Device/hiveap-330
66 DEVICE_TITLE := Aerohive HiveAP-330
67 DEVICE_PACKAGES := kmod-ath9k wpad-basic kmod-tpm-i2c-atmel
68 BLOCKSIZE := 128k
69 KERNEL_NAME := zImage
70 KERNEL_SIZE := 8m
71 SUPPORTED_DEVICES := aerohive,hiveap-330
72 IMAGES := fdt.bin sysupgrade.bin
73 IMAGE/fdt.bin := append-dtb
74 IMAGE/sysupgrade.bin := append-dtb | pad-to 256k | check-size 256k | \
75 append-uImage-fakehdr ramdisk | pad-to 256k | check-size 512k | \
76 append-rootfs | pad-rootfs $$(BLOCKSIZE) | pad-to 41216k | check-size 41216k | \
77 append-kernel | append-metadata
78 endef
79 TARGET_DEVICES += hiveap-330
80
81 endif
82
83 ifeq ($(SUBTARGET),p2020)
84
85 define Device/p2020rdb
86 DEVICE_TITLE := Freescale P2020RDB
87 DEVICE_DTS_DIR := $(DTS_DIR)/fsl
88 DEVICE_PACKAGES := kmod-hwmon-core kmod-hwmon-lm90 kmod-rtc-ds1307 \
89 kmod-gpio-pca953x kmod-eeprom-at24
90 BLOCKSIZE := 128k
91 KERNEL := kernel-bin | gzip | \
92 fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
93 SUPPORTED_DEVICES := fsl,P2020RDB
94 IMAGES := sysupgrade.bin
95 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
96 pad-rootfs $$(BLOCKSIZE) | append-metadata
97 endef
98 TARGET_DEVICES += p2020rdb
99
100 endif
101
102 $(eval $(call BuildImage))