2
0

Makefile 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. #
  2. # Copyright (C) 2013 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/image.mk
  9. #################################################
  10. # Images
  11. #################################################
  12. DEVICE_VARS += MKUBIFS_OPTS UBOOT BOOT_SCRIPT
  13. define Build/boot-overlay
  14. rm -rf [email protected]
  15. mkdir -p [email protected]
  16. $(CP) $@ [email protected]/$(IMG_PREFIX)-uImage
  17. ln -sf $(IMG_PREFIX)-uImage [email protected]/uImage
  18. $(foreach dts,$(DEVICE_DTS), \
  19. $(CP) \
  20. $(DTS_DIR)/$(dts).dtb \
  21. [email protected]/$(IMG_PREFIX)-$(dts).dtb; \
  22. ln -sf \
  23. $(IMG_PREFIX)-$(dts).dtb \
  24. [email protected]/$(dts).dtb; \
  25. )
  26. mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
  27. -n '$(DEVICE_ID) OpenWrt bootscript' \
  28. -d ./bootscript-$(DEVICE_NAME) \
  29. [email protected]/6x_bootscript-$(DEVICE_NAME)
  30. $(STAGING_DIR_HOST)/bin/mkfs.ubifs \
  31. --space-fixup --compr=zlib --squash-uids \
  32. $(MKUBIFS_OPTS) -c 8124 \
  33. -o [email protected] -d [email protected]
  34. $(TAR) -C [email protected] -cf [email protected] .
  35. endef
  36. define Build/bootfs.tar.gz
  37. rm -rf [email protected]
  38. mkdir -p [email protected]
  39. $(TAR) -C [email protected] -xf $(IMAGE_KERNEL).boot.tar
  40. $(TAR) -C [email protected] \
  41. --numeric-owner --owner=0 --group=0 --transform "s,./,./boot/," \
  42. -czvf $@ .
  43. endef
  44. define Build/boot-scr
  45. mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
  46. -n '$(DEVICE_ID) OpenWrt bootscript' \
  47. -d ./bootscript-$(DEVICE_NAME) \
  48. $(BIN_DIR)/boot.scr
  49. endef
  50. define Build/imx6-sdcard
  51. rm -rf [email protected]
  52. mkdir -p [email protected]
  53. $(CP) $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.img [email protected]/u-boot.img
  54. $(CP) $(IMAGE_KERNEL) [email protected]/uImage
  55. $(foreach dts,$(DEVICE_DTS), \
  56. $(CP) \
  57. $(DTS_DIR)/$(dts).dtb \
  58. [email protected]/;
  59. )
  60. mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
  61. -n '$(DEVICE_ID) OpenWrt bootscript' \
  62. -d $(BOOT_SCRIPT) \
  63. [email protected]/boot.scr
  64. cp $@ [email protected]
  65. $(SCRIPT_DIR)/gen_image_generic.sh $@ \
  66. $(CONFIG_TARGET_KERNEL_PARTSIZE) \
  67. [email protected] \
  68. $(CONFIG_TARGET_ROOTFS_PARTSIZE) \
  69. [email protected] \
  70. 1024
  71. dd if=$(STAGING_DIR_IMAGE)/$(UBOOT)-SPL of=$@ bs=1024 seek=1 conv=notrunc
  72. rm -rf [email protected] [email protected]
  73. endef
  74. #################################################
  75. # Devices
  76. #################################################
  77. KERNEL_LOADADDR=0x10008000
  78. define Device/Default
  79. PROFILES := Generic
  80. FILESYSTEMS := squashfs ext4
  81. KERNEL_INSTALL := 1
  82. KERNEL_SUFFIX := -uImage
  83. KERNEL_NAME := zImage
  84. KERNEL_PREFIX := $$(IMAGE_PREFIX)
  85. KERNEL := kernel-bin | uImage none
  86. IMAGES :=
  87. endef
  88. define Device/ventana
  89. DEVICE_TITLE := Gateworks Ventana family (normal NAND flash)
  90. DEVICE_DTS:= \
  91. imx6dl-gw51xx \
  92. imx6dl-gw52xx \
  93. imx6dl-gw53xx \
  94. imx6dl-gw54xx \
  95. imx6dl-gw551x \
  96. imx6dl-gw552x \
  97. imx6dl-gw553x \
  98. imx6dl-gw5904 \
  99. imx6q-gw51xx \
  100. imx6q-gw52xx \
  101. imx6q-gw53xx \
  102. imx6q-gw54xx \
  103. imx6q-gw5400-a \
  104. imx6q-gw551x \
  105. imx6q-gw552x \
  106. imx6q-gw553x \
  107. imx6q-gw5904
  108. DEVICE_PACKAGES := kmod-sky2 kmod-sound-core kmod-sound-soc-imx kmod-sound-soc-imx-sgtl5000 \
  109. kmod-can kmod-can-flexcan kmod-can-raw \
  110. kmod-hwmon-gsc \
  111. kmod-leds-gpio kmod-pps-gpio \
  112. kobs-ng
  113. KERNEL += | boot-overlay
  114. IMAGES := nand.ubi bootfs.tar.gz
  115. IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
  116. UBINIZE_PARTS = boot=$$(KDIR_KERNEL_IMAGE).boot.ubifs=15
  117. BOOT_SCRIPT := bootscript-ventana
  118. IMAGE/nand.ubi := append-ubi
  119. IMAGE/bootfs.tar.gz := bootfs.tar.gz | install-dtb
  120. IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2)
  121. PAGESIZE := 2048
  122. BLOCKSIZE := 128k
  123. MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB
  124. endef
  125. TARGET_DEVICES += ventana
  126. define Device/ventana-large
  127. $(Device/ventana)
  128. DEVICE_NAME := ventana
  129. DEVICE_TITLE := Gateworks Ventana family (large NAND flash)
  130. IMAGES := nand.ubi
  131. PAGESIZE := 4096
  132. BLOCKSIZE := 256k
  133. MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB
  134. endef
  135. TARGET_DEVICES += ventana-large
  136. define Device/wandboard
  137. DEVICE_TITLE := Wandboard Dual
  138. DEVICE_DTS := imx6dl-wandboard
  139. endef
  140. TARGET_DEVICES += wandboard
  141. define Device/cubox-i
  142. KERNEL := kernel-bin | install-dtb
  143. UBOOT := mx6cuboxi
  144. BOOT_SCRIPT = bootscript-cubox
  145. DEVICE_NAME := cubox
  146. DEVICE_TITLE := SolidRun CuBox-i
  147. DEVICE_PACKAGES := kmod-drm-imx kmod-drm-imx-hdmi kmod-usb-hid
  148. DEVICE_DTS := imx6q-cubox-i imx6dl-cubox-i imx6q-hummingboard imx6dl-hummingboard
  149. IMAGES := combined.bin
  150. FILESYSTEMS := squashfs
  151. IMAGE/combined.bin := append-rootfs | pad-extra 128k | imx6-sdcard
  152. endef
  153. TARGET_DEVICES += cubox-i
  154. $(eval $(call BuildImage))