1include 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
8IMAGE_FSTYPES ?= "tar.bz2 ext3 wic.bz2 wic.bmap"
9WKS_FILE ?= "sdimage-raspberrypi.wks"
10
11XSERVER = " \
12    xserver-xorg \
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)} \
15    "
16
17RPI_KERNEL_DEVICETREE_OVERLAYS ?= " \
18    overlays/at86rf233.dtbo \
19    overlays/disable-bt.dtbo \
20    overlays/dwc2.dtbo \
21    overlays/gpio-key.dtbo \
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 \
29    overlays/miniuart-bt.dtbo \
30    overlays/mcp2515-can0.dtbo \
31    overlays/mcp2515-can1.dtbo \
32    overlays/pitft22.dtbo \
33    overlays/pitft28-resistive.dtbo \
34    overlays/pitft28-capacitive.dtbo \
35    overlays/pitft35-resistive.dtbo \
36    overlays/pps-gpio.dtbo \
37    overlays/rpi-ft5406.dtbo \
38    overlays/rpi-poe.dtbo \
39    overlays/vc4-kms-v3d.dtbo \
40    overlays/vc4-fkms-v3d.dtbo \
41    overlays/w1-gpio-pullup.dtbo \
42    overlays/w1-gpio.dtbo \
43    overlays/gpio-ir.dtbo \
44    overlays/gpio-ir-tx.dtbo \
45    "
46
47RPI_KERNEL_DEVICETREE ?= " \
48    bcm2708-rpi-zero-w.dtb \
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 \
54    bcm2711-rpi-4-b.dtb \
55    bcm2708-rpi-cm.dtb \
56    bcm2710-rpi-cm3.dtb \
57    "
58
59KERNEL_DEVICETREE ?= " \
60    ${RPI_KERNEL_DEVICETREE} \
61    ${RPI_KERNEL_DEVICETREE_OVERLAYS} \
62    "
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.
71KERNEL_BOOTCMD ??= "bootm"
72KERNEL_IMAGETYPE_UBOOT ??= "uImage"
73KERNEL_IMAGETYPE_DIRECT ??= "zImage"
74KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
75        '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}"
76
77MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio ${@bb.utils.contains('DISABLE_VC4GRAPHICS', '1', '', 'vc4graphics', d)}"
78
79# Raspberry Pi has no hardware clock
80MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
81
82MACHINE_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)}"
84MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "${@oe.utils.conditional('ENABLE_IR', '1', 'kernel-module-gpio-ir kernel-module-gpio-ir-tx', '', d)}"
85
86SERIAL_CONSOLES_CHECK ??= "${SERIAL_CONSOLES}"
87
88# Set Raspberrypi splash image
89SPLASH = "psplash-raspberrypi"
90
91def 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):
98        base = os.path.basename(dtb)
99        if dtb.endswith('dtb'):
100            # eg: whatever/bcm2708-rpi-b.dtb has:
101            #     DEPLOYDIR file: bcm2708-rpi-b.dtb
102            #     destination: bcm2708-rpi-b.dtb
103            return base
104        elif dtb.endswith('dtbo'):
105            # overlay dtb:
106            # eg: overlays/hifiberry-amp.dtbo has:
107            #     DEPLOYDIR file: hifiberry-amp.dtbo
108            #     destination: overlays/hifiberry-amp.dtbo
109            return '{};{}'.format(base, dtb)
110
111    return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
112
113
114IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* \
115                 ${@make_dtb_boot_files(d)} \
116                 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
117                    '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \
118                    '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
119                 "
120do_image_wic[depends] += " \
121    bcm2835-bootfiles:do_deploy \
122    ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
123    "
124
125do_image_wic[recrdeps] = "do_build"
126
127# The kernel image is installed into the FAT32 boot partition and does not need
128# to also be installed into the rootfs.
129RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""
130