Makefile 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. #
  2. # Copyright (C) 2016 Jiang Yutang <[email protected]>
  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. ITB_BOARDS = traverse-five64
  10. define Build/append-ls-rcw
  11. rm -f $@
  12. dd if=$(STAGING_DIR_IMAGE)/$(1)-rcw.bin >> $@
  13. endef
  14. define Build/append-ls-uboot
  15. dd if=$(STAGING_DIR_IMAGE)/$(1)-$(SUBTARGET)-uboot.bin >> $@
  16. endef
  17. define Build/append-ls-ppa
  18. dd if=$(STAGING_DIR_IMAGE)/$(1)-ppa.itb >> $@
  19. endef
  20. define Build/append-ls-fman
  21. dd if=$(STAGING_DIR_IMAGE)/$(1)-fman.bin >> $@
  22. endef
  23. define Build/append-ls-mc
  24. dd if=$(STAGING_DIR_IMAGE)/$(1)-mc.itb >> $@
  25. endef
  26. define Build/append-ls-ppfe
  27. dd if=$(STAGING_DIR_IMAGE)/pfe.itb >> $@
  28. endef
  29. define Build/append-ls-dpl
  30. dd if=$(STAGING_DIR_IMAGE)/$(1)-dpl.dtb >> $@
  31. endef
  32. define Build/append-ls-dpc
  33. dd if=$(STAGING_DIR_IMAGE)/$(1)-dpc.dtb >> $@
  34. endef
  35. define Build/append-ls-dtb
  36. $(call Image/BuildDTB,$(DTS_DIR)/$(1).dts,$(DTS_DIR)/$(1).dtb)
  37. dd if=$(DTS_DIR)/$(1).dtb >> $@
  38. endef
  39. define Build/traverse-fit
  40. ./mkits-multiple-config.sh -o [email protected] -A $(LINUX_KARCH) -v $(LINUX_VERSION) \
  41. -k $@ -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
  42. -C gzip -c 1 -c 2 \
  43. -d $(DEVICE_DTS_DIR)/freescale/traverse-ls1043s.dtb -D "Traverse_LS1043S" -n "ls1043s" -a $(FDT_LOADADDR) -c 1 \
  44. -d $(DEVICE_DTS_DIR)/freescale/traverse-ls1043v.dtb -D "Traverse_LS1043V" -n "ls1043v" -a $(FDT_LOADADDR) -c 2
  45. PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f [email protected] [email protected]
  46. @mv -f [email protected] $@
  47. endef
  48. define Device/Default
  49. PROFILES = Default
  50. FILESYSTEMS := squashfs
  51. DEVICE_DTS :=
  52. IMAGES = firmware.bin
  53. ifeq ($(SUBTARGET),armv8_64b)
  54. KERNEL := kernel-bin | gzip | uImage gzip
  55. KERNEL_LOADADDR = 0x80080000
  56. KERNEL_ENTRY_POINT = 0x80080000
  57. endif
  58. ifeq ($(SUBTARGET),armv8_32b)
  59. KERNEL := kernel-bin | uImage none
  60. KERNEL_NAME := zImage
  61. KERNEL_LOADADDR = 0x80008000
  62. KERNEL_ENTRY_POINT = 0x80008000
  63. endif
  64. FDT_LOADADDR = 0x90000000
  65. endef
  66. define Device/ls1043ardb
  67. DEVICE_TITLE := ls1043ardb-$(SUBTARGET)
  68. DEVICE_PACKAGES += rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb \
  69. fman-layerscape-ls1043ardb layerscape-ppa-ls1043ardb
  70. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1043a-rdb-sdk
  71. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  72. append-ls-uboot $(1) | pad-to 4M | \
  73. append-ls-ppa $(1) | pad-to 9M | \
  74. append-ls-fman $(1) | pad-to 15M | \
  75. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  76. append-kernel | pad-to 32M | \
  77. append-rootfs | pad-rootfs | check-size 67108865
  78. endef
  79. TARGET_DEVICES += ls1043ardb
  80. define Device/ls1046ardb
  81. DEVICE_TITLE := ls1046ardb-$(SUBTARGET)
  82. DEVICE_PACKAGES += rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb \
  83. fman-layerscape-ls1046ardb layerscape-ppa-ls1046ardb
  84. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1046a-rdb-sdk
  85. FILESYSTEMS := ubifs
  86. UBIFS_OPTS := -m 1 -e 262016 -c 128
  87. UBINIZE_OPTS := -E 5
  88. BLOCKSIZE := 256KiB
  89. PAGESIZE := 1
  90. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  91. append-ls-uboot $(1) | pad-to 4M | \
  92. append-ls-ppa $(1) | pad-to 9M | \
  93. append-ls-fman $(1) | pad-to 15M | \
  94. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  95. append-kernel | pad-to 32M | \
  96. append-ubi | check-size 67108865
  97. endef
  98. TARGET_DEVICES += ls1046ardb
  99. define Device/ls1012ardb
  100. DEVICE_TITLE := ls1012ardb-$(SUBTARGET)
  101. DEVICE_PACKAGES += rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb \
  102. kmod-ppfe layerscape-ppfe layerscape-ppa-ls1012ardb
  103. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-rdb
  104. FILESYSTEMS := ubifs
  105. UBIFS_OPTS := -m 1 -e 262016 -c 128
  106. UBINIZE_OPTS := -E 5
  107. BLOCKSIZE := 256KiB
  108. PAGESIZE := 1
  109. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  110. append-ls-uboot $(1) | pad-to 4M | \
  111. append-ls-ppa $(1) | pad-to 10M | \
  112. append-ls-ppfe | pad-to 15M | \
  113. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  114. append-kernel | pad-to 32M | \
  115. append-ubi | check-size 67108865
  116. endef
  117. TARGET_DEVICES += ls1012ardb
  118. define Device/ls1012afrdm
  119. DEVICE_TITLE := ls1012afrdm-$(SUBTARGET)
  120. DEVICE_PACKAGES += rcw-layerscape-ls1012afrdm uboot-layerscape-$(SUBTARGET)-ls1012afrdm \
  121. kmod-ppfe layerscape-ppfe layerscape-ppa-ls1012afrdm
  122. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-frdm
  123. FILESYSTEMS := ubifs
  124. UBIFS_OPTS := -m 1 -e 262016 -c 128
  125. UBINIZE_OPTS := -E 5
  126. BLOCKSIZE := 256KiB
  127. PAGESIZE := 1
  128. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  129. append-ls-uboot $(1) | pad-to 4M | \
  130. append-ls-ppa $(1) | pad-to 10M | \
  131. append-ls-ppfe | pad-to 15M | \
  132. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  133. append-kernel | pad-to 32M | \
  134. append-ubi | check-size 67108865
  135. endef
  136. TARGET_DEVICES += ls1012afrdm
  137. ifeq ($(SUBTARGET),armv8_64b)
  138. define Device/ls1088ardb
  139. DEVICE_TITLE := ls1088ardb-$(SUBTARGET)
  140. DEVICE_PACKAGES += rcw-layerscape-ls1088ardb uboot-layerscape-$(SUBTARGET)-ls1088ardb \
  141. layerscape-mc-ls1088ardb layerscape-dpl-ls1088ardb restool \
  142. layerscape-ppa-ls1088ardb
  143. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1088a-rdb
  144. FILESYSTEMS := ubifs
  145. UBIFS_OPTS := -m 1 -e 262016 -c 128
  146. UBINIZE_OPTS := -E 5
  147. BLOCKSIZE := 256KiB
  148. PAGESIZE := 1
  149. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  150. append-ls-uboot $(1) | pad-to 4M | \
  151. append-ls-ppa $(1) | pad-to 10M | \
  152. append-ls-mc $(1) | pad-to 13M | \
  153. append-ls-dpl $(1) | pad-to 14M | \
  154. append-ls-dpc $(1) | pad-to 15M | \
  155. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  156. append-kernel | pad-to 32M | \
  157. append-ubi | check-size 67108865
  158. endef
  159. TARGET_DEVICES += ls1088ardb
  160. define Device/ls2088ardb
  161. DEVICE_TITLE := ls2088ardb-$(SUBTARGET)
  162. DEVICE_PACKAGES += rcw-layerscape-ls2088ardb uboot-layerscape-$(SUBTARGET)-ls2088ardb \
  163. layerscape-mc-ls2088ardb layerscape-dpl-ls2088ardb restool \
  164. layerscape-ppa-ls2088ardb
  165. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls2088a-rdb
  166. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  167. append-ls-uboot $(1) | pad-to 4M | \
  168. append-ls-ppa $(1) | pad-to 10M | \
  169. append-ls-mc $(1) | pad-to 13M | \
  170. append-ls-dpl $(1) | pad-to 14M | \
  171. append-ls-dpc $(1) | pad-to 15M | \
  172. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  173. append-kernel | pad-to 32M | \
  174. append-rootfs | pad-rootfs | check-size 67108865
  175. endef
  176. TARGET_DEVICES += ls2088ardb
  177. endif
  178. define Device/traverse-five64
  179. KERNEL_NAME := Image
  180. KERNEL_SUFFIX := -kernel.itb
  181. KERNEL_INSTALL := 1
  182. FILESYSTEMS := ubifs
  183. DEVICE_TITLE := Traverse LS1043 Boards (Five64, LS1043S)
  184. DEVICE_PACKAGES += fman-layerscape-ls1043ardb kmod-i2c-core kmod-rtc-isl1208 uboot-envtools \
  185. uboot-traverse-ls1043v uboot-traverse-ls1043v-sdcard \
  186. kmod-hwmon-core kmod-hwmon-ltc2990 kmod-gpio-pca953x kmod-input-gpio-keys-polled \
  187. kmod-i2c-mux-pca954x kmod-hwmon-pac1934 kmod-hwmon-emc17xx
  188. DEVICE_DESCRIPTION = Build images for Traverse LS1043 boards. This generates a single image \
  189. capable of booting on any of the boards in this family.
  190. DEVICE_DTS = freescale/traverse-ls1043s
  191. DEVICE_DTS_DIR = $(LINUX_DIR)/arch/arm64/boot/dts
  192. DEVICE_DTS_CONFIG = ls1043s
  193. KERNEL := kernel-bin | gzip | traverse-fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb $$(FDT_LOADADDR)
  194. KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb $$(FDT_LOADADDR)
  195. IMAGES = root sysupgrade.tar
  196. IMAGE/root = append-rootfs
  197. IMAGE/sysupgrade.tar = sysupgrade-tar
  198. UBIFS_OPTS := -m 2048 -e 124KiB -c 4096
  199. endef
  200. TARGET_DEVICES += traverse-five64
  201. $(eval $(call BuildImage))