Makefile 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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_DTS_DIR := $(DTS_DIR)/microchip
  17. $(Device/default-nand)
  18. PROFILES := Default
  19. FILESYSTEMS := squashfs ubifs ext4
  20. DEVICE_DTS = $(lastword $(subst _, ,$(1)))
  21. KERNEL_NAME := zImage
  22. KERNEL_SIZE := 4096k
  23. KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
  24. DTB_SIZE := 128k
  25. endef
  26. define Device/dtb
  27. KERNEL := kernel-bin | lzma | uImage lzma
  28. endef
  29. define Device/evaluation-sdimage
  30. IMAGES += sdcard.img.gz
  31. IMAGE/sdcard.img.gz := at91-sdcard
  32. endef
  33. define Device/evaluation
  34. KERNEL_INSTALL := 1
  35. KERNEL_SUFFIX := -uImage
  36. IMAGES := root.ubi
  37. IMAGE/root.ubi := append-ubi
  38. endef
  39. define Device/evaluation-zImage
  40. IMAGES += zImage
  41. IMAGE/zImage := at91-install-zImage
  42. endef
  43. define Device/evaluation-dtb
  44. $(Device/evaluation)
  45. $(Device/dtb)
  46. KERNEL_SUFFIX := -fit-zImage.itb
  47. KERNEL = kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb
  48. endef
  49. define Device/evaluation-fit
  50. $(Device/evaluation)
  51. KERNEL_SUFFIX := -fit-uImage.itb
  52. KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb
  53. endef
  54. define Device/production
  55. UBINIZE_OPTS := -E 5
  56. IMAGES := factory.bin
  57. IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
  58. endef
  59. define Device/production-dtb
  60. $(Device/production)
  61. $(Device/dtb)
  62. IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) | \
  63. append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
  64. endef
  65. $(eval $(call BuildImage))