blob: 539d1bc121b88fc4b58f82bff0cc4b901fec9657 [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 Bishop316dfdd2018-06-25 12:45:53 -040018 overlays/dwc2.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060019 overlays/hifiberry-amp.dtbo \
20 overlays/hifiberry-dac.dtbo \
21 overlays/hifiberry-dacplus.dtbo \
22 overlays/hifiberry-digi.dtbo \
23 overlays/i2c-rtc.dtbo \
24 overlays/iqaudio-dac.dtbo \
25 overlays/iqaudio-dacplus.dtbo \
26 overlays/lirc-rpi.dtbo \
27 overlays/pitft22.dtbo \
28 overlays/pitft28-resistive.dtbo \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050029 overlays/pitft35-resistive.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060030 overlays/pps-gpio.dtbo \
31 overlays/rpi-ft5406.dtbo \
Brad Bishop9392c692018-09-07 15:37:17 +010032 overlays/rpi-poe.dtbo \
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060033 overlays/w1-gpio.dtbo \
34 overlays/w1-gpio-pullup.dtbo \
35 overlays/pi3-disable-bt.dtbo \
36 overlays/pi3-miniuart-bt.dtbo \
37 overlays/vc4-kms-v3d.dtbo \
Brad Bishopf27bdd52018-05-07 15:42:31 +020038 overlays/at86rf233.dtbo \
39 "
40
41RPI_KERNEL_DEVICETREE ?= " \
42 bcm2708-rpi-0-w.dtb \
43 bcm2708-rpi-b.dtb \
44 bcm2708-rpi-b-plus.dtb \
45 bcm2709-rpi-2-b.dtb \
46 bcm2710-rpi-3-b.dtb \
47 bcm2710-rpi-3-b-plus.dtb \
48 bcm2708-rpi-cm.dtb \
49 bcm2710-rpi-cm3.dtb \
50 "
51
52KERNEL_DEVICETREE ?= " \
53 ${RPI_KERNEL_DEVICETREE} \
54 ${RPI_KERNEL_DEVICETREE_OVERLAYS} \
Patrick Williams8b8bc412016-08-17 15:02:23 -050055 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050056
57# By default:
58#
59# * When u-boot is disabled use the "Image" format which can be directly loaded
60# by the rpi firmware.
61#
62# * When u-boot is enabled use the "uImage" format and the "bootm" command
63# within u-boot to load the kernel.
64KERNEL_BOOTCMD ??= "bootm"
65KERNEL_IMAGETYPE_UBOOT ??= "uImage"
Brad Bishop316dfdd2018-06-25 12:45:53 -040066KERNEL_IMAGETYPE_DIRECT ??= "zImage"
67KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
68 '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}"
Patrick Williams8b8bc412016-08-17 15:02:23 -050069
70MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio"
71
72# Raspberry Pi has no hardware clock
73MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
74
Brad Bishop316dfdd2018-06-25 12:45:53 -040075MACHINE_EXTRA_RRECOMMENDS += " kernel-modules udev-rules-rpi"
Patrick Williams8b8bc412016-08-17 15:02:23 -050076
77# Set Raspberrypi splash image
78SPLASH = "psplash-raspberrypi"
79
Brad Bishop6e60e8b2018-02-01 10:27:11 -050080def make_dtb_boot_files(d):
81 # Generate IMAGE_BOOT_FILES entries for device tree files listed in
82 # KERNEL_DEVICETREE.
83 alldtbs = d.getVar('KERNEL_DEVICETREE')
84 imgtyp = d.getVar('KERNEL_IMAGETYPE')
85
86 def transform(dtb):
87 if dtb.endswith('dtb'):
88 # eg: whatever/bcm2708-rpi-b.dtb has:
89 # DEPLOYDIR file: ${KERNEL_IMAGETYPE}-bcm2708-rpi-b.dtb
90 # destination: bcm2708-rpi-b.dtb
91 base = os.path.basename(dtb)
92 src = '{}-{}'.format(imgtyp, base)
93 dst = base
94 return '{};{}'.format(src, dst)
95 elif dtb.endswith('dtbo'):
96 # overlay dtb:
97 # eg: overlays/hifiberry-amp.dtbo has:
98 # DEPLOYDIR file: ${KERNEL_IMAGETYPE}-hifiberry-amp.dtbo
99 # destination: overlays/hifiberry-amp.dtbo
100 base = os.path.basename(dtb)
101 src = '{}-{}'.format(imgtyp, base)
102 dst = dtb
103 return '{};{}'.format(src, dtb)
104
105 return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
106
107
108IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* \
109 ${@make_dtb_boot_files(d)} \
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500110 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500111 '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \
112 '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
113 "
114do_image_wic[depends] += " \
115 bcm2835-bootfiles:do_deploy \
116 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
117 "
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600118
Brad Bishop316dfdd2018-06-25 12:45:53 -0400119do_image_wic[recrdeps] = "do_build"
120
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600121# The kernel image is installed into the FAT32 boot partition and does not need
122# to also be installed into the rootfs.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400123RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""