Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 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 | |
| 5 | SOC_FAMILY = "rpi" |
| 6 | include conf/machine/include/soc-family.inc |
| 7 | |
Andrew Geissler | 062316f | 2020-05-15 14:19:14 -0500 | [diff] [blame] | 8 | IMAGE_FSTYPES ?= "tar.bz2 ext3 wic.bz2 wic.bmap" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 9 | WKS_FILE ?= "sdimage-raspberrypi.wks" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 10 | |
| 11 | XSERVER = " \ |
| 12 | xserver-xorg \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 13 | ${@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 Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 15 | " |
| 16 | |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 17 | RPI_KERNEL_DEVICETREE_OVERLAYS ?= " \ |
Andrew Geissler | bd39bf6 | 2021-03-31 13:35:44 -0500 | [diff] [blame] | 18 | overlays/overlay_map.dtb \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 19 | overlays/at86rf233.dtbo \ |
Andrew Geissler | 062316f | 2020-05-15 14:19:14 -0500 | [diff] [blame] | 20 | overlays/disable-bt.dtbo \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 21 | overlays/dwc2.dtbo \ |
Andrew Geissler | 1110521 | 2021-02-12 15:30:38 -0600 | [diff] [blame] | 22 | overlays/gpio-ir.dtbo \ |
| 23 | overlays/gpio-ir-tx.dtbo \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 24 | overlays/gpio-key.dtbo \ |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 25 | overlays/gpio-poweroff.dtbo \ |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 26 | overlays/gpio-shutdown.dtbo \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 27 | overlays/hifiberry-amp.dtbo \ |
| 28 | overlays/hifiberry-dac.dtbo \ |
| 29 | overlays/hifiberry-dacplus.dtbo \ |
| 30 | overlays/hifiberry-digi.dtbo \ |
Andrew Geissler | 1110521 | 2021-02-12 15:30:38 -0600 | [diff] [blame] | 31 | overlays/justboom-both.dtbo \ |
| 32 | overlays/justboom-dac.dtbo \ |
| 33 | overlays/justboom-digi.dtbo \ |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 34 | overlays/i2c-gpio.dtbo \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 35 | overlays/i2c-rtc.dtbo \ |
Andrew Geissler | 1110521 | 2021-02-12 15:30:38 -0600 | [diff] [blame] | 36 | overlays/imx219.dtbo \ |
William A. Kennington III | a99e9b6 | 2021-06-02 12:47:56 -0700 | [diff] [blame] | 37 | overlays/imx477.dtbo \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 38 | overlays/iqaudio-dac.dtbo \ |
| 39 | overlays/iqaudio-dacplus.dtbo \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 40 | overlays/mcp2515-can0.dtbo \ |
Andrew Geissler | 5d59ec7 | 2020-07-24 16:09:26 -0500 | [diff] [blame] | 41 | overlays/mcp2515-can1.dtbo \ |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 42 | overlays/mcp3008.dtbo \ |
Andrew Geissler | 1110521 | 2021-02-12 15:30:38 -0600 | [diff] [blame] | 43 | overlays/miniuart-bt.dtbo \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 44 | overlays/pitft22.dtbo \ |
Brad Bishop | 1b9ee29 | 2020-01-16 09:06:00 -0500 | [diff] [blame] | 45 | overlays/pitft28-capacitive.dtbo \ |
Andrew Geissler | 1110521 | 2021-02-12 15:30:38 -0600 | [diff] [blame] | 46 | overlays/pitft28-resistive.dtbo \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 47 | overlays/pitft35-resistive.dtbo \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 48 | overlays/pps-gpio.dtbo \ |
| 49 | overlays/rpi-ft5406.dtbo \ |
Brad Bishop | 9392c69 | 2018-09-07 15:37:17 +0100 | [diff] [blame] | 50 | overlays/rpi-poe.dtbo \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 51 | overlays/vc4-fkms-v3d.dtbo \ |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 52 | overlays/vc4-fkms-v3d-pi4.dtbo \ |
Andrew Geissler | 1110521 | 2021-02-12 15:30:38 -0600 | [diff] [blame] | 53 | overlays/vc4-kms-v3d.dtbo \ |
Andrew Geissler | bd39bf6 | 2021-03-31 13:35:44 -0500 | [diff] [blame] | 54 | overlays/vc4-kms-v3d-pi4.dtbo \ |
Andrew Geissler | 3e34fba | 2021-03-05 15:21:55 -0600 | [diff] [blame] | 55 | overlays/vc4-kms-dsi-7inch.dtbo \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 56 | overlays/w1-gpio.dtbo \ |
Andrew Geissler | 1110521 | 2021-02-12 15:30:38 -0600 | [diff] [blame] | 57 | overlays/w1-gpio-pullup.dtbo \ |
Andrew Geissler | a4353c8 | 2021-06-25 14:23:27 -0500 | [diff] [blame] | 58 | overlays/wm8960-soundcard.dtbo \ |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 59 | " |
| 60 | |
| 61 | RPI_KERNEL_DEVICETREE ?= " \ |
Andrew Geissler | 1110521 | 2021-02-12 15:30:38 -0600 | [diff] [blame] | 62 | bcm2708-rpi-zero.dtb \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 63 | bcm2708-rpi-zero-w.dtb \ |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 64 | bcm2708-rpi-b.dtb \ |
Andrew Geissler | 1110521 | 2021-02-12 15:30:38 -0600 | [diff] [blame] | 65 | bcm2708-rpi-b-rev1.dtb \ |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 66 | bcm2708-rpi-b-plus.dtb \ |
| 67 | bcm2709-rpi-2-b.dtb \ |
Andrew Geissler | 1110521 | 2021-02-12 15:30:38 -0600 | [diff] [blame] | 68 | bcm2710-rpi-2-b.dtb \ |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 69 | bcm2710-rpi-3-b.dtb \ |
| 70 | bcm2710-rpi-3-b-plus.dtb \ |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 71 | bcm2710-rpi-zero-2.dtb \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 72 | bcm2711-rpi-4-b.dtb \ |
Andrew Geissler | 1110521 | 2021-02-12 15:30:38 -0600 | [diff] [blame] | 73 | bcm2711-rpi-400.dtb \ |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 74 | bcm2708-rpi-cm.dtb \ |
| 75 | bcm2710-rpi-cm3.dtb \ |
Andrew Geissler | 1110521 | 2021-02-12 15:30:38 -0600 | [diff] [blame] | 76 | bcm2711-rpi-cm4.dtb \ |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 77 | bcm2711-rpi-cm4s.dtb \ |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 78 | " |
| 79 | |
Andrew Geissler | 1110521 | 2021-02-12 15:30:38 -0600 | [diff] [blame] | 80 | KERNEL_DEVICETREE ??= " \ |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 81 | ${RPI_KERNEL_DEVICETREE} \ |
| 82 | ${RPI_KERNEL_DEVICETREE_OVERLAYS} \ |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 83 | " |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 84 | |
| 85 | # By default: |
| 86 | # |
| 87 | # * When u-boot is disabled use the "Image" format which can be directly loaded |
| 88 | # by the rpi firmware. |
| 89 | # |
| 90 | # * When u-boot is enabled use the "uImage" format and the "bootm" command |
| 91 | # within u-boot to load the kernel. |
| 92 | KERNEL_BOOTCMD ??= "bootm" |
| 93 | KERNEL_IMAGETYPE_UBOOT ??= "uImage" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 94 | KERNEL_IMAGETYPE_DIRECT ??= "zImage" |
| 95 | KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \ |
| 96 | '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 97 | |
Brad Bishop | 85521d7 | 2019-09-17 07:33:03 -0400 | [diff] [blame] | 98 | MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio ${@bb.utils.contains('DISABLE_VC4GRAPHICS', '1', '', 'vc4graphics', d)}" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 99 | |
| 100 | # Raspberry Pi has no hardware clock |
| 101 | MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc" |
| 102 | |
Andrew Geissler | 062316f | 2020-05-15 14:19:14 -0500 | [diff] [blame] | 103 | MACHINE_EXTRA_RRECOMMENDS += "kernel-modules udev-rules-rpi" |
| 104 | MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_I2C', '1', 'kernel-module-i2c-dev kernel-module-i2c-bcm2708', '', d)}" |
Andrew Geissler | 4fc9e43 | 2020-06-27 00:13:56 -0500 | [diff] [blame] | 105 | MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_IR', '1', 'kernel-module-gpio-ir kernel-module-gpio-ir-tx', '', d)}" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 106 | MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_GPIO_SHUTDOWN', '1', 'gpio-shutdown kernel-module-gpio-keys', '', d)}" |
Andrew Geissler | 062316f | 2020-05-15 14:19:14 -0500 | [diff] [blame] | 107 | |
Andrew Geissler | 5d59ec7 | 2020-07-24 16:09:26 -0500 | [diff] [blame] | 108 | SERIAL_CONSOLES_CHECK ??= "${SERIAL_CONSOLES}" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 109 | |
Andrew Geissler | 9d7e0aa | 2020-08-21 15:56:44 -0500 | [diff] [blame] | 110 | # The name of the deploy directory for raspberry pi boot files. |
| 111 | # This variable is referred to by recipes fetching / generating the files. |
| 112 | BOOTFILES_DIR_NAME ?= "bootfiles" |
| 113 | |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 114 | # Set Raspberrypi splash image |
William A. Kennington III | a99e9b6 | 2021-06-02 12:47:56 -0700 | [diff] [blame] | 115 | SPLASH ?= "psplash-raspberrypi" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 116 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 117 | def make_dtb_boot_files(d): |
| 118 | # Generate IMAGE_BOOT_FILES entries for device tree files listed in |
| 119 | # KERNEL_DEVICETREE. |
| 120 | alldtbs = d.getVar('KERNEL_DEVICETREE') |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 121 | |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 122 | # DTBs may be built out of kernel with devicetree.bbclass |
| 123 | if not alldtbs: |
| 124 | return '' |
| 125 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 126 | def transform(dtb): |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 127 | base = os.path.basename(dtb) |
Andrew Geissler | bd39bf6 | 2021-03-31 13:35:44 -0500 | [diff] [blame] | 128 | if dtb.endswith('dtbo') or base == 'overlay_map.dtb': |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 129 | # overlay dtb: |
| 130 | # eg: overlays/hifiberry-amp.dtbo has: |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 131 | # DEPLOYDIR file: hifiberry-amp.dtbo |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 132 | # destination: overlays/hifiberry-amp.dtbo |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 133 | return '{};{}'.format(base, dtb) |
Andrew Geissler | bd39bf6 | 2021-03-31 13:35:44 -0500 | [diff] [blame] | 134 | elif dtb.endswith('dtb'): |
| 135 | # eg: whatever/bcm2708-rpi-b.dtb has: |
| 136 | # DEPLOYDIR file: bcm2708-rpi-b.dtb |
| 137 | # destination: bcm2708-rpi-b.dtb |
| 138 | return base |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 139 | |
| 140 | return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb]) |
| 141 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 142 | RPI_EXTRA_IMAGE_BOOT_FILES ?= " \ |
| 143 | ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \ |
| 144 | '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \ |
| 145 | '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \ |
| 146 | " |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 147 | |
Andrew Geissler | 9d7e0aa | 2020-08-21 15:56:44 -0500 | [diff] [blame] | 148 | IMAGE_BOOT_FILES ?= "${BOOTFILES_DIR_NAME}/* \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 149 | ${@make_dtb_boot_files(d)} \ |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 150 | ${RPI_EXTRA_IMAGE_BOOT_FILES} \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 151 | " |
| 152 | do_image_wic[depends] += " \ |
Andrew Geissler | 26e4bea | 2020-11-30 19:54:03 -0600 | [diff] [blame] | 153 | rpi-bootfiles:do_deploy \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 154 | ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \ |
| 155 | " |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 156 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 157 | do_image_wic[recrdeps] = "do_build" |
| 158 | |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 159 | # The kernel image is installed into the FAT32 boot partition and does not need |
| 160 | # to also be installed into the rootfs. |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 161 | RDEPENDS:${KERNEL_PACKAGE_NAME}-base = "" |