blob: d76495a686319d80a2146b5d2d02d81c3b537907 [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
Patrick Williams8b8bc412016-08-17 15:02:23 -050017KERNEL_DEVICETREE ?= " \
Brad Bishop3a5fbf52017-12-04 02:17:07 -050018 bcm2708-rpi-0-w.dtb \
Patrick Williams8b8bc412016-08-17 15:02:23 -050019 bcm2708-rpi-b.dtb \
20 bcm2708-rpi-b-plus.dtb \
21 bcm2709-rpi-2-b.dtb \
22 bcm2710-rpi-3-b.dtb \
Brad Bishop316dfdd2018-06-25 12:45:53 -040023 bcm2710-rpi-3-b-plus.dtb \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060024 bcm2708-rpi-cm.dtb \
25 bcm2710-rpi-cm3.dtb \
Patrick Williams8b8bc412016-08-17 15:02:23 -050026 \
Brad Bishop316dfdd2018-06-25 12:45:53 -040027 overlays/dwc2.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060028 overlays/hifiberry-amp.dtbo \
29 overlays/hifiberry-dac.dtbo \
30 overlays/hifiberry-dacplus.dtbo \
31 overlays/hifiberry-digi.dtbo \
32 overlays/i2c-rtc.dtbo \
33 overlays/iqaudio-dac.dtbo \
34 overlays/iqaudio-dacplus.dtbo \
35 overlays/lirc-rpi.dtbo \
36 overlays/pitft22.dtbo \
37 overlays/pitft28-resistive.dtbo \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050038 overlays/pitft35-resistive.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060039 overlays/pps-gpio.dtbo \
40 overlays/rpi-ft5406.dtbo \
41 overlays/w1-gpio.dtbo \
42 overlays/w1-gpio-pullup.dtbo \
43 overlays/pi3-disable-bt.dtbo \
44 overlays/pi3-miniuart-bt.dtbo \
45 overlays/vc4-kms-v3d.dtbo \
Patrick Williams8b8bc412016-08-17 15:02:23 -050046 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050047
48# By default:
49#
50# * When u-boot is disabled use the "Image" format which can be directly loaded
51# by the rpi firmware.
52#
53# * When u-boot is enabled use the "uImage" format and the "bootm" command
54# within u-boot to load the kernel.
55KERNEL_BOOTCMD ??= "bootm"
56KERNEL_IMAGETYPE_UBOOT ??= "uImage"
Brad Bishop316dfdd2018-06-25 12:45:53 -040057KERNEL_IMAGETYPE_DIRECT ??= "zImage"
58KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
59 '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}"
Patrick Williams8b8bc412016-08-17 15:02:23 -050060
61MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio"
62
63# Raspberry Pi has no hardware clock
64MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
65
Brad Bishop316dfdd2018-06-25 12:45:53 -040066MACHINE_EXTRA_RRECOMMENDS += " kernel-modules udev-rules-rpi"
Patrick Williams8b8bc412016-08-17 15:02:23 -050067
68# Set Raspberrypi splash image
69SPLASH = "psplash-raspberrypi"
70
Brad Bishop6e60e8b2018-02-01 10:27:11 -050071def make_dtb_boot_files(d):
72 # Generate IMAGE_BOOT_FILES entries for device tree files listed in
73 # KERNEL_DEVICETREE.
74 alldtbs = d.getVar('KERNEL_DEVICETREE')
75 imgtyp = d.getVar('KERNEL_IMAGETYPE')
76
77 def transform(dtb):
78 if dtb.endswith('dtb'):
79 # eg: whatever/bcm2708-rpi-b.dtb has:
80 # DEPLOYDIR file: ${KERNEL_IMAGETYPE}-bcm2708-rpi-b.dtb
81 # destination: bcm2708-rpi-b.dtb
82 base = os.path.basename(dtb)
83 src = '{}-{}'.format(imgtyp, base)
84 dst = base
85 return '{};{}'.format(src, dst)
86 elif dtb.endswith('dtbo'):
87 # overlay dtb:
88 # eg: overlays/hifiberry-amp.dtbo has:
89 # DEPLOYDIR file: ${KERNEL_IMAGETYPE}-hifiberry-amp.dtbo
90 # destination: overlays/hifiberry-amp.dtbo
91 base = os.path.basename(dtb)
92 src = '{}-{}'.format(imgtyp, base)
93 dst = dtb
94 return '{};{}'.format(src, dtb)
95
96 return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
97
98
99IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* \
100 ${@make_dtb_boot_files(d)} \
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500101 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500102 '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \
103 '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
104 "
105do_image_wic[depends] += " \
106 bcm2835-bootfiles:do_deploy \
107 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
108 "
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600109
Brad Bishop316dfdd2018-06-25 12:45:53 -0400110do_image_wic[recrdeps] = "do_build"
111
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600112# The kernel image is installed into the FAT32 boot partition and does not need
113# to also be installed into the rootfs.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400114RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""