Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #
  2. # Copyright (C) 2006-2013 OpenWrt.org
  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. KERNEL_LOADADDR := 0x20008000
  10. define Build/at91-install-zImage
  11. $(CP) $(KDIR)/zImage $@
  12. endef
  13. ifeq ($(SUBTARGET),sam9x)
  14. include ./sam9x.mk
  15. endif
  16. ifeq ($(SUBTARGET),sama5)
  17. include ./sama5.mk
  18. endif
  19. AT91_SD_BOOT_PARTSIZE:=64
  20. FAT32_BLOCK_SIZE:=1024
  21. FAT32_BLOCKS:=$(shell echo \
  22. $$(($(AT91_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
  23. define Device/Default
  24. $(Device/default-nand)
  25. PROFILES := Default
  26. FILESYSTEMS := squashfs ubifs ext4
  27. DEVICE_DTS := $(1)
  28. KERNEL_NAME := zImage
  29. KERNEL_SIZE := 4096k
  30. KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
  31. DTB_SIZE := 128k
  32. endef
  33. define Device/dtb
  34. KERNEL := kernel-bin | lzma | uImage lzma
  35. endef
  36. define Device/evaluation-sdimage
  37. IMAGES += sdcard.img.gz
  38. IMAGE/sdcard.img.gz := at91-sdcard
  39. endef
  40. define Device/evaluation
  41. KERNEL_INSTALL := 1
  42. KERNEL_SUFFIX := -uImage
  43. IMAGES := root.ubi
  44. IMAGE/root.ubi := append-ubi
  45. endef
  46. define Device/evaluation-zImage
  47. IMAGES += zImage
  48. IMAGE/zImage := at91-install-zImage
  49. endef
  50. define Device/evaluation-dtb
  51. $(Device/evaluation)
  52. $(Device/dtb)
  53. $(Device/evaluation-zImage)
  54. IMAGES += dtb
  55. IMAGE/dtb := install-dtb
  56. endef
  57. define Device/evaluation-fit
  58. $(Device/evaluation)
  59. KERNEL_SUFFIX := -fit-uImage.itb
  60. KERNEL := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
  61. endef
  62. define Device/production
  63. UBINIZE_OPTS := -E 5
  64. IMAGES := factory.bin
  65. IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
  66. endef
  67. define Device/production-dtb
  68. $(Device/production)
  69. $(Device/dtb)
  70. IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \
  71. | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
  72. endef
  73. $(eval $(call BuildImage))