Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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
  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. #################################################
  45. # Devices
  46. #################################################
  47. KERNEL_LOADADDR=0x10008000
  48. define Device/Default
  49. PROFILES := Generic
  50. FILESYSTEMS := squashfs ext4
  51. KERNEL_INSTALL := 1
  52. KERNEL_SUFFIX := -uImage
  53. KERNEL_NAME := zImage
  54. KERNEL_PREFIX := $$(IMAGE_PREFIX)
  55. KERNEL := kernel-bin | uImage none
  56. IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
  57. IMAGES :=
  58. endef
  59. define Device/ventana
  60. DEVICE_TITLE := Gateworks Ventana family (normal NAND flash)
  61. DEVICE_DTS:= \
  62. imx6dl-gw51xx \
  63. imx6dl-gw52xx \
  64. imx6dl-gw53xx \
  65. imx6dl-gw54xx \
  66. imx6dl-gw551x \
  67. imx6dl-gw552x \
  68. imx6dl-gw553x \
  69. imx6dl-gw5904 \
  70. imx6q-gw51xx \
  71. imx6q-gw52xx \
  72. imx6q-gw53xx \
  73. imx6q-gw54xx \
  74. imx6q-gw5400-a \
  75. imx6q-gw551x \
  76. imx6q-gw552x \
  77. imx6q-gw553x \
  78. imx6q-gw5904
  79. DEVICE_PACKAGES := kmod-sky2 kmod-sound-core kmod-sound-soc-imx kmod-sound-soc-imx-sgtl5000 \
  80. kmod-can kmod-can-flexcan kmod-can-raw \
  81. kmod-hwmon-gsc \
  82. kmod-leds-gpio kmod-pps-gpio \
  83. kobs-ng
  84. KERNEL += | boot-overlay
  85. IMAGES := nand.ubi bootfs.tar.gz
  86. UBINIZE_PARTS = boot=$$(KDIR_KERNEL_IMAGE).boot.ubifs=15
  87. IMAGE/nand.ubi := append-ubi
  88. IMAGE/bootfs.tar.gz := bootfs.tar.gz | install-dtb
  89. IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2)
  90. PAGESIZE := 2048
  91. BLOCKSIZE := 128k
  92. MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB
  93. endef
  94. TARGET_DEVICES += ventana
  95. define Device/ventana-large
  96. $(Device/ventana)
  97. DEVICE_NAME := ventana
  98. DEVICE_TITLE := Gateworks Ventana family (large NAND flash)
  99. IMAGES := nand.ubi
  100. PAGESIZE := 4096
  101. BLOCKSIZE := 256k
  102. MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB
  103. endef
  104. TARGET_DEVICES += ventana-large
  105. define Device/wandboard
  106. DEVICE_TITLE := Wandboard Dual
  107. DEVICE_DTS := imx6dl-wandboard
  108. endef
  109. TARGET_DEVICES += wandboard
  110. $(eval $(call BuildImage))