rpi-base.inc 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. include conf/machine/include/rpi-default-settings.inc
  2. include conf/machine/include/rpi-default-versions.inc
  3. include conf/machine/include/rpi-default-providers.inc
  4. SOC_FAMILY = "rpi"
  5. include conf/machine/include/soc-family.inc
  6. IMAGE_FSTYPES ?= "tar.bz2 ext3 wic.bz2 wic.bmap"
  7. WKS_FILE ?= "sdimage-raspberrypi.wks"
  8. XSERVER = " \
  9. xserver-xorg \
  10. ${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "xserver-xorg-extension-glx", "", d)} \
  11. ${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "xf86-video-modesetting", "xf86-video-fbdev", d)} \
  12. "
  13. RPI_KERNEL_DEVICETREE_OVERLAYS ?= " \
  14. overlays/overlay_map.dtb \
  15. overlays/at86rf233.dtbo \
  16. overlays/disable-bt.dtbo \
  17. overlays/disable-bt-pi5.dtbo \
  18. overlays/disable-wifi.dtbo \
  19. overlays/disable-wifi-pi5.dtbo \
  20. overlays/dwc2.dtbo \
  21. overlays/gpio-ir.dtbo \
  22. overlays/gpio-ir-tx.dtbo \
  23. overlays/gpio-key.dtbo \
  24. overlays/gpio-poweroff.dtbo \
  25. overlays/gpio-shutdown.dtbo \
  26. overlays/hifiberry-amp.dtbo \
  27. overlays/hifiberry-amp100.dtbo \
  28. overlays/hifiberry-amp3.dtbo \
  29. overlays/hifiberry-amp4pro.dtbo \
  30. overlays/hifiberry-dac.dtbo \
  31. overlays/hifiberry-dacplus.dtbo \
  32. overlays/hifiberry-dacplusadc.dtbo \
  33. overlays/hifiberry-dacplusadcpro.dtbo \
  34. overlays/hifiberry-dacplusdsp.dtbo \
  35. overlays/hifiberry-dacplushd.dtbo \
  36. overlays/hifiberry-digi-pro.dtbo \
  37. overlays/hifiberry-digi.dtbo \
  38. overlays/justboom-both.dtbo \
  39. overlays/justboom-dac.dtbo \
  40. overlays/justboom-digi.dtbo \
  41. overlays/i2c-gpio.dtbo \
  42. overlays/i2c-rtc.dtbo \
  43. overlays/imx219.dtbo \
  44. overlays/imx477.dtbo \
  45. overlays/imx708.dtbo \
  46. overlays/iqaudio-dac.dtbo \
  47. overlays/iqaudio-dacplus.dtbo \
  48. overlays/mcp2515-can0.dtbo \
  49. overlays/mcp2515-can1.dtbo \
  50. overlays/seeed-can-fd-hat-v2.dtbo \
  51. overlays/mcp3008.dtbo \
  52. overlays/miniuart-bt.dtbo \
  53. overlays/pitft22.dtbo \
  54. overlays/pitft28-capacitive.dtbo \
  55. overlays/pitft28-resistive.dtbo \
  56. overlays/pitft35-resistive.dtbo \
  57. overlays/pps-gpio.dtbo \
  58. overlays/rpi-ft5406.dtbo \
  59. overlays/rpi-poe.dtbo \
  60. overlays/uart0.dtbo \
  61. overlays/uart0-pi5.dtbo \
  62. overlays/uart1.dtbo \
  63. overlays/uart1-pi5.dtbo \
  64. overlays/uart2.dtbo \
  65. overlays/uart2-pi5.dtbo \
  66. overlays/uart3.dtbo \
  67. overlays/uart3-pi5.dtbo \
  68. overlays/uart4.dtbo \
  69. overlays/uart4-pi5.dtbo \
  70. overlays/uart5.dtbo \
  71. overlays/vc4-fkms-v3d.dtbo \
  72. overlays/vc4-fkms-v3d-pi4.dtbo \
  73. overlays/vc4-kms-v3d.dtbo \
  74. overlays/vc4-kms-v3d-pi4.dtbo \
  75. overlays/vc4-kms-v3d-pi5.dtbo \
  76. overlays/vc4-kms-dsi-7inch.dtbo \
  77. overlays/vc4-kms-dsi-ili9881-7inch.dtbo \
  78. overlays/w1-gpio.dtbo \
  79. overlays/w1-gpio-pullup.dtbo \
  80. overlays/w1-gpio-pi5.dtbo \
  81. overlays/wm8960-soundcard.dtbo \
  82. overlays/bcm2712d0.dtbo \
  83. "
  84. RPI_KERNEL_DEVICETREE ?= " \
  85. broadcom/bcm2708-rpi-zero.dtb \
  86. broadcom/bcm2708-rpi-zero-w.dtb \
  87. broadcom/bcm2708-rpi-b.dtb \
  88. broadcom/bcm2708-rpi-b-rev1.dtb \
  89. broadcom/bcm2708-rpi-b-plus.dtb \
  90. broadcom/bcm2709-rpi-2-b.dtb \
  91. broadcom/bcm2710-rpi-2-b.dtb \
  92. broadcom/bcm2710-rpi-3-b.dtb \
  93. broadcom/bcm2710-rpi-3-b-plus.dtb \
  94. broadcom/bcm2710-rpi-zero-2.dtb \
  95. broadcom/bcm2711-rpi-4-b.dtb \
  96. broadcom/bcm2711-rpi-400.dtb \
  97. broadcom/bcm2708-rpi-cm.dtb \
  98. broadcom/bcm2710-rpi-cm3.dtb \
  99. broadcom/bcm2711-rpi-cm4.dtb \
  100. broadcom/bcm2711-rpi-cm4s.dtb \
  101. "
  102. KERNEL_DEVICETREE ??= " \
  103. ${RPI_KERNEL_DEVICETREE} \
  104. ${RPI_KERNEL_DEVICETREE_OVERLAYS} \
  105. "
  106. # By default:
  107. #
  108. # * When u-boot is disabled use the "Image" format which can be directly loaded
  109. # by the rpi firmware.
  110. #
  111. # * When u-boot is enabled use the "uImage" format and the "bootm" command
  112. # within u-boot to load the kernel.
  113. KERNEL_BOOTCMD ??= "bootm"
  114. KERNEL_IMAGETYPE_UBOOT ??= "uImage"
  115. KERNEL_IMAGETYPE_DIRECT ??= "zImage"
  116. KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
  117. '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}"
  118. MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio ${@bb.utils.contains('DISABLE_VC4GRAPHICS', '1', '', 'vc4graphics', d)}"
  119. # Raspberry Pi has no hardware clock
  120. MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
  121. MACHINE_EXTRA_RRECOMMENDS += "kernel-modules udev-rules-rpi"
  122. MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_I2C', '1', 'kernel-module-i2c-dev kernel-module-i2c-bcm2708', '', d)}"
  123. MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_IR', '1', 'kernel-module-gpio-ir kernel-module-gpio-ir-tx', '', d)}"
  124. MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_GPIO_SHUTDOWN', '1', 'gpio-shutdown kernel-module-gpio-keys', '', d)}"
  125. SERIAL_CONSOLES_CHECK ??= "${SERIAL_CONSOLES}"
  126. # The name of the deploy directory for raspberry pi boot files.
  127. # This variable is referred to by recipes fetching / generating the files.
  128. BOOTFILES_DIR_NAME ?= "bootfiles"
  129. def make_dtb_boot_files(d):
  130. # Generate IMAGE_BOOT_FILES entries for device tree files listed in
  131. # KERNEL_DEVICETREE.
  132. alldtbs = d.getVar('KERNEL_DEVICETREE')
  133. # DTBs may be built out of kernel with devicetree.bbclass
  134. if not alldtbs:
  135. return ''
  136. def transform(dtb):
  137. base = os.path.basename(dtb)
  138. if dtb.endswith('dtbo') or base == 'overlay_map.dtb':
  139. # overlay dtb:
  140. # eg: overlays/hifiberry-amp.dtbo has:
  141. # DEPLOYDIR file: hifiberry-amp.dtbo
  142. # destination: overlays/hifiberry-amp.dtbo
  143. return '{};{}'.format(base, dtb)
  144. elif dtb.endswith('dtb'):
  145. # eg: whatever/bcm2708-rpi-b.dtb has:
  146. # DEPLOYDIR file: bcm2708-rpi-b.dtb
  147. # destination: bcm2708-rpi-b.dtb
  148. return base
  149. return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
  150. RPI_EXTRA_IMAGE_BOOT_FILES ?= " \
  151. ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
  152. '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \
  153. '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
  154. "
  155. IMAGE_BOOT_FILES ?= "${BOOTFILES_DIR_NAME}/* \
  156. ${@make_dtb_boot_files(d)} \
  157. ${RPI_EXTRA_IMAGE_BOOT_FILES} \
  158. "
  159. EXTRA_IMAGEDEPENDS += "rpi-bootfiles"
  160. do_image_wic[depends] += " \
  161. virtual/kernel:do_deploy \
  162. rpi-bootfiles:do_deploy \
  163. ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
  164. "
  165. do_image_wic[recrdeps] = "do_build"
  166. # The kernel image is installed into the FAT32 boot partition and does not need
  167. # to also be installed into the rootfs.
  168. RDEPENDS:${KERNEL_PACKAGE_NAME}-base = ""