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 ?= " \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 18 | overlays/at86rf233.dtbo \ |
Andrew Geissler | 062316f | 2020-05-15 14:19:14 -0500 | [diff] [blame] | 19 | overlays/disable-bt.dtbo \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 20 | overlays/dwc2.dtbo \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 21 | overlays/gpio-key.dtbo \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 22 | overlays/hifiberry-amp.dtbo \ |
| 23 | overlays/hifiberry-dac.dtbo \ |
| 24 | overlays/hifiberry-dacplus.dtbo \ |
| 25 | overlays/hifiberry-digi.dtbo \ |
| 26 | overlays/i2c-rtc.dtbo \ |
| 27 | overlays/iqaudio-dac.dtbo \ |
| 28 | overlays/iqaudio-dacplus.dtbo \ |
Andrew Geissler | 062316f | 2020-05-15 14:19:14 -0500 | [diff] [blame] | 29 | overlays/miniuart-bt.dtbo \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 30 | overlays/mcp2515-can0.dtbo \ |
Andrew Geissler | 5d59ec7 | 2020-07-24 16:09:26 -0500 | [diff] [blame^] | 31 | overlays/mcp2515-can1.dtbo \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 32 | overlays/pitft22.dtbo \ |
| 33 | overlays/pitft28-resistive.dtbo \ |
Brad Bishop | 1b9ee29 | 2020-01-16 09:06:00 -0500 | [diff] [blame] | 34 | overlays/pitft28-capacitive.dtbo \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 35 | overlays/pitft35-resistive.dtbo \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 36 | overlays/pps-gpio.dtbo \ |
| 37 | overlays/rpi-ft5406.dtbo \ |
Brad Bishop | 9392c69 | 2018-09-07 15:37:17 +0100 | [diff] [blame] | 38 | overlays/rpi-poe.dtbo \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 39 | overlays/vc4-kms-v3d.dtbo \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 40 | overlays/vc4-fkms-v3d.dtbo \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 41 | overlays/w1-gpio-pullup.dtbo \ |
| 42 | overlays/w1-gpio.dtbo \ |
Andrew Geissler | 2127dd9 | 2020-06-05 18:09:33 -0500 | [diff] [blame] | 43 | overlays/gpio-ir.dtbo \ |
| 44 | overlays/gpio-ir-tx.dtbo \ |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 45 | " |
| 46 | |
| 47 | RPI_KERNEL_DEVICETREE ?= " \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 48 | bcm2708-rpi-zero-w.dtb \ |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 49 | bcm2708-rpi-b.dtb \ |
| 50 | bcm2708-rpi-b-plus.dtb \ |
| 51 | bcm2709-rpi-2-b.dtb \ |
| 52 | bcm2710-rpi-3-b.dtb \ |
| 53 | bcm2710-rpi-3-b-plus.dtb \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 54 | bcm2711-rpi-4-b.dtb \ |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 55 | bcm2708-rpi-cm.dtb \ |
| 56 | bcm2710-rpi-cm3.dtb \ |
| 57 | " |
| 58 | |
| 59 | KERNEL_DEVICETREE ?= " \ |
| 60 | ${RPI_KERNEL_DEVICETREE} \ |
| 61 | ${RPI_KERNEL_DEVICETREE_OVERLAYS} \ |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 62 | " |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 63 | |
| 64 | # By default: |
| 65 | # |
| 66 | # * When u-boot is disabled use the "Image" format which can be directly loaded |
| 67 | # by the rpi firmware. |
| 68 | # |
| 69 | # * When u-boot is enabled use the "uImage" format and the "bootm" command |
| 70 | # within u-boot to load the kernel. |
| 71 | KERNEL_BOOTCMD ??= "bootm" |
| 72 | KERNEL_IMAGETYPE_UBOOT ??= "uImage" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 73 | KERNEL_IMAGETYPE_DIRECT ??= "zImage" |
| 74 | KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \ |
| 75 | '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 76 | |
Brad Bishop | 85521d7 | 2019-09-17 07:33:03 -0400 | [diff] [blame] | 77 | 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] | 78 | |
| 79 | # Raspberry Pi has no hardware clock |
| 80 | MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc" |
| 81 | |
Andrew Geissler | 062316f | 2020-05-15 14:19:14 -0500 | [diff] [blame] | 82 | MACHINE_EXTRA_RRECOMMENDS += "kernel-modules udev-rules-rpi" |
| 83 | 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] | 84 | MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_IR', '1', 'kernel-module-gpio-ir kernel-module-gpio-ir-tx', '', d)}" |
Andrew Geissler | 062316f | 2020-05-15 14:19:14 -0500 | [diff] [blame] | 85 | |
Andrew Geissler | 5d59ec7 | 2020-07-24 16:09:26 -0500 | [diff] [blame^] | 86 | SERIAL_CONSOLES_CHECK ??= "${SERIAL_CONSOLES}" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 87 | |
| 88 | # Set Raspberrypi splash image |
| 89 | SPLASH = "psplash-raspberrypi" |
| 90 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 91 | def make_dtb_boot_files(d): |
| 92 | # Generate IMAGE_BOOT_FILES entries for device tree files listed in |
| 93 | # KERNEL_DEVICETREE. |
| 94 | alldtbs = d.getVar('KERNEL_DEVICETREE') |
| 95 | imgtyp = d.getVar('KERNEL_IMAGETYPE') |
| 96 | |
| 97 | def transform(dtb): |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 98 | base = os.path.basename(dtb) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 99 | if dtb.endswith('dtb'): |
| 100 | # eg: whatever/bcm2708-rpi-b.dtb has: |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 101 | # DEPLOYDIR file: bcm2708-rpi-b.dtb |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 102 | # destination: bcm2708-rpi-b.dtb |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 103 | return base |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 104 | elif dtb.endswith('dtbo'): |
| 105 | # overlay dtb: |
| 106 | # eg: overlays/hifiberry-amp.dtbo has: |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 107 | # DEPLOYDIR file: hifiberry-amp.dtbo |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 108 | # destination: overlays/hifiberry-amp.dtbo |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 109 | return '{};{}'.format(base, dtb) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 110 | |
| 111 | return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb]) |
| 112 | |
| 113 | |
| 114 | IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* \ |
| 115 | ${@make_dtb_boot_files(d)} \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 116 | ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 117 | '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \ |
| 118 | '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \ |
| 119 | " |
| 120 | do_image_wic[depends] += " \ |
| 121 | bcm2835-bootfiles:do_deploy \ |
| 122 | ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \ |
| 123 | " |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 124 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 125 | do_image_wic[recrdeps] = "do_build" |
| 126 | |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 127 | # The kernel image is installed into the FAT32 boot partition and does not need |
| 128 | # to also be installed into the rootfs. |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 129 | RDEPENDS_${KERNEL_PACKAGE_NAME}-base = "" |