blob: 2af15886b3ef79dee5e7b9ac9eba01fffc624fb8 [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 \
32 overlays/w1-gpio.dtbo \
33 overlays/w1-gpio-pullup.dtbo \
34 overlays/pi3-disable-bt.dtbo \
35 overlays/pi3-miniuart-bt.dtbo \
36 overlays/vc4-kms-v3d.dtbo \
Brad Bishopf27bdd52018-05-07 15:42:31 +020037 overlays/at86rf233.dtbo \
38 "
39
40RPI_KERNEL_DEVICETREE ?= " \
41 bcm2708-rpi-0-w.dtb \
42 bcm2708-rpi-b.dtb \
43 bcm2708-rpi-b-plus.dtb \
44 bcm2709-rpi-2-b.dtb \
45 bcm2710-rpi-3-b.dtb \
46 bcm2710-rpi-3-b-plus.dtb \
47 bcm2708-rpi-cm.dtb \
48 bcm2710-rpi-cm3.dtb \
49 "
50
51KERNEL_DEVICETREE ?= " \
52 ${RPI_KERNEL_DEVICETREE} \
53 ${RPI_KERNEL_DEVICETREE_OVERLAYS} \
Patrick Williams8b8bc412016-08-17 15:02:23 -050054 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050055
56# By default:
57#
58# * When u-boot is disabled use the "Image" format which can be directly loaded
59# by the rpi firmware.
60#
61# * When u-boot is enabled use the "uImage" format and the "bootm" command
62# within u-boot to load the kernel.
63KERNEL_BOOTCMD ??= "bootm"
64KERNEL_IMAGETYPE_UBOOT ??= "uImage"
Brad Bishop316dfdd2018-06-25 12:45:53 -040065KERNEL_IMAGETYPE_DIRECT ??= "zImage"
66KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
67 '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}"
Patrick Williams8b8bc412016-08-17 15:02:23 -050068
69MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio"
70
71# Raspberry Pi has no hardware clock
72MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
73
Brad Bishop316dfdd2018-06-25 12:45:53 -040074MACHINE_EXTRA_RRECOMMENDS += " kernel-modules udev-rules-rpi"
Patrick Williams8b8bc412016-08-17 15:02:23 -050075
76# Set Raspberrypi splash image
77SPLASH = "psplash-raspberrypi"
78
Brad Bishop6e60e8b2018-02-01 10:27:11 -050079def make_dtb_boot_files(d):
80 # Generate IMAGE_BOOT_FILES entries for device tree files listed in
81 # KERNEL_DEVICETREE.
82 alldtbs = d.getVar('KERNEL_DEVICETREE')
83 imgtyp = d.getVar('KERNEL_IMAGETYPE')
84
85 def transform(dtb):
86 if dtb.endswith('dtb'):
87 # eg: whatever/bcm2708-rpi-b.dtb has:
88 # DEPLOYDIR file: ${KERNEL_IMAGETYPE}-bcm2708-rpi-b.dtb
89 # destination: bcm2708-rpi-b.dtb
90 base = os.path.basename(dtb)
91 src = '{}-{}'.format(imgtyp, base)
92 dst = base
93 return '{};{}'.format(src, dst)
94 elif dtb.endswith('dtbo'):
95 # overlay dtb:
96 # eg: overlays/hifiberry-amp.dtbo has:
97 # DEPLOYDIR file: ${KERNEL_IMAGETYPE}-hifiberry-amp.dtbo
98 # destination: overlays/hifiberry-amp.dtbo
99 base = os.path.basename(dtb)
100 src = '{}-{}'.format(imgtyp, base)
101 dst = dtb
102 return '{};{}'.format(src, dtb)
103
104 return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
105
106
107IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* \
108 ${@make_dtb_boot_files(d)} \
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500109 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500110 '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \
111 '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
112 "
113do_image_wic[depends] += " \
114 bcm2835-bootfiles:do_deploy \
115 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
116 "
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600117
Brad Bishop316dfdd2018-06-25 12:45:53 -0400118do_image_wic[recrdeps] = "do_build"
119
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600120# The kernel image is installed into the FAT32 boot partition and does not need
121# to also be installed into the rootfs.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400122RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""