c3f368f2e4906ffc926e5cdebcd5df6041579ee5
[openwrt/staging/yousong.git] / target / linux / sunxi / image / Makefile
1 #
2 # Copyright (C) 2013-2016 OpenWrt.org
3 # Copyright (C) 2016 Yousong Zhou
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/image.mk
10 include $(INCLUDE_DIR)/host.mk
11
12 FAT32_BLOCK_SIZE=1024
13 FAT32_BLOCKS=$(shell echo $$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
14
15 KERNEL_LOADADDR:=0x40008000
16
17 define Build/sunxi-sdcard
18 rm -f $@.boot
19 mkfs.fat $@.boot -C $(FAT32_BLOCKS)
20
21 mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-boot.scr ::boot.scr
22 mcopy -i $@.boot $(DTS_DIR)/$(SUNXI_DTS).dtb ::dtb
23 mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage
24 ./gen_sunxi_sdcard_img.sh $@ \
25 $@.boot \
26 $(IMAGE_ROOTFS) \
27 $(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \
28 $(CONFIG_TARGET_ROOTFS_PARTSIZE) \
29 $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-u-boot-with-spl.bin
30 rm -f $@.boot
31 endef
32
33 # why \x00\x00\x00\x00 for zImage-initramfs
34 define Device/Default
35 PROFILES := Default
36 DEVICE_VARS := SUNXI_DTS SUNXI_UBOOT
37 KERNEL_NAME := zImage
38 KERNEL := kernel-bin | uImage none
39 IMAGES := sdcard.img.gz
40 IMAGE/sdcard.img.gz := sunxi-sdcard | append-metadata | gzip
41 endef
42
43 define Device/sun4i-a10-olinuxino-lime
44 DEVICE_TITLE:=Olimex A10-OLinuXino-LIME
45 DEVICE_PACKAGES:=kmod-ata-core kmod-ata-sunxi kmod-sun4i-emac kmod-rtc-sunxi
46 SUPPORTED_DEVICES:=olimex,a10-olinuxino-lime
47 SUNXI_DTS:=sun4i-a10-olinuxino-lime
48 endef
49
50 TARGET_DEVICES += sun4i-a10-olinuxino-lime
51
52
53 define Device/sun5i-a13-olimex-som
54 DEVICE_TITLE:=Olimex A13 SOM
55 DEVICE_PACKAGES:=kmod-rtl8192cu
56 SUPPORTED_DEVICES:=olimex,a13-olinuxino
57 SUNXI_DTS:=sun5i-a13-olinuxino
58 endef
59
60 TARGET_DEVICES += sun5i-a13-olimex-som
61
62
63 define Device/sun5i-a13-olinuxino
64 DEVICE_TITLE:=Olimex A13-Olinuxino
65 DEVICE_PACKAGES:=kmod-rtl8192cu
66 SUPPORTED_DEVICES:=olimex,a13-olinuxino
67 SUNXI_DTS:=sun5i-a13-olinuxino
68 endef
69
70 TARGET_DEVICES += sun5i-a13-olinuxino
71
72
73 define Device/sun7i-a20-olinuxino-lime
74 DEVICE_TITLE:=Olimex A20-OLinuXino-LIME
75 DEVICE_PACKAGES:=kmod-ata-core kmod-ata-sunxi kmod-rtc-sunxi
76 SUPPORTED_DEVICES:=olimex,a20-olinuxino-lime
77 SUNXI_DTS:=sun7i-a20-olinuxino-lime
78 endef
79
80 TARGET_DEVICES += sun7i-a20-olinuxino-lime
81
82
83 define Device/sun7i-a20-olinuxino-micro
84 DEVICE_TITLE:=Olimex A20-Olinuxino Micro
85 DEVICE_PACKAGES:=kmod-ata-core kmod-ata-sunxi kmod-sun4i-emac kmod-rtc-sunxi
86 SUPPORTED_DEVICES:=olimex,a20-olinuxino-micro
87 SUNXI_DTS:=sun7i-a20-olinuxino-micro
88 endef
89
90 TARGET_DEVICES += sun7i-a20-olinuxino-micro
91
92
93 define Device/sun7i-a20-bananapi
94 DEVICE_TITLE:=LeMaker Banana Pi
95 DEVICE_PACKAGES:=kmod-rtc-sunxi kmod-ata-core kmod-ata-sunxi
96 SUPPORTED_DEVICES:=lemaker,bananapi
97 SUNXI_DTS:=sun7i-a20-bananapi
98 endef
99
100 TARGET_DEVICES += sun7i-a20-bananapi
101
102
103 define Device/sun7i-a20-bananapro
104 DEVICE_TITLE:=LeMaker Banana Pro
105 DEVICE_PACKAGES:=kmod-rtc-sunxi kmod-ata-core kmod-ata-sunxi kmod-brcmfmac
106 SUPPORTED_DEVICES:=lemaker,bananapro
107 SUNXI_DTS:=sun7i-a20-bananapro
108 endef
109
110 TARGET_DEVICES += sun7i-a20-bananapro
111
112
113 define Device/sun7i-a20-cubieboard2
114 DEVICE_TITLE:=Cubietech Cubieboard2
115 DEVICE_PACKAGES:=kmod-ata-core kmod-ata-sunxi kmod-sun4i-emac kmod-rtc-sunxi
116 SUPPORTED_DEVICES:=cubietech,cubieboard2
117 SUNXI_DTS:=sun7i-a20-cubieboard2
118 endef
119
120 TARGET_DEVICES += sun7i-a20-cubieboard2
121
122
123 define Device/sun4i-a10-cubieboard
124 DEVICE_TITLE:=Cubietech Cubieboard
125 DEVICE_PACKAGES:=kmod-ata-core kmod-ata-sunxi kmod-sun4i-emac kmod-rtc-sunxi
126 SUPPORTED_DEVICES:=cubietech,a10-cubieboard
127 SUNXI_DTS:=sun4i-a10-cubieboard
128 endef
129
130 TARGET_DEVICES += sun4i-a10-cubieboard
131
132
133 define Device/sun7i-a20-cubietruck
134 DEVICE_TITLE:=Cubietech Cubietruck
135 DEVICE_PACKAGES:=kmod-ata-core kmod-ata-sunxi kmod-rtc-sunxi kmod-brcmfmac
136 SUPPORTED_DEVICES:=cubietech,cubietruck
137 SUNXI_DTS:=sun7i-a20-cubietruck
138 endef
139
140 TARGET_DEVICES += sun7i-a20-cubietruck
141
142
143 define Device/sun7i-a20-lamobo-r1
144 DEVICE_TITLE:=Lamobo R1
145 DEVICE_PACKAGES:=kmod-ata-sunxi kmod-rtl8192cu swconfig wpad-mini
146 SUPPORTED_DEVICES:=lamobo,lamobo-r1
147 SUNXI_DTS:=sun7i-a20-lamobo-r1
148 endef
149
150 TARGET_DEVICES += sun7i-a20-lamobo-r1
151
152
153 define Device/sun6i-a31-m9
154 DEVICE_TITLE:=Mele M9 top set box
155 DEVICE_PACKAGES:=kmod-sun4i-emac kmod-rtc-sunxi kmod-rtl8192cu
156 SUPPORTED_DEVICES:=mele,m9
157 SUNXI_DTS:=sun6i-a31-m9
158 endef
159
160 TARGET_DEVICES += sun6i-a31-m9
161
162
163 define Device/sun8i-h3-orangepi-plus
164 DEVICE_TITLE:=Xunlong Orange Pi Plus
165 DEVICE_PACKAGES:=kmod-rtc-sunxi
166 SUPPORTED_DEVICES:=xunlong,orangepi-plus
167 SUNXI_DTS:=sun8i-h3-orangepi-plus
168 endef
169
170 TARGET_DEVICES += sun8i-h3-orangepi-plus
171
172
173 define Device/sun7i-a20-pcduino3
174 DEVICE_TITLE:=LinkSprite pcDuino3
175 DEVICE_PACKAGES:=kmod-sun4i-emac kmod-rtc-sunxi kmod-ata-core kmod-ata-sunxi kmod-rtl8xxxu rtl8188eu-firmware
176 SUPPORTED_DEVICES:=linksprite,pcduino3
177 SUNXI_DTS:=sun7i-a20-pcduino3
178 endef
179
180 TARGET_DEVICES += sun7i-a20-pcduino3
181
182
183 define Device/sun4i-a10-pcduino
184 DEVICE_TITLE:=LinkSprite pcDuino
185 DEVICE_PACKAGES:=kmod-sun4i-emac kmod-rtc-sunxi kmod-rtl8192cu
186 SUPPORTED_DEVICES:=linksprite,a10-pcduino
187 SUNXI_DTS:=sun4i-a10-pcduino
188 endef
189
190 TARGET_DEVICES += sun4i-a10-pcduino
191
192
193 $(eval $(call BuildImage))