blob: af1418df5b822fdcc605b6962aeb319c9a816484 [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
8IMAGE_FSTYPES ?= "tar.bz2 ext3 rpi-sdimg"
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 \
Brad Bishop316dfdd2018-06-25 12:45:53 -040019 overlays/dwc2.dtbo \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080020 overlays/gpio-key.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060021 overlays/hifiberry-amp.dtbo \
22 overlays/hifiberry-dac.dtbo \
23 overlays/hifiberry-dacplus.dtbo \
24 overlays/hifiberry-digi.dtbo \
25 overlays/i2c-rtc.dtbo \
26 overlays/iqaudio-dac.dtbo \
27 overlays/iqaudio-dacplus.dtbo \
Brad Bishop19323692019-04-05 15:28:33 -040028 overlays/mcp2515-can0.dtbo \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080029 overlays/pi3-disable-bt.dtbo \
30 overlays/pi3-miniuart-bt.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060031 overlays/pitft22.dtbo \
32 overlays/pitft28-resistive.dtbo \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050033 overlays/pitft35-resistive.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060034 overlays/pps-gpio.dtbo \
35 overlays/rpi-ft5406.dtbo \
Brad Bishop9392c692018-09-07 15:37:17 +010036 overlays/rpi-poe.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060037 overlays/vc4-kms-v3d.dtbo \
Brad Bishop26bdd442019-08-16 17:08:17 -040038 overlays/vc4-fkms-v3d.dtbo \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080039 overlays/w1-gpio-pullup.dtbo \
40 overlays/w1-gpio.dtbo \
Brad Bishopf27bdd52018-05-07 15:42:31 +020041 "
42
43RPI_KERNEL_DEVICETREE ?= " \
Brad Bishop26bdd442019-08-16 17:08:17 -040044 bcm2708-rpi-zero-w.dtb \
Brad Bishopf27bdd52018-05-07 15:42:31 +020045 bcm2708-rpi-b.dtb \
46 bcm2708-rpi-b-plus.dtb \
47 bcm2709-rpi-2-b.dtb \
48 bcm2710-rpi-3-b.dtb \
49 bcm2710-rpi-3-b-plus.dtb \
Brad Bishop26bdd442019-08-16 17:08:17 -040050 bcm2711-rpi-4-b.dtb \
Brad Bishopf27bdd52018-05-07 15:42:31 +020051 bcm2708-rpi-cm.dtb \
52 bcm2710-rpi-cm3.dtb \
53 "
54
55KERNEL_DEVICETREE ?= " \
56 ${RPI_KERNEL_DEVICETREE} \
57 ${RPI_KERNEL_DEVICETREE_OVERLAYS} \
Patrick Williams8b8bc412016-08-17 15:02:23 -050058 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050059
60# By default:
61#
62# * When u-boot is disabled use the "Image" format which can be directly loaded
63# by the rpi firmware.
64#
65# * When u-boot is enabled use the "uImage" format and the "bootm" command
66# within u-boot to load the kernel.
67KERNEL_BOOTCMD ??= "bootm"
68KERNEL_IMAGETYPE_UBOOT ??= "uImage"
Brad Bishop316dfdd2018-06-25 12:45:53 -040069KERNEL_IMAGETYPE_DIRECT ??= "zImage"
70KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
71 '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}"
Patrick Williams8b8bc412016-08-17 15:02:23 -050072
Brad Bishop26bdd442019-08-16 17:08:17 -040073MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio vc4graphics"
Patrick Williams8b8bc412016-08-17 15:02:23 -050074
75# Raspberry Pi has no hardware clock
76MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
77
Brad Bishop316dfdd2018-06-25 12:45:53 -040078MACHINE_EXTRA_RRECOMMENDS += " kernel-modules udev-rules-rpi"
Patrick Williams8b8bc412016-08-17 15:02:23 -050079
80# Set Raspberrypi splash image
81SPLASH = "psplash-raspberrypi"
82
Brad Bishop6e60e8b2018-02-01 10:27:11 -050083def make_dtb_boot_files(d):
84 # Generate IMAGE_BOOT_FILES entries for device tree files listed in
85 # KERNEL_DEVICETREE.
86 alldtbs = d.getVar('KERNEL_DEVICETREE')
87 imgtyp = d.getVar('KERNEL_IMAGETYPE')
88
89 def transform(dtb):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080090 base = os.path.basename(dtb)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050091 if dtb.endswith('dtb'):
92 # eg: whatever/bcm2708-rpi-b.dtb has:
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080093 # DEPLOYDIR file: bcm2708-rpi-b.dtb
Brad Bishop6e60e8b2018-02-01 10:27:11 -050094 # destination: bcm2708-rpi-b.dtb
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080095 return base
Brad Bishop6e60e8b2018-02-01 10:27:11 -050096 elif dtb.endswith('dtbo'):
97 # overlay dtb:
98 # eg: overlays/hifiberry-amp.dtbo has:
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080099 # DEPLOYDIR file: hifiberry-amp.dtbo
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500100 # destination: overlays/hifiberry-amp.dtbo
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800101 return '{};{}'.format(base, dtb)
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500102
103 return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
104
105
106IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* \
107 ${@make_dtb_boot_files(d)} \
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500108 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500109 '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \
110 '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
111 "
112do_image_wic[depends] += " \
113 bcm2835-bootfiles:do_deploy \
114 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
115 "
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600116
Brad Bishop316dfdd2018-06-25 12:45:53 -0400117do_image_wic[recrdeps] = "do_build"
118
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600119# The kernel image is installed into the FAT32 boot partition and does not need
120# to also be installed into the rootfs.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400121RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""