2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
5 include $(TOPDIR
)/rules.mk
6 include $(INCLUDE_DIR
)/image.mk
8 DEVICE_VARS
+= TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT
11 $(patsubst %-256k
,0x40000,$(patsubst %-128k
,0x20000,$(patsubst %-64k
,0x10000,$(patsubst squashfs
%,0x4,$(patsubst root.
%,%,$(1))))))
14 define Build
/copy-file
18 # combine kernel and rootfs into one image
19 # mktplinkfw <type> <optional extra arguments to mktplinkfw binary>
20 # <type> is "sysupgrade" or "factory"
22 # -a align the rootfs start on an <align> bytes boundary
23 # -j add jffs2 end-of-filesystem markers
24 # -s strip padding from end of the image
25 # -X reserve <size> bytes in the firmware image (hexval prefixed with 0x)
26 define Build
/mktplinkfw
27 -$(STAGING_DIR_HOST
)/bin
/mktplinkfw \
28 -H
$(TPLINK_HWID
) -W
$(TPLINK_HWREV
) -F
$(TPLINK_FLASHLAYOUT
) -N OpenWrt
-V
$(REVISION
) \
33 -a
$(call rootfs_align
,$(FILESYSTEM
)) \
34 $(wordlist
2,$(words $(1)),$(1)) \
35 $(if
$(findstring sysupgrade
,$(word 1,$(1))),-s
) && mv
$@.new
$@ ||
rm -f
$@
40 DEVICE_DTS
:= $(lastword
$(subst _
, ,$(1)))
41 KERNEL_DEPENDS
= $$(wildcard $(DTS_DIR
)/$$(DEVICE_DTS
).dts
)
42 KERNEL_ENTRY
:= 0x00000000
43 KERNEL_LOADADDR
:= 0x00000000
45 SUPPORTED_DEVICES
:= $(subst _
,$(comma
),$(1))
48 ifeq ($(SUBTARGET
),generic
)
50 define Device
/tplink_tl-wdr4900-v1
51 DEVICE_VENDOR
:= TP-Link
52 DEVICE_MODEL
:= TL-WDR4900
54 TPLINK_HWID
:= 0x49000001
56 TPLINK_FLASHLAYOUT
:= 16Mppc
58 KERNEL_NAME
:= simpleImage.tl-wdr4900-v1
60 KERNEL
:= kernel-bin | uImage none
61 KERNEL_ENTRY
:= 0x1000000
62 KERNEL_LOADADDR
:= 0x1000000
63 SUPPORTED_DEVICES
+= tl-wdr4900-v1
65 ARTIFACT
/fdt.bin
:= append-dtb
66 IMAGES
:= fdt.bin factory.bin sysupgrade.bin
67 IMAGE
/sysupgrade.bin
:= append-rootfs | mktplinkfw sysupgrade | append-metadata
68 IMAGE
/factory.bin
:= append-rootfs | mktplinkfw factory
70 TARGET_DEVICES
+= tplink_tl-wdr4900-v1
72 define Device
/sophos_red-15w-rev1
73 DEVICE_VENDOR
:= Sophos
74 DEVICE_MODEL
:= RED
15w
75 DEVICE_VARIANT
:= Rev
.1
76 # Original firmware uses a dedicated DTB-partition.
77 # The bootloader however supports FIT-images.
78 KERNEL
= kernel-bin | gzip | fit gzip
$(KDIR
)/image-
$$(DEVICE_DTS
).dtb
79 IMAGES
:= sysupgrade.bin
80 IMAGE
/sysupgrade.bin
:= sysupgrade-tar | append-metadata
82 TARGET_DEVICES
+= sophos_red-15w-rev1
86 ifeq ($(SUBTARGET
),p1020
)
88 define Device
/aerohive_hiveap-330
89 DEVICE_VENDOR
:= Aerohive
90 DEVICE_MODEL
:= HiveAP-330
91 DEVICE_PACKAGES
:= kmod-tpm-i2c-atmel
93 KERNEL
:= kernel-bin | gzip | uImage gzip
95 KERNEL_INITRAMFS
:= copy-file
$(KDIR
)/vmlinux-initramfs | uImage none
96 IMAGES
:= fdt.bin sysupgrade.bin
97 IMAGE
/fdt.bin
:= append-dtb
98 IMAGE
/sysupgrade.bin
:= append-dtb | pad-to
256k | check-size
256k | \
99 append-uImage-fakehdr ramdisk | pad-to
256k | check-size
512k | \
100 append-rootfs | pad-rootfs
$$(BLOCKSIZE
) | pad-to
41216k | check-size
41216k | \
101 append-kernel | append-metadata
103 TARGET_DEVICES
+= aerohive_hiveap-330
105 define Device
/ocedo_panda
106 DEVICE_VENDOR
:= OCEDO
107 DEVICE_MODEL
:= Panda
108 DEVICE_PACKAGES
:= kmod-rtc-ds1307 uboot-envtools
109 KERNEL
= kernel-bin | gzip | fit gzip
$(KDIR
)/image-
$$(DEVICE_DTS
).dtb
113 IMAGES
:= fdt.bin sysupgrade.bin
114 IMAGE
/sysupgrade.bin
:= sysupgrade-tar | append-metadata
115 IMAGE
/fdt.bin
:= append-dtb
117 TARGET_DEVICES
+= ocedo_panda
121 ifeq ($(SUBTARGET
),p2020
)
123 define Device
/freescale_p2020rdb
124 DEVICE_VENDOR
:= Freescale
125 DEVICE_MODEL
:= P2020RDB
126 DEVICE_DTS_DIR
:= $(DTS_DIR
)/fsl
127 DEVICE_PACKAGES
:= kmod-hwmon-core kmod-hwmon-lm90 kmod-rtc-ds1307 \
128 kmod-gpio-pca953x kmod-eeprom-at24
130 KERNEL
:= kernel-bin | gzip | \
131 fit gzip
$$(KDIR
)/image-
$$(firstword $$(DEVICE_DTS
)).dtb
132 SUPPORTED_DEVICES
:= fsl
,P2020RDB
133 IMAGES
:= sysupgrade.bin
134 IMAGE
/sysupgrade.bin
:= append-kernel | append-rootfs | \
135 pad-rootfs
$$(BLOCKSIZE
) | append-metadata
137 TARGET_DEVICES
+= freescale_p2020rdb
141 $(eval
$(call BuildImage
))