ramips: switch some rt3883 devices to new build code
[openwrt/openwrt.git] / target / linux / ramips / image / rt3883.mk
1 #
2 # RT3662/RT3883 Profiles
3 #
4
5 define Device/cy-swr1100
6 DTS := CY-SWR1100
7 BLOCKSIZE := 64k
8 KERNEL := $(KERNEL_DTB)
9 IMAGES += factory.bin
10 IMAGE/sysupgrade.bin := \
11 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
12 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
13 pad-rootfs | check-size $$$$(IMAGE_SIZE)
14 IMAGE/factory.bin := \
15 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
16 append-rootfs | pad-rootfs -x 64 | \
17 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
18 seama-seal -m "signature=wrgnd10_samsung_ss815" | \
19 check-size $$$$(IMAGE_SIZE)
20 DEVICE_TITLE := Samsung CY-SWR1100
21 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
22 endef
23 TARGET_DEVICES += cy-swr1100
24
25
26 define Device/dir-645
27 DTS := DIR-645
28 BLOCKSIZE := 4k
29 KERNEL := $(KERNEL_DTB)
30 IMAGES += factory.bin
31 IMAGE/sysupgrade.bin := \
32 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
33 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
34 pad-rootfs | check-size $$$$(IMAGE_SIZE)
35 IMAGE/factory.bin := \
36 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
37 append-rootfs | pad-rootfs -x 64 | \
38 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
39 seama-seal -m "signature=wrgn39_dlob.hans_dir645" | \
40 check-size $$$$(IMAGE_SIZE)
41 DEVICE_TITLE := D-Link DIR-645
42 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
43 endef
44 TARGET_DEVICES += dir-645
45
46
47 define Device/hpm
48 DTS := HPM
49 BLOCKSIZE := 64k
50 IMAGE_SIZE := 16064k
51 DEVICE_TITLE := Omnima HPM
52 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2
53 endef
54 TARGET_DEVICES += hpm
55
56
57 define Device/tew-691gr
58 DTS := TEW-691GR
59 IMAGES += factory.bin
60 IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | umedia-header 0x026910
61 DEVICE_TITLE := TRENDnet TEW-691GR
62 DEVICE_PACKAGES := swconfig
63 endef
64 TARGET_DEVICES += tew-691gr
65
66
67 define Device/tew-692gr
68 DTS := TEW-692GR
69 IMAGES += factory.bin
70 IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | umedia-header 0x026920
71 DEVICE_TITLE := TRENDnet TEW-692GR
72 DEVICE_PACKAGES := swconfig
73 endef
74 TARGET_DEVICES += tew-692gr
75
76
77 # $(1) = squashfs/initramfs
78 # $(2) = lowercase board name
79 # $(3) = dts file
80 # $(4) = kernel size
81 # $(5) = rootfs size
82 # $(6) = signature
83 # $(7) = model
84 # $(8) = flash address
85 # $(9) = start address
86 define BuildFirmware/EdimaxCombined/squashfs
87 $(call PatchKernelLzmaDtb,$(2),$(3))
88 $(call MkImage,lzma,$(KDIR)/vmlinux-$(2).bin.lzma,$(KDIR)/vmlinux-$(2).bin.uImage)
89 if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.uImage"` -gt `expr $(4) - 20` ]; then \
90 echo "Warning: $(KDIR)/vmlinux-$(2).bin.uImage is too big" >&2; \
91 exit 1; \
92 else if [ `stat -c%s "$(KDIR)/root.$(1)"` -gt $(5) ]; then \
93 echo "Warning: $(KDIR)/root.$(1) is too big" >&2; \
94 exit 1; \
95 else \
96 ( dd if=$(KDIR)/vmlinux-$(2).bin.uImage bs=`expr $(4) - 20` conv=sync ; dd if=$(KDIR)/root.$(1) ) > $(KDIR)/vmlinux-$(2).bin.uImage.combined ; \
97 fi ; fi
98 mkedimaximg -i "$(KDIR)/vmlinux-$(2).bin.uImage.combined" \
99 -o $(call imgname,$(1),$(2)).bin \
100 -s $(6) -m $(7) -f $(8) -S $(9)
101 endef
102
103 define BuildFirmware/RTN56U/squashfs
104 $(call BuildFirmware/Default8M/$(1),$(1),rt-n56u,RT-N56U)
105 -mkrtn56uimg -s $(call sysupname,$(1),rt-n56u)
106 -cp $(call sysupname,$(1),rt-n56u) $(call imgname,$(1),rt-n56u)-factory.bin
107 -mkrtn56uimg -f $(call imgname,$(1),rt-n56u)-factory.bin
108 endef
109
110
111 Image/Build/Profile/RTN56U=$(call BuildFirmware/RTN56U/$(1),$(1),rt-n56u,RT-N56U)
112 kernel_size_BR6475ND:=2097152
113 rootfs_size_BR6475ND:=5832704
114 Image/Build/Profile/BR6475ND=$(call BuildFirmware/EdimaxCombined/$(1),$(1),br-6475nd,BR-6475ND,$(kernel_size_BR6475ND),$(rootfs_size_BR6475ND),CSYS,RN54,0x70000,0x01100000)
115
116
117 define LegacyDevice/RTN56U
118 DEVICE_TITLE := Asus RT-N56U
119 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
120 endef
121 LEGACY_DEVICES += RTN56U
122
123
124 define LegacyDevice/BR6475ND
125 DEVICE_TITLE := Edimax BR-6475nD
126 DEVICE_PACKAGES := swconfig
127 endef
128 LEGACY_DEVICES += BR6475ND