blob: e36b46002aab13622c962b7b6d743f578c346e4c [file] [log] [blame]
Patrick Williams8b8bc412016-08-17 15:02:23 -05001include conf/machine/include/rpi-default-settings.inc
2include conf/machine/include/rpi-default-versions.inc
3include conf/machine/include/rpi-default-providers.inc
4
5SOC_FAMILY = "rpi"
6include conf/machine/include/soc-family.inc
7
Andrew Geissler062316f2020-05-15 14:19:14 -05008IMAGE_FSTYPES ?= "tar.bz2 ext3 wic.bz2 wic.bmap"
Brad Bishop316dfdd2018-06-25 12:45:53 -04009WKS_FILE ?= "sdimage-raspberrypi.wks"
Patrick Williams8b8bc412016-08-17 15:02:23 -050010
11XSERVER = " \
12 xserver-xorg \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060013 ${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "xserver-xorg-extension-glx", "", d)} \
14 ${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "xf86-video-modesetting", "xf86-video-fbdev", d)} \
Patrick Williams8b8bc412016-08-17 15:02:23 -050015 "
16
Brad Bishopf27bdd52018-05-07 15:42:31 +020017RPI_KERNEL_DEVICETREE_OVERLAYS ?= " \
Andrew Geisslerbd39bf62021-03-31 13:35:44 -050018 overlays/overlay_map.dtb \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080019 overlays/at86rf233.dtbo \
Andrew Geissler062316f2020-05-15 14:19:14 -050020 overlays/disable-bt.dtbo \
Patrick Williams2a254922023-08-11 09:48:11 -050021 overlays/disable-wifi.dtbo \
Brad Bishop316dfdd2018-06-25 12:45:53 -040022 overlays/dwc2.dtbo \
Andrew Geissler11105212021-02-12 15:30:38 -060023 overlays/gpio-ir.dtbo \
24 overlays/gpio-ir-tx.dtbo \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080025 overlays/gpio-key.dtbo \
Andrew Geissler595f6302022-01-24 19:11:47 +000026 overlays/gpio-poweroff.dtbo \
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000027 overlays/gpio-shutdown.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060028 overlays/hifiberry-amp.dtbo \
Patrick Williamsb58112e2024-03-07 11:16:36 -060029 overlays/hifiberry-amp100.dtbo \
30 overlays/hifiberry-amp3.dtbo \
31 overlays/hifiberry-amp4pro.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060032 overlays/hifiberry-dac.dtbo \
33 overlays/hifiberry-dacplus.dtbo \
Patrick Williams73bd93f2024-02-20 08:07:48 -060034 overlays/hifiberry-dacplusadcpro.dtbo \
Patrick Williamsb58112e2024-03-07 11:16:36 -060035 overlays/hifiberry-dacplusdsp.dtbo \
36 overlays/hifiberry-dacplushd.dtbo \
37 overlays/hifiberry-digi-pro.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060038 overlays/hifiberry-digi.dtbo \
Andrew Geissler11105212021-02-12 15:30:38 -060039 overlays/justboom-both.dtbo \
40 overlays/justboom-dac.dtbo \
41 overlays/justboom-digi.dtbo \
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000042 overlays/i2c-gpio.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060043 overlays/i2c-rtc.dtbo \
Andrew Geissler11105212021-02-12 15:30:38 -060044 overlays/imx219.dtbo \
William A. Kennington IIIa99e9b62021-06-02 12:47:56 -070045 overlays/imx477.dtbo \
Patrick Williams8e7b46e2023-05-01 14:19:06 -050046 overlays/imx708.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060047 overlays/iqaudio-dac.dtbo \
48 overlays/iqaudio-dacplus.dtbo \
Brad Bishop19323692019-04-05 15:28:33 -040049 overlays/mcp2515-can0.dtbo \
Andrew Geissler5d59ec72020-07-24 16:09:26 -050050 overlays/mcp2515-can1.dtbo \
Patrick Williams03907ee2022-05-01 06:28:52 -050051 overlays/mcp3008.dtbo \
Andrew Geissler11105212021-02-12 15:30:38 -060052 overlays/miniuart-bt.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060053 overlays/pitft22.dtbo \
Brad Bishop1b9ee292020-01-16 09:06:00 -050054 overlays/pitft28-capacitive.dtbo \
Andrew Geissler11105212021-02-12 15:30:38 -060055 overlays/pitft28-resistive.dtbo \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050056 overlays/pitft35-resistive.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060057 overlays/pps-gpio.dtbo \
58 overlays/rpi-ft5406.dtbo \
Brad Bishop9392c692018-09-07 15:37:17 +010059 overlays/rpi-poe.dtbo \
Brad Bishop26bdd442019-08-16 17:08:17 -040060 overlays/vc4-fkms-v3d.dtbo \
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000061 overlays/vc4-fkms-v3d-pi4.dtbo \
Andrew Geissler11105212021-02-12 15:30:38 -060062 overlays/vc4-kms-v3d.dtbo \
Andrew Geisslerbd39bf62021-03-31 13:35:44 -050063 overlays/vc4-kms-v3d-pi4.dtbo \
Patrick Williamsf52e3dd2024-01-26 13:04:43 -060064 overlays/vc4-kms-v3d-pi5.dtbo \
Andrew Geissler3e34fba2021-03-05 15:21:55 -060065 overlays/vc4-kms-dsi-7inch.dtbo \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080066 overlays/w1-gpio.dtbo \
Andrew Geissler11105212021-02-12 15:30:38 -060067 overlays/w1-gpio-pullup.dtbo \
Andrew Geisslera4353c82021-06-25 14:23:27 -050068 overlays/wm8960-soundcard.dtbo \
Brad Bishopf27bdd52018-05-07 15:42:31 +020069 "
70
71RPI_KERNEL_DEVICETREE ?= " \
Andrew Geissler11105212021-02-12 15:30:38 -060072 bcm2708-rpi-zero.dtb \
Brad Bishop26bdd442019-08-16 17:08:17 -040073 bcm2708-rpi-zero-w.dtb \
Brad Bishopf27bdd52018-05-07 15:42:31 +020074 bcm2708-rpi-b.dtb \
Andrew Geissler11105212021-02-12 15:30:38 -060075 bcm2708-rpi-b-rev1.dtb \
Brad Bishopf27bdd52018-05-07 15:42:31 +020076 bcm2708-rpi-b-plus.dtb \
77 bcm2709-rpi-2-b.dtb \
Andrew Geissler11105212021-02-12 15:30:38 -060078 bcm2710-rpi-2-b.dtb \
Brad Bishopf27bdd52018-05-07 15:42:31 +020079 bcm2710-rpi-3-b.dtb \
80 bcm2710-rpi-3-b-plus.dtb \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050081 bcm2710-rpi-zero-2.dtb \
Brad Bishop26bdd442019-08-16 17:08:17 -040082 bcm2711-rpi-4-b.dtb \
Andrew Geissler11105212021-02-12 15:30:38 -060083 bcm2711-rpi-400.dtb \
Brad Bishopf27bdd52018-05-07 15:42:31 +020084 bcm2708-rpi-cm.dtb \
85 bcm2710-rpi-cm3.dtb \
Andrew Geissler11105212021-02-12 15:30:38 -060086 bcm2711-rpi-cm4.dtb \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050087 bcm2711-rpi-cm4s.dtb \
Patrick Williamsf52e3dd2024-01-26 13:04:43 -060088 bcm2712-rpi-5-b.dtb \
Brad Bishopf27bdd52018-05-07 15:42:31 +020089 "
90
Andrew Geissler11105212021-02-12 15:30:38 -060091KERNEL_DEVICETREE ??= " \
Brad Bishopf27bdd52018-05-07 15:42:31 +020092 ${RPI_KERNEL_DEVICETREE} \
93 ${RPI_KERNEL_DEVICETREE_OVERLAYS} \
Patrick Williams8b8bc412016-08-17 15:02:23 -050094 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050095
96# By default:
97#
98# * When u-boot is disabled use the "Image" format which can be directly loaded
99# by the rpi firmware.
100#
101# * When u-boot is enabled use the "uImage" format and the "bootm" command
102# within u-boot to load the kernel.
103KERNEL_BOOTCMD ??= "bootm"
104KERNEL_IMAGETYPE_UBOOT ??= "uImage"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400105KERNEL_IMAGETYPE_DIRECT ??= "zImage"
106KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
107 '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}"
Patrick Williams8b8bc412016-08-17 15:02:23 -0500108
Brad Bishop85521d72019-09-17 07:33:03 -0400109MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio ${@bb.utils.contains('DISABLE_VC4GRAPHICS', '1', '', 'vc4graphics', d)}"
Patrick Williams8b8bc412016-08-17 15:02:23 -0500110
111# Raspberry Pi has no hardware clock
112MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
113
Andrew Geissler062316f2020-05-15 14:19:14 -0500114MACHINE_EXTRA_RRECOMMENDS += "kernel-modules udev-rules-rpi"
115MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_I2C', '1', 'kernel-module-i2c-dev kernel-module-i2c-bcm2708', '', d)}"
Andrew Geissler4fc9e432020-06-27 00:13:56 -0500116MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_IR', '1', 'kernel-module-gpio-ir kernel-module-gpio-ir-tx', '', d)}"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +0000117MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_GPIO_SHUTDOWN', '1', 'gpio-shutdown kernel-module-gpio-keys', '', d)}"
Andrew Geissler062316f2020-05-15 14:19:14 -0500118
Andrew Geissler5d59ec72020-07-24 16:09:26 -0500119SERIAL_CONSOLES_CHECK ??= "${SERIAL_CONSOLES}"
Patrick Williams8b8bc412016-08-17 15:02:23 -0500120
Andrew Geissler9d7e0aa2020-08-21 15:56:44 -0500121# The name of the deploy directory for raspberry pi boot files.
122# This variable is referred to by recipes fetching / generating the files.
123BOOTFILES_DIR_NAME ?= "bootfiles"
124
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500125def make_dtb_boot_files(d):
126 # Generate IMAGE_BOOT_FILES entries for device tree files listed in
127 # KERNEL_DEVICETREE.
128 alldtbs = d.getVar('KERNEL_DEVICETREE')
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500129
Patrick Williams975a06f2022-10-21 14:42:47 -0500130 # DTBs may be built out of kernel with devicetree.bbclass
131 if not alldtbs:
132 return ''
133
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500134 def transform(dtb):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800135 base = os.path.basename(dtb)
Andrew Geisslerbd39bf62021-03-31 13:35:44 -0500136 if dtb.endswith('dtbo') or base == 'overlay_map.dtb':
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500137 # overlay dtb:
138 # eg: overlays/hifiberry-amp.dtbo has:
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800139 # DEPLOYDIR file: hifiberry-amp.dtbo
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500140 # destination: overlays/hifiberry-amp.dtbo
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800141 return '{};{}'.format(base, dtb)
Andrew Geisslerbd39bf62021-03-31 13:35:44 -0500142 elif dtb.endswith('dtb'):
143 # eg: whatever/bcm2708-rpi-b.dtb has:
144 # DEPLOYDIR file: bcm2708-rpi-b.dtb
145 # destination: bcm2708-rpi-b.dtb
146 return base
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500147
148 return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
149
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500150RPI_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 "
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500155
Andrew Geissler9d7e0aa2020-08-21 15:56:44 -0500156IMAGE_BOOT_FILES ?= "${BOOTFILES_DIR_NAME}/* \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500157 ${@make_dtb_boot_files(d)} \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500158 ${RPI_EXTRA_IMAGE_BOOT_FILES} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500159 "
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600160
161EXTRA_IMAGEDEPENDS += "rpi-bootfiles"
162
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500163do_image_wic[depends] += " \
Andrew Geissler220dafd2023-10-04 10:18:08 -0500164 virtual/kernel:do_deploy \
Andrew Geissler26e4bea2020-11-30 19:54:03 -0600165 rpi-bootfiles:do_deploy \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500166 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
167 "
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600168
Brad Bishop316dfdd2018-06-25 12:45:53 -0400169do_image_wic[recrdeps] = "do_build"
170
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600171# The kernel image is installed into the FAT32 boot partition and does not need
172# to also be installed into the rootfs.
Patrick Williams213cb262021-08-07 19:21:33 -0500173RDEPENDS:${KERNEL_PACKAGE_NAME}-base = ""