Makefile 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(ADK_TOPDIR)/rules.mk
  4. PKG_NAME:= bcm28xx-bootloader
  5. # not cloned, local src directory used
  6. PKG_VERSION:= 865ddc1393f558198e7e7ce70928ff2e49c4f7f6
  7. PKG_RELEASE:= 1
  8. PKG_DESCR:= bootloader for bcm28xx
  9. PKG_SECTION:= base/boot
  10. PKG_URL:= https://github.com/raspberrypi/firmware
  11. PKG_SITES:= https://github.com/raspberrypi/firmware.git
  12. PKG_SYSTEM_DEPENDS:= raspberry-pi raspberry-pi0 raspberry-pi2 raspberry-pi3 raspberry-pi3-64 raspberry-pi3p raspberry-pi3p-64
  13. PKG_CHOICES_BCM28XX_BOOTLOADER:= DEFAULT EXTRA CUTDOWN
  14. PKGCD_DEFAULT:= default bootloader
  15. PKGCD_EXTRA:= bootloader with extra features and codecs
  16. PKGCD_CUTDOWN:= cut down bootloader
  17. PKG_SUBPKGS:= BCM28XX_BOOTLOADER BCM28XX_DEBUGTOOL
  18. PKGSD_BCM28XX_DEBUGTOOL:= bcm28xx debugtool (vcdbg)
  19. PKGSC_BCM28XX_DEBUGTOOL:= sys/hw
  20. PKGSS_BCM28XX_DEBUGTOOL:= bcm28xx-vc-debug bcm28xx-vc-libs
  21. NO_DISTFILES:= 1
  22. include $(ADK_TOPDIR)/mk/package.mk
  23. $(eval $(call PKG_template,BCM28XX_BOOTLOADER,bcm28xx-bootloader,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION)))
  24. $(eval $(call PKG_template,BCM28XX_DEBUGTOOL,bcm28xx-debugtool,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKGSC_BCM28XX_DEBUGTOOL)))
  25. CONFIG_STYLE:= manual
  26. BUILD_STYLE:= manual
  27. INSTALL_STYLE:= manual
  28. do-install:
  29. $(INSTALL_DIR) $(IDIR_BCM28XX_BOOTLOADER)/boot
  30. $(CP) $(WRKBUILD)/boot/bootcode.bin $(IDIR_BCM28XX_BOOTLOADER)/boot/
  31. printf "kernel=kernel\n" > $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  32. printf "dtparam=audio,i2s,spi,i2c\n" >> \
  33. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  34. ifeq ($(ADK_PACKAGE_BCM28XX_BOOTLOADER_DEFAULT),y)
  35. $(CP) $(WRKBUILD)/boot/{start.elf,fixup.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
  36. printf "start_file=start.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  37. printf "fixup_file=fixup.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  38. endif
  39. ifeq ($(ADK_PACKAGE_BCM28XX_BOOTLOADER_EXTRA),y)
  40. $(CP) $(WRKBUILD)/boot/{start_x.elf,fixup_x.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
  41. printf "start_file=start_x.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  42. printf "fixup_file=fixup_x.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  43. endif
  44. ifeq ($(ADK_PACKAGE_BCM28XX_BOOTLOADER_CUTDOWN),y)
  45. $(CP) $(WRKBUILD)/boot/{start_cd.elf,fixup_cd.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
  46. printf "start_file=start_cd.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  47. printf "fixup_file=fixup_cd.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  48. endif
  49. printf "gpu_mem=$(ADK_TARGET_GPU_MEM)\n" >> \
  50. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  51. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_AMP),)
  52. printf "dtoverlay=hifiberry-amp.dtb\n" >> \
  53. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  54. endif
  55. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DAC),)
  56. printf "dtoverlay=hifiberry-dac.dtb\n" >> \
  57. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  58. endif
  59. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DACPLUS),)
  60. printf "dtoverlay=hifiberry-dacplus.dtb\n" >> \
  61. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  62. endif
  63. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DIGI),)
  64. printf "dtoverlay=hifiberry-digi.dtb\n" >> \
  65. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  66. endif
  67. ifneq ($(ADK_TARGET_HARDWARE_RPI_DAC),)
  68. printf "dtoverlay=rpi-dac.dtb\n" >> \
  69. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  70. endif
  71. ifneq ($(ADK_TARGET_HARDWARE_IQAUDIO_DAC),)
  72. printf "dtoverlay=iqaudio-dac.dtb\n" >> \
  73. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  74. endif
  75. ifneq ($(ADK_TARGET_HARDWARE_RPI_PROTO),)
  76. printf "dtoverlay=rpi-proto.dtb\n" >> \
  77. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  78. endif
  79. ifeq ($(ADK_TARGET_HARDWARE_RPI3_SERIAL),y)
  80. printf "dtoverlay=pi3-disable-bt.dtb\n" >> \
  81. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  82. endif
  83. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3_64),y)
  84. printf "arm_control=0x200\n" >> \
  85. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  86. printf "enable_uart=1\n" >> \
  87. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  88. endif
  89. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3P_64),y)
  90. printf "arm_control=0x200\n" >> \
  91. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  92. printf "enable_uart=1\n" >> \
  93. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  94. endif
  95. ifeq ($(ADK_PACKAGE_BCM28XX_DEBUGTOOL),y)
  96. $(INSTALL_DIR) $(IDIR_BCM28XX_DEBUGTOOL)/usr/bin
  97. $(INSTALL_BIN) ./files/vcdbg \
  98. $(IDIR_BCM28XX_DEBUGTOOL)/usr/bin
  99. endif
  100. include $(ADK_TOPDIR)/mk/pkg-bottom.mk