Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. DTS_DIR := $(DTS_DIR)/xilinx
  28. DEVICE_DTS := $(lastword $(subst _, ,$(1)))
  29. KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
  30. KERNEL_LOADADDR := 0x8000
  31. IMAGES := sdcard.img.gz
  32. IMAGE/sdcard.img.gz := zynq-sdcard | gzip
  33. endef
  34. define Device/FitImageGzip
  35. KERNEL_SUFFIX := -fit-uImage.itb
  36. KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
  37. KERNEL_NAME := Image
  38. endef
  39. #################################################
  40. # Devices
  41. #################################################
  42. define Device/avnet_zynq-zed
  43. $(call Device/FitImageGzip)
  44. DEVICE_VENDOR := Avnet
  45. DEVICE_MODEL := ZedBoard
  46. endef
  47. TARGET_DEVICES += avnet_zynq-zed
  48. define Device/digilent_zynq-zybo
  49. $(call Device/FitImageGzip)
  50. DEVICE_VENDOR := Digilent
  51. DEVICE_MODEL := Zybo
  52. endef
  53. TARGET_DEVICES += digilent_zynq-zybo
  54. define Device/digilent_zynq-zybo-z7
  55. $(call Device/FitImageGzip)
  56. DEVICE_VENDOR := Digilent
  57. DEVICE_MODEL := Zybo Z7
  58. endef
  59. TARGET_DEVICES += digilent_zynq-zybo-z7
  60. define Device/xlnx_zynq-zc702
  61. $(call Device/FitImageGzip)
  62. DEVICE_VENDOR := Xilinx
  63. DEVICE_MODEL := ZC702
  64. DEVICE_PACKAGES:=kmod-can kmod-can-xilinx-can
  65. endef
  66. TARGET_DEVICES += xlnx_zynq-zc702
  67. $(eval $(call BuildImage))