blob: 0e65d0034931afa8406968aa70b19d7b05ba58d8 [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 \
Brad Bishop316dfdd2018-06-25 12:45:53 -040021 overlays/dwc2.dtbo \
Andrew Geissler11105212021-02-12 15:30:38 -060022 overlays/gpio-ir.dtbo \
23 overlays/gpio-ir-tx.dtbo \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080024 overlays/gpio-key.dtbo \
Andrew Geissler595f6302022-01-24 19:11:47 +000025 overlays/gpio-poweroff.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060026 overlays/hifiberry-amp.dtbo \
27 overlays/hifiberry-dac.dtbo \
28 overlays/hifiberry-dacplus.dtbo \
29 overlays/hifiberry-digi.dtbo \
Andrew Geissler11105212021-02-12 15:30:38 -060030 overlays/justboom-both.dtbo \
31 overlays/justboom-dac.dtbo \
32 overlays/justboom-digi.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060033 overlays/i2c-rtc.dtbo \
Andrew Geissler11105212021-02-12 15:30:38 -060034 overlays/imx219.dtbo \
William A. Kennington IIIa99e9b62021-06-02 12:47:56 -070035 overlays/imx477.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060036 overlays/iqaudio-dac.dtbo \
37 overlays/iqaudio-dacplus.dtbo \
Brad Bishop19323692019-04-05 15:28:33 -040038 overlays/mcp2515-can0.dtbo \
Andrew Geissler5d59ec72020-07-24 16:09:26 -050039 overlays/mcp2515-can1.dtbo \
Andrew Geissler11105212021-02-12 15:30:38 -060040 overlays/miniuart-bt.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060041 overlays/pitft22.dtbo \
Brad Bishop1b9ee292020-01-16 09:06:00 -050042 overlays/pitft28-capacitive.dtbo \
Andrew Geissler11105212021-02-12 15:30:38 -060043 overlays/pitft28-resistive.dtbo \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050044 overlays/pitft35-resistive.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060045 overlays/pps-gpio.dtbo \
46 overlays/rpi-ft5406.dtbo \
Brad Bishop9392c692018-09-07 15:37:17 +010047 overlays/rpi-poe.dtbo \
Brad Bishop26bdd442019-08-16 17:08:17 -040048 overlays/vc4-fkms-v3d.dtbo \
Andrew Geissler11105212021-02-12 15:30:38 -060049 overlays/vc4-kms-v3d.dtbo \
Andrew Geisslerbd39bf62021-03-31 13:35:44 -050050 overlays/vc4-kms-v3d-pi4.dtbo \
Andrew Geissler3e34fba2021-03-05 15:21:55 -060051 overlays/vc4-kms-dsi-7inch.dtbo \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080052 overlays/w1-gpio.dtbo \
Andrew Geissler11105212021-02-12 15:30:38 -060053 overlays/w1-gpio-pullup.dtbo \
Andrew Geisslera4353c82021-06-25 14:23:27 -050054 overlays/wm8960-soundcard.dtbo \
Brad Bishopf27bdd52018-05-07 15:42:31 +020055 "
56
57RPI_KERNEL_DEVICETREE ?= " \
Andrew Geissler11105212021-02-12 15:30:38 -060058 bcm2708-rpi-zero.dtb \
Brad Bishop26bdd442019-08-16 17:08:17 -040059 bcm2708-rpi-zero-w.dtb \
Brad Bishopf27bdd52018-05-07 15:42:31 +020060 bcm2708-rpi-b.dtb \
Andrew Geissler11105212021-02-12 15:30:38 -060061 bcm2708-rpi-b-rev1.dtb \
Brad Bishopf27bdd52018-05-07 15:42:31 +020062 bcm2708-rpi-b-plus.dtb \
63 bcm2709-rpi-2-b.dtb \
Andrew Geissler11105212021-02-12 15:30:38 -060064 bcm2710-rpi-2-b.dtb \
Brad Bishopf27bdd52018-05-07 15:42:31 +020065 bcm2710-rpi-3-b.dtb \
66 bcm2710-rpi-3-b-plus.dtb \
Brad Bishop26bdd442019-08-16 17:08:17 -040067 bcm2711-rpi-4-b.dtb \
Andrew Geissler11105212021-02-12 15:30:38 -060068 bcm2711-rpi-400.dtb \
Brad Bishopf27bdd52018-05-07 15:42:31 +020069 bcm2708-rpi-cm.dtb \
70 bcm2710-rpi-cm3.dtb \
Andrew Geissler11105212021-02-12 15:30:38 -060071 bcm2711-rpi-cm4.dtb \
Brad Bishopf27bdd52018-05-07 15:42:31 +020072 "
73
Andrew Geissler11105212021-02-12 15:30:38 -060074KERNEL_DEVICETREE ??= " \
Brad Bishopf27bdd52018-05-07 15:42:31 +020075 ${RPI_KERNEL_DEVICETREE} \
76 ${RPI_KERNEL_DEVICETREE_OVERLAYS} \
Patrick Williams8b8bc412016-08-17 15:02:23 -050077 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050078
79# By default:
80#
81# * When u-boot is disabled use the "Image" format which can be directly loaded
82# by the rpi firmware.
83#
84# * When u-boot is enabled use the "uImage" format and the "bootm" command
85# within u-boot to load the kernel.
86KERNEL_BOOTCMD ??= "bootm"
87KERNEL_IMAGETYPE_UBOOT ??= "uImage"
Brad Bishop316dfdd2018-06-25 12:45:53 -040088KERNEL_IMAGETYPE_DIRECT ??= "zImage"
89KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
90 '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}"
Patrick Williams8b8bc412016-08-17 15:02:23 -050091
Brad Bishop85521d72019-09-17 07:33:03 -040092MACHINE_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 -050093
94# Raspberry Pi has no hardware clock
95MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
96
Andrew Geissler062316f2020-05-15 14:19:14 -050097MACHINE_EXTRA_RRECOMMENDS += "kernel-modules udev-rules-rpi"
98MACHINE_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 -050099MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_IR', '1', 'kernel-module-gpio-ir kernel-module-gpio-ir-tx', '', d)}"
Andrew Geissler062316f2020-05-15 14:19:14 -0500100
Andrew Geissler5d59ec72020-07-24 16:09:26 -0500101SERIAL_CONSOLES_CHECK ??= "${SERIAL_CONSOLES}"
Patrick Williams8b8bc412016-08-17 15:02:23 -0500102
Andrew Geissler9d7e0aa2020-08-21 15:56:44 -0500103# The name of the deploy directory for raspberry pi boot files.
104# This variable is referred to by recipes fetching / generating the files.
105BOOTFILES_DIR_NAME ?= "bootfiles"
106
Patrick Williams8b8bc412016-08-17 15:02:23 -0500107# Set Raspberrypi splash image
William A. Kennington IIIa99e9b62021-06-02 12:47:56 -0700108SPLASH ?= "psplash-raspberrypi"
Patrick Williams8b8bc412016-08-17 15:02:23 -0500109
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500110def make_dtb_boot_files(d):
111 # Generate IMAGE_BOOT_FILES entries for device tree files listed in
112 # KERNEL_DEVICETREE.
113 alldtbs = d.getVar('KERNEL_DEVICETREE')
114 imgtyp = d.getVar('KERNEL_IMAGETYPE')
115
116 def transform(dtb):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800117 base = os.path.basename(dtb)
Andrew Geisslerbd39bf62021-03-31 13:35:44 -0500118 if dtb.endswith('dtbo') or base == 'overlay_map.dtb':
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500119 # overlay dtb:
120 # eg: overlays/hifiberry-amp.dtbo has:
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800121 # DEPLOYDIR file: hifiberry-amp.dtbo
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500122 # destination: overlays/hifiberry-amp.dtbo
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800123 return '{};{}'.format(base, dtb)
Andrew Geisslerbd39bf62021-03-31 13:35:44 -0500124 elif dtb.endswith('dtb'):
125 # eg: whatever/bcm2708-rpi-b.dtb has:
126 # DEPLOYDIR file: bcm2708-rpi-b.dtb
127 # destination: bcm2708-rpi-b.dtb
128 return base
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500129
130 return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
131
132
Andrew Geissler9d7e0aa2020-08-21 15:56:44 -0500133IMAGE_BOOT_FILES ?= "${BOOTFILES_DIR_NAME}/* \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500134 ${@make_dtb_boot_files(d)} \
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500135 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500136 '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \
137 '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
138 "
139do_image_wic[depends] += " \
Andrew Geissler26e4bea2020-11-30 19:54:03 -0600140 rpi-bootfiles:do_deploy \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500141 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
142 "
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600143
Brad Bishop316dfdd2018-06-25 12:45:53 -0400144do_image_wic[recrdeps] = "do_build"
145
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600146# The kernel image is installed into the FAT32 boot partition and does not need
147# to also be installed into the rootfs.
Patrick Williams213cb262021-08-07 19:21:33 -0500148RDEPENDS:${KERNEL_PACKAGE_NAME}-base = ""