Makefile 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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 Build/append-ls-rootfs-ext4
  39. $(STAGING_DIR_HOST)/bin/make_ext4fs -l $(word 2,$(1)) -b 4096 -i 6000 -m 0 -J $(KDIR)/$(word 1,$(1))-$(word 2,$(1)).root.ext4 $(TARGET_DIR)
  40. dd if=$(KDIR)/$(word 1,$(1))-$(word 2,$(1)).root.ext4 >> $@
  41. endef
  42. define Device/Default
  43. PROFILES = Default
  44. FILESYSTEMS := squashfs
  45. DEVICE_DTS :=
  46. IMAGES = firmware.bin
  47. ifeq ($(SUBTARGET),armv8_64b)
  48. KERNEL := kernel-bin | gzip | uImage gzip
  49. KERNEL_LOADADDR = 0x80080000
  50. KERNEL_ENTRY_POINT = 0x80080000
  51. endif
  52. ifeq ($(SUBTARGET),armv8_32b)
  53. KERNEL := kernel-bin | uImage none
  54. KERNEL_NAME := zImage
  55. KERNEL_LOADADDR = 0x80008000
  56. KERNEL_ENTRY_POINT = 0x80008000
  57. endif
  58. endef
  59. define Device/ls1043ardb
  60. DEVICE_TITLE := ls1043ardb-$(SUBTARGET)
  61. DEVICE_PACKAGES += rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb \
  62. fman-layerscape-ls1043ardb layerscape-ppa-ls1043ardb
  63. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1043a-rdb-sdk
  64. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  65. append-ls-uboot $(1) | pad-to 4M | \
  66. append-ls-ppa $(1) | pad-to 9M | \
  67. append-ls-fman $(1) | pad-to 15M | \
  68. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  69. append-kernel | pad-to 32M | \
  70. append-rootfs | pad-rootfs | check-size 67108865
  71. endef
  72. TARGET_DEVICES += ls1043ardb
  73. define Device/ls1046ardb
  74. DEVICE_TITLE := ls1046ardb-$(SUBTARGET)
  75. DEVICE_PACKAGES += rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb \
  76. fman-layerscape-ls1046ardb layerscape-ppa-ls1046ardb
  77. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1046a-rdb-sdk
  78. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  79. append-ls-uboot $(1) | pad-to 4M | \
  80. append-ls-ppa $(1) | pad-to 9M | \
  81. append-ls-fman $(1) | pad-to 15M | \
  82. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  83. append-kernel | pad-to 32M | \
  84. append-ls-rootfs-ext4 $(1) 30M | check-size 67108865
  85. endef
  86. TARGET_DEVICES += ls1046ardb
  87. define Device/ls1012ardb
  88. DEVICE_TITLE := ls1012ardb-$(SUBTARGET)
  89. DEVICE_PACKAGES += rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb \
  90. kmod-ppfe layerscape-ppfe layerscape-ppa-ls1012ardb
  91. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-rdb
  92. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  93. append-ls-uboot $(1) | pad-to 4M | \
  94. append-ls-ppa $(1) | pad-to 10M | \
  95. append-ls-ppfe | pad-to 15M | \
  96. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  97. append-kernel | pad-to 32M | \
  98. append-ls-rootfs-ext4 $(1) 30M | check-size 67108865
  99. endef
  100. TARGET_DEVICES += ls1012ardb
  101. define Device/ls1012afrdm
  102. DEVICE_TITLE := ls1012afrdm-$(SUBTARGET)
  103. DEVICE_PACKAGES += rcw-layerscape-ls1012afrdm uboot-layerscape-$(SUBTARGET)-ls1012afrdm \
  104. kmod-ppfe layerscape-ppfe layerscape-ppa-ls1012afrdm
  105. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-frdm
  106. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  107. append-ls-uboot $(1) | pad-to 4M | \
  108. append-ls-ppa $(1) | pad-to 10M | \
  109. append-ls-ppfe | pad-to 15M | \
  110. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  111. append-kernel | pad-to 32M | \
  112. append-ls-rootfs-ext4 $(1) 30M | check-size 67108865
  113. endef
  114. TARGET_DEVICES += ls1012afrdm
  115. ifeq ($(SUBTARGET),armv8_64b)
  116. define Device/ls1088ardb
  117. DEVICE_TITLE := ls1088ardb-$(SUBTARGET)
  118. DEVICE_PACKAGES += rcw-layerscape-ls1088ardb uboot-layerscape-$(SUBTARGET)-ls1088ardb \
  119. layerscape-mc-ls1088ardb layerscape-dpl-ls1088ardb restool \
  120. layerscape-ppa-ls1088ardb
  121. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1088a-rdb
  122. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  123. append-ls-uboot $(1) | pad-to 4M | \
  124. append-ls-ppa $(1) | pad-to 10M | \
  125. append-ls-mc $(1) | pad-to 13M | \
  126. append-ls-dpl $(1) | pad-to 14M | \
  127. append-ls-dpc $(1) | pad-to 15M | \
  128. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  129. append-kernel | pad-to 32M | \
  130. append-ls-rootfs-ext4 $(1) 30M | check-size 67108865
  131. endef
  132. TARGET_DEVICES += ls1088ardb
  133. define Device/ls2088ardb
  134. DEVICE_TITLE := ls2088ardb-$(SUBTARGET)
  135. DEVICE_PACKAGES += rcw-layerscape-ls2088ardb uboot-layerscape-$(SUBTARGET)-ls2088ardb \
  136. layerscape-mc-ls2088ardb layerscape-dpl-ls2088ardb restool \
  137. layerscape-ppa-ls2088ardb
  138. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls2088a-rdb
  139. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
  140. append-ls-uboot $(1) | pad-to 4M | \
  141. append-ls-ppa $(1) | pad-to 10M | \
  142. append-ls-mc $(1) | pad-to 13M | \
  143. append-ls-dpl $(1) | pad-to 14M | \
  144. append-ls-dpc $(1) | pad-to 15M | \
  145. append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
  146. append-kernel | pad-to 32M | \
  147. append-rootfs | pad-rootfs | check-size 67108865
  148. endef
  149. TARGET_DEVICES += ls2088ardb
  150. endif
  151. $(eval $(call BuildImage))