1
0

Makefile 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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. FAT32_BLOCK_SIZE=1024
  12. FAT32_BLOCKS=$(shell echo $$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
  13. KERNEL_LOADADDR:=0x40008000
  14. define Build/sunxi-sdcard
  15. rm -f $@.boot
  16. mkfs.fat $@.boot -C $(FAT32_BLOCKS)
  17. mcopy -i $@.boot $(KDIR)/uboot-sunxi-$(SUNXI_UBOOT)-boot.scr ::boot.scr
  18. mcopy -i $@.boot $(DTS_DIR)/$(SUNXI_DTS).dtb ::dtb
  19. mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage
  20. ./gen_sunxi_sdcard_img.sh $@ \
  21. $@.boot \
  22. $(IMAGE_ROOTFS) \
  23. $(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \
  24. $(CONFIG_TARGET_ROOTFS_PARTSIZE) \
  25. $(KDIR)/uboot-sunxi-$(SUNXI_UBOOT)-u-boot-with-spl.bin
  26. rm -f $@.boot
  27. endef
  28. # why \x00\x00\x00\x00 for zImage-initramfs
  29. define Device/Default
  30. PROFILES := Default
  31. DEVICE_VARS := SUNXI_DTS SUNXI_UBOOT
  32. KERNEL_NAME := zImage
  33. KERNEL := kernel-bin | uImage none
  34. IMAGES := sdcard.img.gz
  35. IMAGE/sdcard.img.gz := sunxi-sdcard | append-metadata | gzip
  36. endef
  37. define Device/sun4i-a10-olinuxino-lime
  38. DEVICE_TITLE:=Olimex A10-OLinuXino-LIME
  39. DEVICE_PACKAGES:=uboot-sunxi-A10-OLinuXino-Lime kmod-ata-core kmod-ata-sunxi kmod-sun4i-emac kmod-rtc-sunxi
  40. SUPPORTED_DEVICES:=olimex,a10-olinuxino-lime
  41. SUNXI_DTS:=sun4i-a10-olinuxino-lime
  42. SUNXI_UBOOT:=A10-OLinuXino-Lime
  43. endef
  44. TARGET_DEVICES += sun4i-a10-olinuxino-lime
  45. define Device/sun5i-a13-olimex-som
  46. DEVICE_TITLE:=Olimex A13 SOM
  47. DEVICE_PACKAGES:=uboot-sunxi-OLIMEX_A13_SOM kmod-rtl8192cu
  48. SUPPORTED_DEVICES:=olimex,a13-olinuxino
  49. SUNXI_DTS:=sun5i-a13-olinuxino
  50. SUNXI_UBOOT:=OLIMEX_A13_SOM
  51. endef
  52. TARGET_DEVICES += sun5i-a13-olimex-som
  53. define Device/sun5i-a13-olinuxino
  54. DEVICE_TITLE:=Olimex A13-Olinuxino
  55. DEVICE_PACKAGES:=uboot-sunxi-A13-OLinuXino kmod-rtl8192cu
  56. SUPPORTED_DEVICES:=olimex,a13-olinuxino
  57. SUNXI_DTS:=sun5i-a13-olinuxino
  58. SUNXI_UBOOT:=A13-OLinuXino
  59. endef
  60. TARGET_DEVICES += sun5i-a13-olinuxino
  61. define Device/sun7i-a20-olinuxino-lime
  62. DEVICE_TITLE:=Olimex A20-OLinuXino-LIME
  63. DEVICE_PACKAGES:=uboot-sunxi-A20-OLinuXino-Lime kmod-ata-core kmod-ata-sunxi kmod-rtc-sunxi
  64. SUPPORTED_DEVICES:=olimex,a20-olinuxino-lime
  65. SUNXI_DTS:=sun7i-a20-olinuxino-lime
  66. SUNXI_UBOOT:=A20-OLinuXino-Lime
  67. endef
  68. TARGET_DEVICES += sun7i-a20-olinuxino-lime
  69. define Device/sun7i-a20-olinuxino-micro
  70. DEVICE_TITLE:=Olimex A20-Olinuxino Micro
  71. DEVICE_PACKAGES:=uboot-sunxi-A20-OLinuXino_MICRO kmod-ata-core kmod-ata-sunxi kmod-sun4i-emac kmod-rtc-sunxi
  72. SUPPORTED_DEVICES:=olimex,a20-olinuxino-micro
  73. SUNXI_DTS:=sun7i-a20-olinuxino-micro
  74. SUNXI_UBOOT:=A20-OLinuXino_MICRO
  75. endef
  76. TARGET_DEVICES += sun7i-a20-olinuxino-micro
  77. define Device/sun7i-a20-bananapi
  78. DEVICE_TITLE:=LeMaker Banana Pi
  79. DEVICE_PACKAGES:=uboot-sunxi-Bananapi kmod-rtc-sunxi kmod-ata-core kmod-ata-sunxi
  80. SUPPORTED_DEVICES:=lemaker,bananapi
  81. SUNXI_DTS:=sun7i-a20-bananapi
  82. SUNXI_UBOOT:=Bananapi
  83. endef
  84. TARGET_DEVICES += sun7i-a20-bananapi
  85. define Device/sun7i-a20-bananapro
  86. DEVICE_TITLE:=LeMaker Banana Pro
  87. DEVICE_PACKAGES:=uboot-sunxi-Bananapro kmod-rtc-sunxi kmod-ata-core kmod-ata-sunxi kmod-brcmfmac
  88. SUPPORTED_DEVICES:=lemaker,bananapro
  89. SUNXI_DTS:=sun7i-a20-bananapro
  90. SUNXI_UBOOT:=Bananapro
  91. endef
  92. TARGET_DEVICES += sun7i-a20-bananapro
  93. define Device/sun7i-a20-cubieboard2
  94. DEVICE_TITLE:=Cubietech Cubieboard2
  95. DEVICE_PACKAGES:=uboot-sunxi-Cubieboard2 kmod-ata-core kmod-ata-sunxi kmod-sun4i-emac kmod-rtc-sunxi
  96. SUPPORTED_DEVICES:=cubietech,cubieboard2
  97. SUNXI_DTS:=sun7i-a20-cubieboard2
  98. SUNXI_UBOOT:=Cubieboard2
  99. endef
  100. TARGET_DEVICES += sun7i-a20-cubieboard2
  101. define Device/sun4i-a10-cubieboard
  102. DEVICE_TITLE:=Cubietech Cubieboard
  103. DEVICE_PACKAGES:=uboot-sunxi-Cubieboard kmod-ata-core kmod-ata-sunxi kmod-sun4i-emac kmod-rtc-sunxi
  104. SUPPORTED_DEVICES:=cubietech,a10-cubieboard
  105. SUNXI_DTS:=sun4i-a10-cubieboard
  106. SUNXI_UBOOT:=Cubieboard
  107. endef
  108. TARGET_DEVICES += sun4i-a10-cubieboard
  109. define Device/sun7i-a20-cubietruck
  110. DEVICE_TITLE:=Cubietech Cubietruck
  111. DEVICE_PACKAGES:=uboot-sunxi-Cubietruck kmod-ata-core kmod-ata-sunxi kmod-rtc-sunxi kmod-brcmfmac
  112. SUPPORTED_DEVICES:=cubietech,cubietruck
  113. SUNXI_DTS:=sun7i-a20-cubietruck
  114. SUNXI_UBOOT:=Cubietruck
  115. endef
  116. TARGET_DEVICES += sun7i-a20-cubietruck
  117. define Device/sun7i-a20-lamobo-r1
  118. DEVICE_TITLE:=Lamobo R1
  119. DEVICE_PACKAGES:=uboot-sunxi-Lamobo_R1 kmod-ata-sunxi kmod-rtl8192cu swconfig wpad-mini
  120. SUPPORTED_DEVICES:=lamobo,lamobo-r1
  121. SUNXI_DTS:=sun7i-a20-lamobo-r1
  122. SUNXI_UBOOT:=Lamobo_R1
  123. endef
  124. TARGET_DEVICES += sun7i-a20-lamobo-r1
  125. define Device/sun6i-a31-m9
  126. DEVICE_TITLE:=Mele M9 top set box
  127. DEVICE_PACKAGES:=uboot-sunxi-Mele_M9 kmod-sun4i-emac kmod-rtc-sunxi kmod-rtl8192cu
  128. SUPPORTED_DEVICES:=mele,m9
  129. SUNXI_DTS:=sun6i-a31-m9
  130. SUNXI_UBOOT:=Mele_M9
  131. endef
  132. TARGET_DEVICES += sun6i-a31-m9
  133. define Device/sun8i-h3-orangepi-plus
  134. DEVICE_TITLE:=Xunlong Orange Pi Plus
  135. DEVICE_PACKAGES:=kmod-rtc-sunxi uboot-sunxi-orangepi_plus
  136. SUPPORTED_DEVICES:=xunlong,orangepi-plus
  137. SUNXI_DTS:=sun8i-h3-orangepi-plus
  138. SUNXI_UBOOT:=orangepi_plus
  139. endef
  140. TARGET_DEVICES += sun8i-h3-orangepi-plus
  141. define Device/sun7i-a20-pcduino3
  142. DEVICE_TITLE:=LinkSprite pcDuino3
  143. DEVICE_PACKAGES:=uboot-sunxi-Linksprite_pcDuino3 kmod-sun4i-emac kmod-rtc-sunxi kmod-ata-core kmod-ata-sunxi kmod-rtl8xxxu rtl8188eu-firmware
  144. SUPPORTED_DEVICES:=linksprite,pcduino3
  145. SUNXI_DTS:=sun7i-a20-pcduino3
  146. SUNXI_UBOOT:=Linksprite_pcDuino3
  147. endef
  148. TARGET_DEVICES += sun7i-a20-pcduino3
  149. define Device/sun4i-a10-pcduino
  150. DEVICE_TITLE:=LinkSprite pcDuino
  151. DEVICE_PACKAGES:=uboot-sunxi-Linksprite_pcDuino kmod-sun4i-emac kmod-rtc-sunxi kmod-rtl8192cu
  152. SUPPORTED_DEVICES:=linksprite,a10-pcduino
  153. SUNXI_DTS:=sun4i-a10-pcduino
  154. SUNXI_UBOOT:=Linksprite_pcDuino
  155. endef
  156. TARGET_DEVICES += sun4i-a10-pcduino
  157. $(eval $(call BuildImage))