Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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 $@.boot
  15. mkdir -p $@.boot
  16. $(CP) $@ $@.boot/$(IMG_PREFIX)-uImage
  17. ln -sf $(IMG_PREFIX)-uImage $@.boot/uImage
  18. $(foreach dts,$(DEVICE_DTS), \
  19. $(CP) \
  20. $(LINUX_DIR)/arch/$(ARCH)/boot/dts/$(dts).dtb \
  21. $@.boot/$(IMG_PREFIX)-$(dts).dtb; \
  22. ln -sf \
  23. $(IMG_PREFIX)-$(dts).dtb \
  24. $@.boot/$(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. $@.boot/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 $@.boot.ubifs -d $@.boot
  34. $(TAR) -C $@.boot -cf $@.boot.tar .
  35. endef
  36. define Build/bootfs.tar.gz
  37. rm -rf $@.boot
  38. mkdir -p $@.boot
  39. $(TAR) -C $@.boot -xf $(IMAGE_KERNEL).boot.tar
  40. $(TAR) -C $@.boot \
  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. imx6q-gw51xx \
  69. imx6q-gw52xx \
  70. imx6q-gw53xx \
  71. imx6q-gw54xx \
  72. imx6q-gw5400-a \
  73. imx6q-gw551x \
  74. imx6q-gw552x \
  75. imx6q-gw553x
  76. DEVICE_PACKAGES := kmod-sky2 kmod-sound-core kmod-sound-soc-imx kmod-sound-soc-imx-sgtl5000 \
  77. kmod-can kmod-can-flexcan kmod-can-raw \
  78. kmod-hwmon-gsc \
  79. kmod-leds-gpio kmod-pps-gpio \
  80. kobs-ng
  81. KERNEL += | boot-overlay
  82. IMAGES := nand.ubi bootfs.tar.gz
  83. UBINIZE_PARTS = boot=$$(KDIR_KERNEL_IMAGE).boot.ubifs=15
  84. IMAGE/nand.ubi := append-ubi
  85. IMAGE/bootfs.tar.gz := bootfs.tar.gz | install-dtb
  86. IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2)
  87. PAGESIZE := 2048
  88. BLOCKSIZE := 128k
  89. MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB
  90. endef
  91. define Device/ventana-large
  92. $(Device/ventana)
  93. DEVICE_NAME := ventana
  94. DEVICE_TITLE := Gateworks Ventana family (large NAND flash)
  95. IMAGES := nand.ubi
  96. PAGESIZE := 4096
  97. BLOCKSIZE := 256k
  98. MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB
  99. endef
  100. define Device/wandboard
  101. DEVICE_TITLE := Wandboard Dual
  102. DEVICE_DTS := imx6dl-wandboard
  103. endef
  104. TARGET_DEVICES += \
  105. ventana ventana-large \
  106. wandboard
  107. $(eval $(call BuildImage))