Makefile 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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:= 827fdd073638fa7b7292d1148fe0af7465111eae
  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-pi4 raspberry-pi4-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. ifeq ($(ADK_RUNTIME_VERBOSE_KERNEL_SERIAL_ONLY),y)
  32. printf "console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" > \
  33. $(IDIR_BCM28XX_BOOTLOADER)/boot/cmdline.txt
  34. endif
  35. ifeq ($(ADK_RUNTIME_VERBOSE_KERNEL_VGA_ONLY),y)
  36. printf "console=tty0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" > \
  37. $(IDIR_BCM28XX_BOOTLOADER)/boot/cmdline.txt
  38. endif
  39. printf "kernel=kernel\n" > $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  40. printf "dtparam=audio,i2s,spi,i2c\n" >> \
  41. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  42. ifeq ($(ADK_PACKAGE_BCM28XX_BOOTLOADER_DEFAULT),y)
  43. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI4)$(ADK_TARGET_SYSTEM_RASPBERRY_PI4_64),y)
  44. $(CP) $(WRKBUILD)/boot/{start4.elf,fixup4.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
  45. printf "start_file=start4.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  46. printf "fixup_file=fixup4.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  47. else
  48. $(CP) $(WRKBUILD)/boot/{start.elf,fixup.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
  49. printf "start_file=start.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  50. printf "fixup_file=fixup.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  51. endif
  52. endif
  53. ifeq ($(ADK_PACKAGE_BCM28XX_BOOTLOADER_EXTRA),y)
  54. $(CP) $(WRKBUILD)/boot/{start_x.elf,fixup_x.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
  55. printf "start_file=start_x.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  56. printf "fixup_file=fixup_x.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  57. endif
  58. ifeq ($(ADK_PACKAGE_BCM28XX_BOOTLOADER_CUTDOWN),y)
  59. $(CP) $(WRKBUILD)/boot/{start_cd.elf,fixup_cd.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
  60. printf "start_file=start_cd.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  61. printf "fixup_file=fixup_cd.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  62. endif
  63. printf "gpu_mem=$(ADK_TARGET_GPU_MEM)\n" >> \
  64. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  65. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_AMP),)
  66. printf "dtoverlay=hifiberry-amp\n" >> \
  67. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  68. endif
  69. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DAC),)
  70. printf "dtoverlay=hifiberry-dac\n" >> \
  71. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  72. endif
  73. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DACPLUS),)
  74. printf "dtoverlay=hifiberry-dacplus\n" >> \
  75. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  76. endif
  77. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DIGI),)
  78. printf "dtoverlay=hifiberry-digi\n" >> \
  79. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  80. endif
  81. ifneq ($(ADK_TARGET_HARDWARE_RPI_DAC),)
  82. printf "dtoverlay=rpi-dac\n" >> \
  83. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  84. endif
  85. ifneq ($(ADK_TARGET_HARDWARE_IQAUDIO_DAC),)
  86. printf "dtoverlay=iqaudio-dac\n" >> \
  87. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  88. endif
  89. ifneq ($(ADK_TARGET_HARDWARE_RPI_PROTO),)
  90. printf "dtoverlay=rpi-proto\n" >> \
  91. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  92. endif
  93. ifeq ($(ADK_TARGET_HARDWARE_RPI3_NO_WIFI),y)
  94. printf "dtoverlay=pi3-disable-wifi\n" >> \
  95. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  96. endif
  97. ifeq ($(ADK_TARGET_HARDWARE_RPI3_NO_BT),y)
  98. printf "dtoverlay=pi3-disable-bt\n" >> \
  99. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  100. endif
  101. ifeq ($(ADK_TARGET_HARDWARE_RPI3_SERIAL),y)
  102. printf "enable_uart=1\n" >> \
  103. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  104. endif
  105. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI4),y)
  106. printf "enable_uart=1\n" >> \
  107. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  108. endif
  109. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3_64)$(ADK_TARGET_SYSTEM_RASPBERRY_PI4_64),y)
  110. printf "arm_control=0x200\n" >> \
  111. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  112. printf "enable_uart=1\n" >> \
  113. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  114. endif
  115. ifneq ($(ADK_RUNTIME_MPEG2_KEY),)
  116. printf "decode_MPG2=$(ADK_RUNTIME_MPEG2_KEY)\n" >> \
  117. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  118. endif
  119. ifneq ($(ADK_RUNTIME_VC1_KEY),)
  120. printf "decode_WVC1=$(ADK_RUNTIME_VC1_KEY)\n" >> \
  121. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  122. endif
  123. ifeq ($(ADK_PACKAGE_BCM28XX_DEBUGTOOL),y)
  124. $(INSTALL_DIR) $(IDIR_BCM28XX_DEBUGTOOL)/usr/bin
  125. $(INSTALL_BIN) ./files/vcdbg \
  126. $(IDIR_BCM28XX_DEBUGTOOL)/usr/bin
  127. endif
  128. include $(ADK_TOPDIR)/mk/pkg-bottom.mk