Makefile 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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:= 2
  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_TARGET_SYSTEM_RASPBERRY_PI4)$(ADK_TARGET_SYSTEM_RASPBERRY_PI4_64),y)
  61. printf "dtoverlay=vc4-kms-v3d-pi4\n" >> \
  62. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  63. endif
  64. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI5),y)
  65. printf "dtoverlay=vc4-kms-v3d-pi5\n" >> \
  66. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  67. endif
  68. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_AMP),)
  69. printf "dtoverlay=hifiberry-amp\n" >> \
  70. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  71. endif
  72. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DAC),)
  73. printf "dtoverlay=hifiberry-dac\n" >> \
  74. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  75. endif
  76. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DACPLUS),)
  77. printf "dtoverlay=hifiberry-dacplus\n" >> \
  78. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  79. endif
  80. ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DIGI),)
  81. printf "dtoverlay=hifiberry-digi\n" >> \
  82. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  83. endif
  84. ifneq ($(ADK_TARGET_HARDWARE_RPI_DAC),)
  85. printf "dtoverlay=rpi-dac\n" >> \
  86. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  87. endif
  88. ifneq ($(ADK_TARGET_HARDWARE_IQAUDIO_DAC),)
  89. printf "dtoverlay=iqaudio-dac\n" >> \
  90. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  91. endif
  92. ifneq ($(ADK_TARGET_HARDWARE_RPI_PROTO),)
  93. printf "dtoverlay=rpi-proto\n" >> \
  94. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  95. endif
  96. ifeq ($(ADK_TARGET_HARDWARE_RPI3_NO_WIFI),y)
  97. printf "dtoverlay=pi3-disable-wifi\n" >> \
  98. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  99. endif
  100. ifeq ($(ADK_TARGET_HARDWARE_RPI3_NO_BT),y)
  101. printf "dtoverlay=pi3-disable-bt\n" >> \
  102. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  103. endif
  104. ifeq ($(ADK_TARGET_HARDWARE_RPI3_SERIAL),y)
  105. printf "enable_uart=1\n" >> \
  106. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  107. endif
  108. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI4),y)
  109. printf "enable_uart=1\n" >> \
  110. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  111. endif
  112. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3_64)$(ADK_TARGET_SYSTEM_RASPBERRY_PI4_64),y)
  113. printf "arm_control=0x200\n" >> \
  114. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  115. printf "enable_uart=1\n" >> \
  116. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  117. endif
  118. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI5),y)
  119. printf "dtparam=fan_temp0=0\n" >> \
  120. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  121. printf "dtparam=fan_temp0_speed=64\n" >> \
  122. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  123. printf "dtparam=fan_temp1_speed=64\n" >> \
  124. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  125. printf "dtparam=fan_temp2_speed=64\n" >> \
  126. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  127. printf "dtparam=fan_temp3_speed=64\n" >> \
  128. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  129. endif
  130. ifneq ($(ADK_RUNTIME_MPEG2_KEY),)
  131. printf "decode_MPG2=$(ADK_RUNTIME_MPEG2_KEY)\n" >> \
  132. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  133. endif
  134. ifneq ($(ADK_RUNTIME_VC1_KEY),)
  135. printf "decode_WVC1=$(ADK_RUNTIME_VC1_KEY)\n" >> \
  136. $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
  137. endif
  138. include $(ADK_TOPDIR)/mk/pkg-bottom.mk