summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel BORNAZ <daniel.bornaz@enea.com>2019-09-16 17:46:36 +0200
committerDaniel BORNAZ <daniel.bornaz@enea.com>2019-09-16 17:46:43 +0200
commitd89ee4aa5c9e1e398d64a8ff2c0bbbee7ebd7ecc (patch)
tree1e7e552427353172d86ed7ec781fc9abfd9c1f41
parent455934c15968eb8c937d2314f2d62c7db25350e9 (diff)
downloadmeta-enea-bsp-arm-d89ee4aa5c9e1e398d64a8ff2c0bbbee7ebd7ecc.tar.gz
Added PREEMPT_RT machine defs for RPi
Added recipe append file and machine configuration for RPi3 platform. Change-Id: Ie2f36eb1993c7c48614a78d8c04e4a9057a9ab51
-rw-r--r--conf/layer.conf2
-rw-r--r--conf/machine/include/rpi-base.inc121
-rw-r--r--conf/machine/include/rpi-default-providers.inc10
-rw-r--r--conf/machine/include/rpi-default-settings.inc3
-rw-r--r--conf/machine/include/rpi-default-versions.inc3
-rw-r--r--conf/machine/include/tune-arm1176jzf-s.inc15
-rw-r--r--conf/machine/raspberrypi3-64-rt.conf37
-rw-r--r--recipes-kernel/linux/linux-raspberrypi-rt_4.19.bbappend2
8 files changed, 192 insertions, 1 deletions
diff --git a/conf/layer.conf b/conf/layer.conf
index 0eaaaba..b55f7cb 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -10,4 +10,4 @@ BBFILE_COLLECTIONS += "enea-bsp-arm"
10BBFILE_PATTERN_enea-bsp-arm = "^${LAYERDIR}/" 10BBFILE_PATTERN_enea-bsp-arm = "^${LAYERDIR}/"
11BBFILE_PRIORITY_enea-bsp-arm = "6" 11BBFILE_PRIORITY_enea-bsp-arm = "6"
12LAYERDEPENDS_enea-bsp-arm = "enea-bsp-common" 12LAYERDEPENDS_enea-bsp-arm = "enea-bsp-common"
13LAYERSERIES_COMPAT_enea-bsp-arm = "sumo" 13LAYERSERIES_COMPAT_enea-bsp-arm = "warrior"
diff --git a/conf/machine/include/rpi-base.inc b/conf/machine/include/rpi-base.inc
new file mode 100644
index 0000000..af1418d
--- /dev/null
+++ b/conf/machine/include/rpi-base.inc
@@ -0,0 +1,121 @@
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 rpi-sdimg"
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/dwc2.dtbo \
20 overlays/gpio-key.dtbo \
21 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 \
28 overlays/mcp2515-can0.dtbo \
29 overlays/pi3-disable-bt.dtbo \
30 overlays/pi3-miniuart-bt.dtbo \
31 overlays/pitft22.dtbo \
32 overlays/pitft28-resistive.dtbo \
33 overlays/pitft35-resistive.dtbo \
34 overlays/pps-gpio.dtbo \
35 overlays/rpi-ft5406.dtbo \
36 overlays/rpi-poe.dtbo \
37 overlays/vc4-kms-v3d.dtbo \
38 overlays/vc4-fkms-v3d.dtbo \
39 overlays/w1-gpio-pullup.dtbo \
40 overlays/w1-gpio.dtbo \
41 "
42
43RPI_KERNEL_DEVICETREE ?= " \
44 bcm2708-rpi-zero-w.dtb \
45 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 \
50 bcm2711-rpi-4-b.dtb \
51 bcm2708-rpi-cm.dtb \
52 bcm2710-rpi-cm3.dtb \
53 "
54
55KERNEL_DEVICETREE ?= " \
56 ${RPI_KERNEL_DEVICETREE} \
57 ${RPI_KERNEL_DEVICETREE_OVERLAYS} \
58 "
59
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"
69KERNEL_IMAGETYPE_DIRECT ??= "zImage"
70KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
71 '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}"
72
73MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio vc4graphics"
74
75# Raspberry Pi has no hardware clock
76MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
77
78MACHINE_EXTRA_RRECOMMENDS += " kernel-modules udev-rules-rpi"
79
80# Set Raspberrypi splash image
81SPLASH = "psplash-raspberrypi"
82
83def 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):
90 base = os.path.basename(dtb)
91 if dtb.endswith('dtb'):
92 # eg: whatever/bcm2708-rpi-b.dtb has:
93 # DEPLOYDIR file: bcm2708-rpi-b.dtb
94 # destination: bcm2708-rpi-b.dtb
95 return base
96 elif dtb.endswith('dtbo'):
97 # overlay dtb:
98 # eg: overlays/hifiberry-amp.dtbo has:
99 # DEPLOYDIR file: hifiberry-amp.dtbo
100 # destination: overlays/hifiberry-amp.dtbo
101 return '{};{}'.format(base, dtb)
102
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)} \
108 ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
109 '${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 "
116
117do_image_wic[recrdeps] = "do_build"
118
119# The kernel image is installed into the FAT32 boot partition and does not need
120# to also be installed into the rootfs.
121RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""
diff --git a/conf/machine/include/rpi-default-providers.inc b/conf/machine/include/rpi-default-providers.inc
new file mode 100644
index 0000000..5231a84
--- /dev/null
+++ b/conf/machine/include/rpi-default-providers.inc
@@ -0,0 +1,10 @@
1# RaspberryPi BSP default providers
2
3PREFERRED_PROVIDER_virtual/kernel ?= "linux-raspberrypi"
4PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
5PREFERRED_PROVIDER_virtual/egl ?= "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "mesa", "userland", d)}"
6PREFERRED_PROVIDER_virtual/libgles2 ?= "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "mesa", "userland", d)}"
7PREFERRED_PROVIDER_virtual/libgl ?= "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "mesa", "mesa-gl", d)}"
8PREFERRED_PROVIDER_virtual/mesa ?= "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "mesa", "mesa-gl", d)}"
9PREFERRED_PROVIDER_virtual/libgbm ?= "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "mesa", "mesa-gl", d)}"
10PREFERRED_PROVIDER_jpeg ?= "jpeg"
diff --git a/conf/machine/include/rpi-default-settings.inc b/conf/machine/include/rpi-default-settings.inc
new file mode 100644
index 0000000..716a8bb
--- /dev/null
+++ b/conf/machine/include/rpi-default-settings.inc
@@ -0,0 +1,3 @@
1# RaspberryPi BSP default settings
2
3IMAGE_CLASSES += "sdcard_image-rpi"
diff --git a/conf/machine/include/rpi-default-versions.inc b/conf/machine/include/rpi-default-versions.inc
new file mode 100644
index 0000000..9983b61
--- /dev/null
+++ b/conf/machine/include/rpi-default-versions.inc
@@ -0,0 +1,3 @@
1# RaspberryPi BSP default versions
2
3PREFERRED_VERSION_linux-raspberrypi ??= "4.19.%"
diff --git a/conf/machine/include/tune-arm1176jzf-s.inc b/conf/machine/include/tune-arm1176jzf-s.inc
new file mode 100644
index 0000000..b6fcc59
--- /dev/null
+++ b/conf/machine/include/tune-arm1176jzf-s.inc
@@ -0,0 +1,15 @@
1DEFAULTTUNE ?= "armv6"
2
3require conf/machine/include/arm/arch-armv6.inc
4
5TUNEVALID[arm1176jzfs] = "Enable arm1176jzfs specific processor optimizations"
6TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "arm1176jzfs", "-mtune=arm1176jzf-s", "", d)}"
7TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "vfp", "-mfpu=vfp", "", d)}"
8
9AVAILTUNES += "arm1176jzfs arm1176jzfshf"
10ARMPKGARCH_tune-arm1176jzfs = "arm1176jzfs"
11ARMPKGARCH_tune-arm1176jzfshf = "arm1176jzfs"
12TUNE_FEATURES_tune-arm1176jzfs = "${TUNE_FEATURES_tune-armv6} arm1176jzfs"
13TUNE_FEATURES_tune-arm1176jzfshf = "${TUNE_FEATURES_tune-arm1176jzfs} callconvention-hard"
14PACKAGE_EXTRA_ARCHS_tune-arm1176jzfs = "${PACKAGE_EXTRA_ARCHS_tune-armv6}"
15PACKAGE_EXTRA_ARCHS_tune-arm1176jzfshf = "${PACKAGE_EXTRA_ARCHS_tune-armv6hf} arm1176jzfshf-vfp"
diff --git a/conf/machine/raspberrypi3-64-rt.conf b/conf/machine/raspberrypi3-64-rt.conf
new file mode 100644
index 0000000..8f59155
--- /dev/null
+++ b/conf/machine/raspberrypi3-64-rt.conf
@@ -0,0 +1,37 @@
1#@TYPE: Machine
2#@NAME: RaspberryPi 3 Development Board
3#@DESCRIPTION: Machine configuration for the RaspberryPi 3 in 64 bits mode
4
5MACHINEOVERRIDES = "raspberrypi3:${MACHINE}"
6
7MACHINE_EXTRA_RRECOMMENDS += "\
8 linux-firmware-rpidistro-bcm43430 \
9 linux-firmware-rpidistro-bcm43455 \
10 bluez-firmware-rpidistro-bcm43430a1-hcd \
11 bluez-firmware-rpidistro-bcm4345c0-hcd \
12"
13
14require conf/machine/include/tune-cortexa53.inc
15include conf/machine/include/rpi-base.inc
16
17PREFERRED_PROVIDER_virtual/kernel = "linux-raspberrypi-rt"
18
19RPI_KERNEL_DEVICETREE = " \
20 broadcom/bcm2710-rpi-3-b.dtb \
21 broadcom/bcm2710-rpi-3-b-plus.dtb \
22 broadcom/bcm2837-rpi-3-b.dtb \
23 "
24
25SERIAL_CONSOLES ?= "115200;ttyS0"
26
27UBOOT_MACHINE = "rpi_3_config"
28MACHINE_FEATURES_append = " vc4graphics"
29
30# When u-boot is enabled we need to use the "Image" format and the "booti"
31# command to load the kernel
32KERNEL_IMAGETYPE_UBOOT ?= "Image"
33# "zImage" not supported on arm64 and ".gz" images not supported by bootloader yet
34KERNEL_IMAGETYPE_DIRECT ?= "Image"
35KERNEL_BOOTCMD ?= "booti"
36
37ARMSTUB ?= "armstub8.bin"
diff --git a/recipes-kernel/linux/linux-raspberrypi-rt_4.19.bbappend b/recipes-kernel/linux/linux-raspberrypi-rt_4.19.bbappend
new file mode 100644
index 0000000..d4aae42
--- /dev/null
+++ b/recipes-kernel/linux/linux-raspberrypi-rt_4.19.bbappend
@@ -0,0 +1,2 @@
1KBUILD_DEFCONFIG_raspberrypi3-64-rt = "bcmrpi3_defconfig"
2