Makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. #
  3. # Copyright (C) 2006-2013 OpenWrt.org
  4. include $(TOPDIR)/rules.mk
  5. include $(INCLUDE_DIR)/image.mk
  6. KERNEL_LOADADDR := 0x20008000
  7. define Build/at91-install-zImage
  8. $(CP) $(KDIR)/zImage $@
  9. endef
  10. include $(SUBTARGET).mk
  11. AT91_SD_BOOT_PARTSIZE:=64
  12. FAT32_BLOCK_SIZE:=1024
  13. FAT32_BLOCKS:=$(shell echo \
  14. $$(($(AT91_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
  15. define Device/Default
  16. $(Device/default-nand)
  17. PROFILES := Default
  18. FILESYSTEMS := squashfs ubifs ext4
  19. DEVICE_DTS = $(lastword $(subst _, ,$(1)))
  20. KERNEL_NAME := zImage
  21. KERNEL_SIZE := 4096k
  22. KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
  23. DTB_SIZE := 128k
  24. endef
  25. define Device/dtb
  26. KERNEL := kernel-bin | lzma | uImage lzma
  27. endef
  28. define Device/evaluation-sdimage
  29. IMAGES += sdcard.img.gz
  30. IMAGE/sdcard.img.gz := at91-sdcard
  31. endef
  32. define Device/evaluation
  33. KERNEL_INSTALL := 1
  34. KERNEL_SUFFIX := -uImage
  35. IMAGES := root.ubi
  36. IMAGE/root.ubi := append-ubi
  37. endef
  38. define Device/evaluation-zImage
  39. IMAGES += zImage
  40. IMAGE/zImage := at91-install-zImage
  41. endef
  42. define Device/evaluation-dtb
  43. $(Device/evaluation)
  44. $(Device/dtb)
  45. KERNEL_SUFFIX := -fit-zImage.itb
  46. KERNEL = kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb
  47. endef
  48. define Device/evaluation-fit
  49. $(Device/evaluation)
  50. KERNEL_SUFFIX := -fit-uImage.itb
  51. KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb
  52. endef
  53. define Device/production
  54. UBINIZE_OPTS := -E 5
  55. IMAGES := factory.bin
  56. IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
  57. endef
  58. define Device/production-dtb
  59. $(Device/production)
  60. $(Device/dtb)
  61. IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) | \
  62. append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
  63. endef
  64. $(eval $(call BuildImage))