Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. #
  3. # Copyright (C) 2015 OpenWrt.org
  4. include $(TOPDIR)/rules.mk
  5. include $(INCLUDE_DIR)/image.mk
  6. FAT32_BLOCK_SIZE=1024
  7. FAT32_BLOCKS=$(shell echo $$(($(CONFIG_TARGET_KERNEL_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
  8. define Build/zynq-sdcard
  9. rm -f [email protected]
  10. mkfs.fat [email protected] -C $(FAT32_BLOCKS)
  11. mcopy -i [email protected] $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-boot.bin ::boot.bin
  12. mcopy -i [email protected] $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-u-boot.img ::u-boot.img
  13. mcopy -i [email protected] $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-uEnv.txt ::uEnv.txt
  14. mcopy -i [email protected] $(IMAGE_KERNEL) ::fit.itb
  15. ./gen_zynq_sdcard_img.sh $@ \
  16. [email protected] \
  17. $(IMAGE_ROOTFS) \
  18. $(CONFIG_TARGET_KERNEL_PARTSIZE) \
  19. $(CONFIG_TARGET_ROOTFS_PARTSIZE)
  20. rm -f [email protected]
  21. endef
  22. #################################################
  23. # Default and templates
  24. #################################################
  25. define Device/Default
  26. PROFILES := Default
  27. DEVICE_DTS := $(lastword $(subst _, ,$(1)))
  28. KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
  29. KERNEL_LOADADDR := 0x8000
  30. IMAGES := sdcard.img.gz
  31. IMAGE/sdcard.img.gz := zynq-sdcard | gzip
  32. endef
  33. define Device/FitImageGzip
  34. KERNEL_SUFFIX := -fit-uImage.itb
  35. KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
  36. KERNEL_NAME := Image
  37. endef
  38. #################################################
  39. # Devices
  40. #################################################
  41. define Device/avnet_zynq-zed
  42. $(call Device/FitImageGzip)
  43. DEVICE_VENDOR := Avnet
  44. DEVICE_MODEL := ZedBoard
  45. endef
  46. TARGET_DEVICES += avnet_zynq-zed
  47. define Device/digilent_zynq-zybo
  48. $(call Device/FitImageGzip)
  49. DEVICE_VENDOR := Digilent
  50. DEVICE_MODEL := Zybo
  51. endef
  52. TARGET_DEVICES += digilent_zynq-zybo
  53. define Device/digilent_zynq-zybo-z7
  54. $(call Device/FitImageGzip)
  55. DEVICE_VENDOR := Digilent
  56. DEVICE_MODEL := Zybo Z7
  57. endef
  58. TARGET_DEVICES += digilent_zynq-zybo-z7
  59. define Device/xlnx_zynq-zc702
  60. $(call Device/FitImageGzip)
  61. DEVICE_VENDOR := Xilinx
  62. DEVICE_MODEL := ZC702
  63. DEVICE_PACKAGES:=kmod-can kmod-can-xilinx-can
  64. endef
  65. TARGET_DEVICES += xlnx_zynq-zc702
  66. $(eval $(call BuildImage))