Makefile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #
  2. # Copyright (C) 2016 Jiang Yutang <jiangyutang1978@gmail.com>
  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=$(KDIR)/$(1)-rcw.bin >> $@
  12. endef
  13. define Build/append-ls-uboot
  14. dd if=$(KDIR)/$(1)-$(SUBTARGET)-uboot.bin >> $@
  15. endef
  16. define Build/append-ls-fman
  17. dd if=$(KDIR)/$(1)-fman.bin >> $@
  18. endef
  19. define Build/append-ls-dtb
  20. $(call Image/BuildDTB,$(DTS_DIR)/$(1).dts,$(DTS_DIR)/$(1).dtb)
  21. dd if=$(DTS_DIR)/$(1).dtb >> $@
  22. endef
  23. define Build/append-ls-rootfs-ext4
  24. $(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)
  25. dd if=$(KDIR)/$(word 1,$(1))-$(word 2,$(1)).root.ext4 >> $@
  26. endef
  27. define Device/Default
  28. PROFILES = Default
  29. FILESYSTEMS := squashfs
  30. KERNEL := kernel-bin | gzip | uImage gzip
  31. DEVICE_DTS :=
  32. IMAGES = firmware.bin
  33. ifeq ($(SUBTARGET),64b)
  34. KERNEL_LOADADDR = 0x80080000
  35. KERNEL_ENTRY_POINT = 0x80080000
  36. endif
  37. ifeq ($(SUBTARGET),32b)
  38. KERNEL_LOADADDR = 0x80008000
  39. KERNEL_ENTRY_POINT = 0x80008000
  40. endif
  41. endef
  42. define Device/ls1043ardb
  43. DEVICE_TITLE := ls1043ardb-$(SUBTARGET)
  44. DEVICE_PACKAGES += rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb fman-layerscape-ls1043ardb
  45. ifeq ($(SUBTARGET),64b)
  46. DEVICE_DTS = freescale/fsl-ls1043a-rdb
  47. endif
  48. ifeq ($(SUBTARGET),32b)
  49. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1043a-rdb
  50. endif
  51. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | append-ls-uboot $(1) | pad-to 3M | \
  52. append-ls-fman $(1) | pad-to 4M | append-ls-dtb $$(DEVICE_DTS) | pad-to 5M | \
  53. append-kernel | pad-to 10M | append-rootfs | pad-rootfs | check-size 67108865
  54. endef
  55. TARGET_DEVICES += ls1043ardb
  56. define Device/ls1046ardb
  57. DEVICE_TITLE := ls1046ardb-$(SUBTARGET)
  58. DEVICE_PACKAGES += rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb fman-layerscape-ls1046ardb
  59. ifeq ($(SUBTARGET),64b)
  60. DEVICE_DTS = freescale/fsl-ls1046a-rdb
  61. endif
  62. ifeq ($(SUBTARGET),32b)
  63. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1046a-rdb
  64. endif
  65. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | append-ls-uboot $(1) | pad-to 3M | \
  66. append-ls-fman $(1) | pad-to 4M | append-ls-dtb $$(DEVICE_DTS) | pad-to 5M | \
  67. append-kernel | pad-to 10M | append-ls-rootfs-ext4 $(1) 22M | check-size 33554433
  68. endef
  69. TARGET_DEVICES += ls1046ardb
  70. define Device/ls1012ardb
  71. DEVICE_TITLE := ls1012ardb-$(SUBTARGET)
  72. DEVICE_PACKAGES += rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb kmod-ppfe ppfe-ls1012ardb
  73. ifeq ($(SUBTARGET),64b)
  74. DEVICE_DTS = freescale/fsl-ls1012a-rdb
  75. endif
  76. ifeq ($(SUBTARGET),32b)
  77. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-rdb
  78. endif
  79. IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | append-ls-uboot $(1) | pad-to 3M | \
  80. append-ls-dtb $$(DEVICE_DTS) | pad-to 4M | append-kernel | pad-to 9M | \
  81. append-ls-rootfs-ext4 $(1) 23M | check-size 33554433
  82. endef
  83. TARGET_DEVICES += ls1012ardb
  84. define Device/ls1088ardb
  85. DEVICE_TITLE := ls1088ardb-$(SUBTARGET)
  86. DEVICE_PACKAGES += rcw-layerscape-ls1088ardb uboot-layerscape-$(SUBTARGET)-ls1088ardb mc-binary-ls1088ardb
  87. ifeq ($(SUBTARGET),64b)
  88. DEVICE_DTS = freescale/fsl-ls1088a-rdb
  89. endif
  90. ifeq ($(SUBTARGET),32b)
  91. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1088a-rdb
  92. endif
  93. IMAGE/firmware.bin = append-ls-dtb $$(DEVICE_DTS) | pad-to 1M | append-kernel | pad-to 6M | \
  94. append-ls-rootfs-ext4 $(1) 17M | check-size 24117249
  95. endef
  96. TARGET_DEVICES += ls1088ardb
  97. define Device/ls2088ardb
  98. DEVICE_TITLE := ls2088ardb-$(SUBTARGET)
  99. DEVICE_PACKAGES += rcw-layerscape-ls2088ardb uboot-layerscape-$(SUBTARGET)-ls2088ardb mc-binary-ls2088ardb
  100. ifeq ($(SUBTARGET),64b)
  101. DEVICE_DTS = freescale/fsl-ls2088a-rdb
  102. endif
  103. ifeq ($(SUBTARGET),32b)
  104. DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls2088a-rdb
  105. endif
  106. IMAGE/firmware.bin = append-ls-dtb $$(DEVICE_DTS) | pad-to 1M | append-kernel | pad-to 6M | \
  107. append-rootfs | pad-rootfs | check-size 24117249
  108. endef
  109. TARGET_DEVICES += ls2088ardb
  110. $(eval $(call BuildImage))