blob: cd6d0b0f291dff61094ba357923135717eeda31a [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 ?= " \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080018 overlays/at86rf233.dtbo \
Andrew Geissler062316f2020-05-15 14:19:14 -050019 overlays/disable-bt.dtbo \
Brad Bishop316dfdd2018-06-25 12:45:53 -040020 overlays/dwc2.dtbo \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021 overlays/gpio-key.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060022 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 Geissler062316f2020-05-15 14:19:14 -050029 overlays/miniuart-bt.dtbo \
Brad Bishop19323692019-04-05 15:28:33 -040030 overlays/mcp2515-can0.dtbo \
Andrew Geissler5d59ec72020-07-24 16:09:26 -050031 overlays/mcp2515-can1.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060032 overlays/pitft22.dtbo \
33 overlays/pitft28-resistive.dtbo \
Brad Bishop1b9ee292020-01-16 09:06:00 -050034 overlays/pitft28-capacitive.dtbo \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050035 overlays/pitft35-resistive.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060036 overlays/pps-gpio.dtbo \
37 overlays/rpi-ft5406.dtbo \
Brad Bishop9392c692018-09-07 15:37:17 +010038 overlays/rpi-poe.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060039 overlays/vc4-kms-v3d.dtbo \
Brad Bishop26bdd442019-08-16 17:08:17 -040040 overlays/vc4-fkms-v3d.dtbo \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080041 overlays/w1-gpio-pullup.dtbo \
42 overlays/w1-gpio.dtbo \
Andrew Geissler2127dd92020-06-05 18:09:33 -050043 overlays/gpio-ir.dtbo \
44 overlays/gpio-ir-tx.dtbo \
Brad Bishopf27bdd52018-05-07 15:42:31 +020045 "
46
47RPI_KERNEL_DEVICETREE ?= " \
Brad Bishop26bdd442019-08-16 17:08:17 -040048 bcm2708-rpi-zero-w.dtb \
Brad Bishopf27bdd52018-05-07 15:42:31 +020049 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 Bishop26bdd442019-08-16 17:08:17 -040054 bcm2711-rpi-4-b.dtb \
Brad Bishopf27bdd52018-05-07 15:42:31 +020055 bcm2708-rpi-cm.dtb \
56 bcm2710-rpi-cm3.dtb \
57 "
58
59KERNEL_DEVICETREE ?= " \
60 ${RPI_KERNEL_DEVICETREE} \
61 ${RPI_KERNEL_DEVICETREE_OVERLAYS} \
Patrick Williams8b8bc412016-08-17 15:02:23 -050062 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050063
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.
71KERNEL_BOOTCMD ??= "bootm"
72KERNEL_IMAGETYPE_UBOOT ??= "uImage"
Brad Bishop316dfdd2018-06-25 12:45:53 -040073KERNEL_IMAGETYPE_DIRECT ??= "zImage"
74KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
75 '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}"
Patrick Williams8b8bc412016-08-17 15:02:23 -050076
Brad Bishop85521d72019-09-17 07:33:03 -040077MACHINE_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 -050078
79# Raspberry Pi has no hardware clock
80MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
81
Andrew Geissler062316f2020-05-15 14:19:14 -050082MACHINE_EXTRA_RRECOMMENDS += "kernel-modules udev-rules-rpi"
83MACHINE_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 -050084MACHINE_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 -050085
Andrew Geissler5d59ec72020-07-24 16:09:26 -050086SERIAL_CONSOLES_CHECK ??= "${SERIAL_CONSOLES}"
Patrick Williams8b8bc412016-08-17 15:02:23 -050087
Andrew Geissler9d7e0aa2020-08-21 15:56:44 -050088# The name of the deploy directory for raspberry pi boot files.
89# This variable is referred to by recipes fetching / generating the files.
90BOOTFILES_DIR_NAME ?= "bootfiles"
91
Patrick Williams8b8bc412016-08-17 15:02:23 -050092# Set Raspberrypi splash image
93SPLASH = "psplash-raspberrypi"
94
Brad Bishop6e60e8b2018-02-01 10:27:11 -050095def make_dtb_boot_files(d):
96 # Generate IMAGE_BOOT_FILES entries for device tree files listed in
97 # KERNEL_DEVICETREE.
98 alldtbs = d.getVar('KERNEL_DEVICETREE')
99 imgtyp = d.getVar('KERNEL_IMAGETYPE')
100
101 def transform(dtb):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800102 base = os.path.basename(dtb)
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500103 if dtb.endswith('dtb'):
104 # eg: whatever/bcm2708-rpi-b.dtb has:
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800105 # DEPLOYDIR file: bcm2708-rpi-b.dtb
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500106 # destination: bcm2708-rpi-b.dtb
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800107 return base
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500108 elif dtb.endswith('dtbo'):
109 # overlay dtb:
110 # eg: overlays/hifiberry-amp.dtbo has:
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800111 # DEPLOYDIR file: hifiberry-amp.dtbo
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500112 # destination: overlays/hifiberry-amp.dtbo
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800113 return '{};{}'.format(base, dtb)
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500114
115 return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
116
117
Andrew Geissler9d7e0aa2020-08-21 15:56:44 -0500118IMAGE_BOOT_FILES ?= "${BOOTFILES_DIR_NAME}/* \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500119 ${@make_dtb_boot_files(d)} \
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500120 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500121 '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \
122 '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
123 "
124do_image_wic[depends] += " \
Andrew Geissler9d7e0aa2020-08-21 15:56:44 -0500125 bootfiles:do_deploy \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500126 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
127 "
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600128
Brad Bishop316dfdd2018-06-25 12:45:53 -0400129do_image_wic[recrdeps] = "do_build"
130
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600131# The kernel image is installed into the FAT32 boot partition and does not need
132# to also be installed into the rootfs.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400133RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""