2
0

Makefile 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. define Build/append-ls-rcw
  10. rm -f $@
  11. dd if=$(STAGING_DIR_IMAGE)/$(1)-rcw.bin >> $@
  12. endef
  13. define Build/append-ls-uboot
  14. dd if=$(STAGING_DIR_IMAGE)/$(1)-$(SUBTARGET)-uboot.bin >> $@
  15. endef
  16. define Build/append-ls-ppa
  17. dd if=$(STAGING_DIR_IMAGE)/$(1)-ppa.itb >> $@
  18. endef
  19. define Build/append-ls-fman
  20. dd if=$(STAGING_DIR_IMAGE)/$(1)-fman.bin >> $@
  21. endef
  22. define Build/append-ls-mc
  23. dd if=$(STAGING_DIR_IMAGE)/$(1)-mc.itb >> $@
  24. endef
  25. define Build/append-ls-ppfe
  26. dd if=$(STAGING_DIR_IMAGE)/pfe.itb >> $@
  27. endef
  28. define Build/append-ls-dpl
  29. dd if=$(STAGING_DIR_IMAGE)/$(1)-dpl.dtb >> $@
  30. endef
  31. define Build/append-ls-dpc
  32. dd if=$(STAGING_DIR_IMAGE)/$(1)-dpc.dtb >> $@
  33. endef
  34. define Build/append-ls-dtb
  35. $(call Image/BuildDTB,$(DTS_DIR)/$(1).dts,$(DTS_DIR)/$(1).dtb)
  36. dd if=$(DTS_DIR)/$(1).dtb >> $@
  37. endef
  38. define Device/Default
  39. PROFILES = Default
  40. FILESYSTEMS := squashfs
  41. DEVICE_DTS :=
  42. IMAGES = firmware.bin
  43. ifeq ($(SUBTARGET),armv8_64b)
  44. KERNEL := kernel-bin | gzip | uImage gzip
  45. KERNEL_LOADADDR = 0x80080000
  46. KERNEL_ENTRY_POINT = 0x80080000
  47. endif
  48. ifeq ($(SUBTARGET),armv8_32b)
  49. KERNEL := kernel-bin | uImage none
  50. KERNEL_NAME := zImage
  51. KERNEL_LOADADDR = 0x80008000
  52. KERNEL_ENTRY_POINT = 0x80008000
  53. endif
  54. endef
  55. define Device/ls1043ardb
  56. DEVICE_TITLE := ls1043ardb-$(SUBTARGET)
  57. DEVICE_PACKAGES += rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb \
  58. fman-layerscape-ls1043ardb layerscape-ppa-ls1043ardb
  59. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1043a-rdb-sdk
  60. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  61. append-ls-uboot $(1) | pad-to 4M | \
  62. append-ls-ppa $(1) | pad-to 9M | \
  63. append-ls-fman $(1) | pad-to 15M | \
  64. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  65. append-kernel | pad-to 32M | \
  66. append-rootfs | pad-rootfs | check-size 67108865
  67. endef
  68. TARGET_DEVICES += ls1043ardb
  69. define Device/ls1046ardb
  70. DEVICE_TITLE := ls1046ardb-$(SUBTARGET)
  71. DEVICE_PACKAGES += rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb \
  72. fman-layerscape-ls1046ardb layerscape-ppa-ls1046ardb
  73. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1046a-rdb-sdk
  74. FILESYSTEMS := ubifs
  75. UBIFS_OPTS := -m 1 -e 262016 -c 128
  76. UBINIZE_OPTS := -E 5
  77. BLOCKSIZE := 256KiB
  78. PAGESIZE := 1
  79. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  80. append-ls-uboot $(1) | pad-to 4M | \
  81. append-ls-ppa $(1) | pad-to 9M | \
  82. append-ls-fman $(1) | pad-to 15M | \
  83. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  84. append-kernel | pad-to 32M | \
  85. append-ubi | check-size 67108865
  86. endef
  87. TARGET_DEVICES += ls1046ardb
  88. define Device/ls1012ardb
  89. DEVICE_TITLE := ls1012ardb-$(SUBTARGET)
  90. DEVICE_PACKAGES += rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb \
  91. kmod-ppfe layerscape-ppfe layerscape-ppa-ls1012ardb
  92. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-rdb
  93. FILESYSTEMS := ubifs
  94. UBIFS_OPTS := -m 1 -e 262016 -c 128
  95. UBINIZE_OPTS := -E 5
  96. BLOCKSIZE := 256KiB
  97. PAGESIZE := 1
  98. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  99. append-ls-uboot $(1) | pad-to 4M | \
  100. append-ls-ppa $(1) | pad-to 10M | \
  101. append-ls-ppfe | pad-to 15M | \
  102. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  103. append-kernel | pad-to 32M | \
  104. append-ubi | check-size 67108865
  105. endef
  106. TARGET_DEVICES += ls1012ardb
  107. define Device/ls1012afrdm
  108. DEVICE_TITLE := ls1012afrdm-$(SUBTARGET)
  109. DEVICE_PACKAGES += rcw-layerscape-ls1012afrdm uboot-layerscape-$(SUBTARGET)-ls1012afrdm \
  110. kmod-ppfe layerscape-ppfe layerscape-ppa-ls1012afrdm
  111. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-frdm
  112. FILESYSTEMS := ubifs
  113. UBIFS_OPTS := -m 1 -e 262016 -c 128
  114. UBINIZE_OPTS := -E 5
  115. BLOCKSIZE := 256KiB
  116. PAGESIZE := 1
  117. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  118. append-ls-uboot $(1) | pad-to 4M | \
  119. append-ls-ppa $(1) | pad-to 10M | \
  120. append-ls-ppfe | pad-to 15M | \
  121. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  122. append-kernel | pad-to 32M | \
  123. append-ubi | check-size 67108865
  124. endef
  125. TARGET_DEVICES += ls1012afrdm
  126. ifeq ($(SUBTARGET),armv8_64b)
  127. define Device/ls1088ardb
  128. DEVICE_TITLE := ls1088ardb-$(SUBTARGET)
  129. DEVICE_PACKAGES += rcw-layerscape-ls1088ardb uboot-layerscape-$(SUBTARGET)-ls1088ardb \
  130. layerscape-mc-ls1088ardb layerscape-dpl-ls1088ardb restool \
  131. layerscape-ppa-ls1088ardb
  132. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1088a-rdb
  133. FILESYSTEMS := ubifs
  134. UBIFS_OPTS := -m 1 -e 262016 -c 128
  135. UBINIZE_OPTS := -E 5
  136. BLOCKSIZE := 256KiB
  137. PAGESIZE := 1
  138. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  139. append-ls-uboot $(1) | pad-to 4M | \
  140. append-ls-ppa $(1) | pad-to 10M | \
  141. append-ls-mc $(1) | pad-to 13M | \
  142. append-ls-dpl $(1) | pad-to 14M | \
  143. append-ls-dpc $(1) | pad-to 15M | \
  144. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  145. append-kernel | pad-to 32M | \
  146. append-ubi | check-size 67108865
  147. endef
  148. TARGET_DEVICES += ls1088ardb
  149. define Device/ls2088ardb
  150. DEVICE_TITLE := ls2088ardb-$(SUBTARGET)
  151. DEVICE_PACKAGES += rcw-layerscape-ls2088ardb uboot-layerscape-$(SUBTARGET)-ls2088ardb \
  152. layerscape-mc-ls2088ardb layerscape-dpl-ls2088ardb restool \
  153. layerscape-ppa-ls2088ardb
  154. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls2088a-rdb
  155. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  156. append-ls-uboot $(1) | pad-to 4M | \
  157. append-ls-ppa $(1) | pad-to 10M | \
  158. append-ls-mc $(1) | pad-to 13M | \
  159. append-ls-dpl $(1) | pad-to 14M | \
  160. append-ls-dpc $(1) | pad-to 15M | \
  161. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  162. append-kernel | pad-to 32M | \
  163. append-rootfs | pad-rootfs | check-size 67108865
  164. endef
  165. TARGET_DEVICES += ls2088ardb
  166. endif
  167. $(eval $(call BuildImage))