2 # Copyright (C) 2013-2016 OpenWrt.org
3 # Copyright (C) 2016 Yousong Zhou
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
9 include $(INCLUDE_DIR
)/image.mk
10 include $(INCLUDE_DIR
)/host.mk
13 FAT32_BLOCKS
=$(shell echo
$$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE
)*1024*1024/$(FAT32_BLOCK_SIZE
))))
15 KERNEL_LOADADDR
:=0x40008000
17 define Build
/sunxi-sdcard
19 mkfs.fat
$@.boot
-C
$(FAT32_BLOCKS
)
21 mcopy
-i
$@.boot
$(KDIR
)/$(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
$@ \
27 $(CONFIG_SUNXI_SD_BOOT_PARTSIZE
) \
28 $(CONFIG_TARGET_ROOTFS_PARTSIZE
) \
29 $(KDIR
)/$(DEVICE_NAME
)-u-boot-with-spl.bin
33 # why \x00\x00\x00\x00 for zImage-initramfs
36 DEVICE_VARS
:= SUNXI_DTS SUNXI_UBOOT
38 KERNEL
:= kernel-bin | uImage none
39 IMAGES
:= sdcard.img.gz
40 IMAGE
/sdcard.img.gz
:= sunxi-sdcard | append-metadata | gzip
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
50 TARGET_DEVICES
+= sun4i-a10-olinuxino-lime
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
60 TARGET_DEVICES
+= sun5i-a13-olimex-som
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
70 TARGET_DEVICES
+= sun5i-a13-olinuxino
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
80 TARGET_DEVICES
+= sun7i-a20-olinuxino-lime
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
90 TARGET_DEVICES
+= sun7i-a20-olinuxino-micro
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
100 TARGET_DEVICES
+= sun7i-a20-bananapi
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
110 TARGET_DEVICES
+= sun7i-a20-bananapro
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
120 TARGET_DEVICES
+= sun7i-a20-cubieboard2
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
130 TARGET_DEVICES
+= sun4i-a10-cubieboard
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
140 TARGET_DEVICES
+= sun7i-a20-cubietruck
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
150 TARGET_DEVICES
+= sun7i-a20-lamobo-r1
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
160 TARGET_DEVICES
+= sun6i-a31-m9
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
170 TARGET_DEVICES
+= sun8i-h3-orangepi-plus
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
180 TARGET_DEVICES
+= sun7i-a20-pcduino3
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
190 TARGET_DEVICES
+= sun4i-a10-pcduino
193 $(eval
$(call BuildImage
))