349d2961dee22e8550f9a6ea0899b4248e8c6ab8
[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 Device/Default
11 PROFILES := Default
12 DEVICE_DTS := $(1)
13 KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
14 KERNEL_ENTRY := 0x00000000
15 KERNEL_LOADADDR := 0x00000000
16 KERNEL := kernel-bin
17 endef
18
19 define Build/tplink-v1-image
20 $(STAGING_DIR_HOST)/bin/mktplinkfw \
21 -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) \
22 -N "$(VERSION_DIST)" -V $(REVISION) \
23 -k $(IMAGE_KERNEL) \
24 -r $(IMAGE_ROOTFS) \
25 -j \
26 $(1) \
27 -o $@
28 endef
29
30 ifeq ($(SUBTARGET),generic)
31
32 define Device/tl-wdr4900-v1
33 DEVICE_TITLE := TP-Link TL-WDR4900
34 DEVICE_PACKAGES := kmod-ath9k wpad-basic
35 TPLINK_HWID := 0x49000001
36 TPLINK_HWREV := 1
37 TPLINK_FLASHLAYOUT := 16Mppc
38 KERNEL_NAME := cuImage.tl-wdr4900-v1
39 SUPPORTED_DEVICES:=tl-wdr4900-v1 tplink,tl-wdr4900-v1
40 IMAGES := fdt.bin factory.bin sysupgrade.bin
41 IMAGE/fdt.bin := append-dtb
42 IMAGE/factory.bin := tplink-v1-image
43 IMAGE/sysupgrade.bin := tplink-v1-image -s | append-metadata
44 endef
45 TARGET_DEVICES += tl-wdr4900-v1
46
47 endif
48
49 ifeq ($(SUBTARGET),p1020)
50
51 define Device/hiveap-330
52 DEVICE_TITLE := Aerohive HiveAP-330
53 DEVICE_PACKAGES := kmod-ath9k wpad-basic kmod-tpm-i2c-atmel
54 BLOCKSIZE := 128k
55 KERNEL_NAME := zImage
56 KERNEL_SIZE := 8m
57 SUPPORTED_DEVICES := aerohive,hiveap-330
58 IMAGES := fdt.bin sysupgrade.bin
59 IMAGE/fdt.bin := append-dtb
60 IMAGE/sysupgrade.bin := append-dtb | pad-to 256k | check-size 256k | \
61 append-uImage-fakehdr ramdisk | pad-to 256k | check-size 512k | \
62 append-rootfs | pad-rootfs $$(BLOCKSIZE) | pad-to 41216k | check-size 41216k | \
63 append-kernel | append-metadata
64 endef
65 TARGET_DEVICES += hiveap-330
66
67 endif
68
69 $(eval $(call BuildImage))