rpi-base.inc 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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-wifi.dtbo \
  18. overlays/dwc2.dtbo \
  19. overlays/gpio-ir.dtbo \
  20. overlays/gpio-ir-tx.dtbo \
  21. overlays/gpio-key.dtbo \
  22. overlays/gpio-poweroff.dtbo \
  23. overlays/gpio-shutdown.dtbo \
  24. overlays/hifiberry-amp.dtbo \
  25. overlays/hifiberry-dac.dtbo \
  26. overlays/hifiberry-dacplus.dtbo \
  27. overlays/hifiberry-digi.dtbo \
  28. overlays/justboom-both.dtbo \
  29. overlays/justboom-dac.dtbo \
  30. overlays/justboom-digi.dtbo \
  31. overlays/i2c-gpio.dtbo \
  32. overlays/i2c-rtc.dtbo \
  33. overlays/imx219.dtbo \
  34. overlays/imx477.dtbo \
  35. overlays/imx708.dtbo \
  36. overlays/iqaudio-dac.dtbo \
  37. overlays/iqaudio-dacplus.dtbo \
  38. overlays/mcp2515-can0.dtbo \
  39. overlays/mcp2515-can1.dtbo \
  40. overlays/mcp3008.dtbo \
  41. overlays/miniuart-bt.dtbo \
  42. overlays/pitft22.dtbo \
  43. overlays/pitft28-capacitive.dtbo \
  44. overlays/pitft28-resistive.dtbo \
  45. overlays/pitft35-resistive.dtbo \
  46. overlays/pps-gpio.dtbo \
  47. overlays/rpi-ft5406.dtbo \
  48. overlays/rpi-poe.dtbo \
  49. overlays/vc4-fkms-v3d.dtbo \
  50. overlays/vc4-fkms-v3d-pi4.dtbo \
  51. overlays/vc4-kms-v3d.dtbo \
  52. overlays/vc4-kms-v3d-pi4.dtbo \
  53. overlays/vc4-kms-dsi-7inch.dtbo \
  54. overlays/w1-gpio.dtbo \
  55. overlays/w1-gpio-pullup.dtbo \
  56. overlays/wm8960-soundcard.dtbo \
  57. "
  58. RPI_KERNEL_DEVICETREE ?= " \
  59. bcm2708-rpi-zero.dtb \
  60. bcm2708-rpi-zero-w.dtb \
  61. bcm2708-rpi-b.dtb \
  62. bcm2708-rpi-b-rev1.dtb \
  63. bcm2708-rpi-b-plus.dtb \
  64. bcm2709-rpi-2-b.dtb \
  65. bcm2710-rpi-2-b.dtb \
  66. bcm2710-rpi-3-b.dtb \
  67. bcm2710-rpi-3-b-plus.dtb \
  68. bcm2710-rpi-zero-2.dtb \
  69. bcm2711-rpi-4-b.dtb \
  70. bcm2711-rpi-400.dtb \
  71. bcm2708-rpi-cm.dtb \
  72. bcm2710-rpi-cm3.dtb \
  73. bcm2711-rpi-cm4.dtb \
  74. bcm2711-rpi-cm4s.dtb \
  75. bcm2712-rpi-5-b.dtb \
  76. "
  77. KERNEL_DEVICETREE ??= " \
  78. ${RPI_KERNEL_DEVICETREE} \
  79. ${RPI_KERNEL_DEVICETREE_OVERLAYS} \
  80. "
  81. # By default:
  82. #
  83. # * When u-boot is disabled use the "Image" format which can be directly loaded
  84. # by the rpi firmware.
  85. #
  86. # * When u-boot is enabled use the "uImage" format and the "bootm" command
  87. # within u-boot to load the kernel.
  88. KERNEL_BOOTCMD ??= "bootm"
  89. KERNEL_IMAGETYPE_UBOOT ??= "uImage"
  90. KERNEL_IMAGETYPE_DIRECT ??= "zImage"
  91. KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
  92. '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}"
  93. MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio ${@bb.utils.contains('DISABLE_VC4GRAPHICS', '1', '', 'vc4graphics', d)}"
  94. # Raspberry Pi has no hardware clock
  95. MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
  96. MACHINE_EXTRA_RRECOMMENDS += "kernel-modules udev-rules-rpi"
  97. MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_I2C', '1', 'kernel-module-i2c-dev kernel-module-i2c-bcm2708', '', d)}"
  98. MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_IR', '1', 'kernel-module-gpio-ir kernel-module-gpio-ir-tx', '', d)}"
  99. MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_GPIO_SHUTDOWN', '1', 'gpio-shutdown kernel-module-gpio-keys', '', d)}"
  100. SERIAL_CONSOLES_CHECK ??= "${SERIAL_CONSOLES}"
  101. # The name of the deploy directory for raspberry pi boot files.
  102. # This variable is referred to by recipes fetching / generating the files.
  103. BOOTFILES_DIR_NAME ?= "bootfiles"
  104. def make_dtb_boot_files(d):
  105. # Generate IMAGE_BOOT_FILES entries for device tree files listed in
  106. # KERNEL_DEVICETREE.
  107. alldtbs = d.getVar('KERNEL_DEVICETREE')
  108. # DTBs may be built out of kernel with devicetree.bbclass
  109. if not alldtbs:
  110. return ''
  111. def transform(dtb):
  112. base = os.path.basename(dtb)
  113. if dtb.endswith('dtbo') or base == 'overlay_map.dtb':
  114. # overlay dtb:
  115. # eg: overlays/hifiberry-amp.dtbo has:
  116. # DEPLOYDIR file: hifiberry-amp.dtbo
  117. # destination: overlays/hifiberry-amp.dtbo
  118. return '{};{}'.format(base, dtb)
  119. elif dtb.endswith('dtb'):
  120. # eg: whatever/bcm2708-rpi-b.dtb has:
  121. # DEPLOYDIR file: bcm2708-rpi-b.dtb
  122. # destination: bcm2708-rpi-b.dtb
  123. return base
  124. return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
  125. RPI_EXTRA_IMAGE_BOOT_FILES ?= " \
  126. ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
  127. '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \
  128. '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
  129. "
  130. IMAGE_BOOT_FILES ?= "${BOOTFILES_DIR_NAME}/* \
  131. ${@make_dtb_boot_files(d)} \
  132. ${RPI_EXTRA_IMAGE_BOOT_FILES} \
  133. "
  134. EXTRA_IMAGEDEPENDS += "rpi-bootfiles"
  135. do_image_wic[depends] += " \
  136. virtual/kernel:do_deploy \
  137. rpi-bootfiles:do_deploy \
  138. ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
  139. "
  140. do_image_wic[recrdeps] = "do_build"
  141. # The kernel image is installed into the FAT32 boot partition and does not need
  142. # to also be installed into the rootfs.
  143. RDEPENDS:${KERNEL_PACKAGE_NAME}-base = ""