Makefile 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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:= 1e403e23baab5673f0494a200f57cd01287d5b1a
  7. PKG_RELEASE:= 3
  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 raspberry-pi5
  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. NO_DISTFILES:= 1
  18. include $(ADK_TOPDIR)/mk/package.mk
  19. $(eval $(call PKG_template,BCM28XX_BOOTLOADER,bcm28xx-bootloader,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION)))
  20. CONFIG_STYLE:= manual
  21. BUILD_STYLE:= manual
  22. INSTALL_STYLE:= manual
  23. do-install:
  24. $(INSTALL_DIR) $(IDIR_BCM28XX_BOOTLOADER)/boot
  25. $(CP) $(WRKBUILD)/boot/bootcode.bin $(IDIR_BCM28XX_BOOTLOADER)/boot/
  26. ifeq ($(ADK_RUNTIME_VERBOSE_KERNEL_SERIAL_ONLY),y)
  27. printf "console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" > \
  28. $(IDIR_BCM28XX_BOOTLOADER)/boot/cmdline.txt
  29. endif
  30. ifeq ($(ADK_RUNTIME_VERBOSE_KERNEL_VGA_ONLY),y)
  31. printf "console=tty0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" > \
  32. $(IDIR_BCM28XX_BOOTLOADER)/boot/cmdline.txt
  33. endif
  34. printf "kernel=kernel\n" > $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  35. printf "dtparam=audio,i2s,spi,i2c\n" >> \
  36. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  37. ifeq ($(ADK_PACKAGE_BCM28XX_BOOTLOADER_DEFAULT),y)
  38. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI4)$(ADK_TARGET_SYSTEM_RASPBERRY_PI4_64),y)
  39. $(CP) $(WRKBUILD)/boot/{start4.elf,fixup4.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
  40. printf "start_file=start4.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  41. printf "fixup_file=fixup4.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  42. else
  43. $(CP) $(WRKBUILD)/boot/{start.elf,fixup.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
  44. printf "start_file=start.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  45. printf "fixup_file=fixup.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  46. endif
  47. endif
  48. ifeq ($(ADK_PACKAGE_BCM28XX_BOOTLOADER_EXTRA),y)
  49. $(CP) $(WRKBUILD)/boot/{start_x.elf,fixup_x.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
  50. printf "start_file=start_x.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  51. printf "fixup_file=fixup_x.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  52. endif
  53. ifeq ($(ADK_PACKAGE_BCM28XX_BOOTLOADER_CUTDOWN),y)
  54. $(CP) $(WRKBUILD)/boot/{start_cd.elf,fixup_cd.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
  55. printf "start_file=start_cd.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  56. printf "fixup_file=fixup_cd.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  57. endif
  58. printf "gpu_mem=$(ADK_TARGET_GPU_MEM)\n" >> \
  59. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  60. ifeq ($(ADK_PACKAGE_KODI),y)
  61. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI4)$(ADK_TARGET_SYSTEM_RASPBERRY_PI4_64),y)
  62. printf "dtoverlay=vc4-kms-v3d-pi4\n" >> \
  63. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  64. endif
  65. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI5),y)
  66. printf "dtoverlay=vc4-kms-v3d-pi5\n" >> \
  67. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  68. endif
  69. endif
  70. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_AMP),)
  71. printf "dtoverlay=hifiberry-amp\n" >> \
  72. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  73. endif
  74. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DAC),)
  75. printf "dtoverlay=hifiberry-dac\n" >> \
  76. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  77. endif
  78. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DACPLUS),)
  79. printf "dtoverlay=hifiberry-dacplus\n" >> \
  80. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  81. endif
  82. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DIGI),)
  83. printf "dtoverlay=hifiberry-digi\n" >> \
  84. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  85. endif
  86. ifneq ($(ADK_TARGET_HARDWARE_RPI_DAC),)
  87. printf "dtoverlay=rpi-dac\n" >> \
  88. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  89. endif
  90. ifneq ($(ADK_TARGET_HARDWARE_IQAUDIO_DAC),)
  91. printf "dtoverlay=iqaudio-dac\n" >> \
  92. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  93. endif
  94. ifneq ($(ADK_TARGET_HARDWARE_RPI_PROTO),)
  95. printf "dtoverlay=rpi-proto\n" >> \
  96. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  97. endif
  98. ifeq ($(ADK_TARGET_HARDWARE_RPI3_NO_WIFI),y)
  99. printf "dtoverlay=pi3-disable-wifi\n" >> \
  100. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  101. endif
  102. ifeq ($(ADK_TARGET_HARDWARE_RPI3_NO_BT),y)
  103. printf "dtoverlay=pi3-disable-bt\n" >> \
  104. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  105. endif
  106. ifeq ($(ADK_TARGET_HARDWARE_RPI3_SERIAL),y)
  107. printf "enable_uart=1\n" >> \
  108. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  109. endif
  110. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI4),y)
  111. printf "enable_uart=1\n" >> \
  112. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  113. endif
  114. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3_64)$(ADK_TARGET_SYSTEM_RASPBERRY_PI4_64),y)
  115. printf "arm_control=0x200\n" >> \
  116. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  117. printf "enable_uart=1\n" >> \
  118. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  119. endif
  120. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI5),y)
  121. printf "dtparam=fan_temp0=0\n" >> \
  122. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  123. printf "dtparam=fan_temp0_speed=64\n" >> \
  124. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  125. printf "dtparam=fan_temp1_speed=64\n" >> \
  126. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  127. printf "dtparam=fan_temp2_speed=64\n" >> \
  128. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  129. printf "dtparam=fan_temp3_speed=64\n" >> \
  130. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  131. endif
  132. ifneq ($(ADK_RUNTIME_MPEG2_KEY),)
  133. printf "decode_MPG2=$(ADK_RUNTIME_MPEG2_KEY)\n" >> \
  134. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  135. endif
  136. ifneq ($(ADK_RUNTIME_VC1_KEY),)
  137. printf "decode_WVC1=$(ADK_RUNTIME_VC1_KEY)\n" >> \
  138. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  139. endif
  140. include $(ADK_TOPDIR)/mk/pkg-bottom.mk