Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for linux-yocto as kernel provider #1680

Merged
merged 8 commits into from
Oct 29, 2024
4 changes: 3 additions & 1 deletion conf/machine/include/devkit-wifi.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
MACHINE_FEATURES += "wifi bluetooth"
MACHINE_EXTRA_RRECOMMENDS += "kernel-module-rtk-btusb kernel-module-rtl8822ce tegra-firmware-rtl8822"
LINUX_WIFI ?= "kernel-module-rtk-btusb kernel-module-rtw88-8822ce linux-firmware-rtl8822"
NVIDIA_WIFI ?= "kernel-module-rtk-btusb kernel-module-rtl8822ce tegra-firmware-rtl8822"
MACHINE_EXTRA_RRECOMMENDS += "${@'${NVIDIA_WIFI}' if d.getVar('PREFERRED_PROVIDER_virtual/kernel') == 'linux-jammy-nvidia-tegra' else '${LINUX_WIFI}'}"
TEGRA_BT_SUPPORT_PACKAGE ?= ""
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh
modprobe libcomposite bridge
[ -d /sys/module/libcomposite ] || modprobe libcomposite
[ -d /sys/module/bridge ] || modprobe bridge
[ -d /run/usbgx ] || mkdir /run/usbgx
[ ! -e /run/usbgx/l4t.schema ] || exit 0
if [ ! -e /usr/share/usbgx/l4t.schema.in ]; then
Expand Down
2 changes: 1 addition & 1 deletion recipes-bsp/tegra-wifi/tegra-wifi_1.0.bb
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ do_install() {

ALLOW_EMPTY:${PN} = "1"
FILES:${PN} += "${nonarch_base_libdir}/udev/rules.d"
RDEPENDS:${PN} += "nvidia-kernel-oot-wifi"
RRECOMMENDS:${PN} += "nvidia-kernel-oot-wifi"
PACKAGE_ARCH = "${MACHINE_ARCH}"
96 changes: 2 additions & 94 deletions recipes-kernel/linux/linux-jammy-nvidia-tegra_5.15.bb
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ DESCRIPTION = "Linux kernel from sources provided by Nvidia for Tegra processors
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"

TEGRA_UEFI_SIGNING_CLASS ??= "tegra-uefi-signing"

inherit l4t_bsp python3native ${TEGRA_UEFI_SIGNING_CLASS}
inherit l4t_bsp python3native
require recipes-kernel/linux/linux-yocto.inc
require tegra-kernel.inc

KERNEL_DISABLE_FW_USER_HELPER ?= "y"

# All of our device trees are out-of-tree
KERNEL_DEVICETREE:forcevariable = ""

LINUX_VERSION ?= "5.15.148"
PV = "${LINUX_VERSION}+git${SRCPV}"
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}-${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1]}:"
Expand Down Expand Up @@ -43,91 +39,3 @@ set_scmversion() {
fi
}
do_kernel_checkout[postfuncs] += "set_scmversion"

sign_kernel_image() {
tegra_uefi_sbsign "$1"
shift
while [ $# -gt 0 ]; do
tegra_uefi_attach_sign "$1"
shift
done
}

do_sign_kernel() {
sign_kernel_image ${KERNEL_OUTPUT_DIR}/${KERNEL_IMAGETYPE}
}
do_sign_kernel[dirs] = "${B}"
do_sign_kernel[depends] += "${TEGRA_UEFI_SIGNING_TASKDEPS}"

addtask sign_kernel after do_compile before do_install

sign_bootimg() {
tegra_uefi_attach_sign "$1"
}

bootimg_from_bundled_initramfs() {
if [ ! -z "${INITRAMFS_IMAGE}" -a "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
rm -f ${WORKDIR}/initrd
touch ${WORKDIR}/initrd
for imageType in ${KERNEL_IMAGETYPES} ; do
if [ "$imageType" = "fitImage" ] ; then
continue
fi
initramfs_base_name=${imageType}-${INITRAMFS_NAME}
initramfs_symlink_name=${imageType}-${INITRAMFS_LINK_NAME}
${STAGING_BINDIR_NATIVE}/tegra-flash/mkbootimg \
--kernel $deployDir/${initramfs_base_name}.bin \
--ramdisk ${WORKDIR}/initrd \
--cmdline '${KERNEL_ARGS}' \
--output $deployDir/${initramfs_base_name}.cboot
sign_bootimg $deployDir/${initramfs_base_name}.cboot
chmod 0644 $deployDir/${initramfs_base_name}.cboot
ln -sf ${initramfs_base_name}.cboot $deployDir/${initramfs_symlink_name}.cboot
done
elif [ -z "${INITRAMFS_IMAGE}" ]; then
rm -f ${WORKDIR}/initrd
touch ${WORKDIR}/initrd
for imageType in ${KERNEL_IMAGETYPES} ; do
if [ "$imageType" = "fitImage" ] ; then
continue
fi
baseName=$imageType-${KERNEL_IMAGE_NAME}
${STAGING_BINDIR_NATIVE}/tegra-flash/mkbootimg \
--kernel $deployDir/${baseName}.bin \
--ramdisk ${WORKDIR}/initrd \
--cmdline '${KERNEL_ARGS}' \
--output $deployDir/${baseName}.cboot
sign_bootimg $deployDir/${baseName}.cboot
chmod 0644 $deployDir/${baseName}.cboot
ln -sf ${baseName}.cboot $deployDir/$imageType-${KERNEL_IMAGE_LINK_NAME}.cboot
ln -sf ${baseName}.cboot $deployDir/$imageType.cboot
done
fi
}
do_deploy:append() {
bootimg_from_bundled_initramfs
}

do_deploy[depends] += "tegra-flashtools-native:do_populate_sysroot ${TEGRA_UEFI_SIGNING_TASKDEPS}"

COMPATIBLE_MACHINE = "(tegra)"

RRECOMMENDS:${KERNEL_PACKAGE_NAME}-base = ""

# kernel.bbclass automatically adds a dependency on the intramfs image
# even if INITRAMFS_IMAGE_BUNDLE is disabled. This creates a circular
# dependency for tegra builds, where we need to combine initramfs (as an
# initrd) and kernel artifacts into a bootable image, so break that
# dependency here.
python () {
image = d.getVar('INITRAMFS_IMAGE')
if image and not bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')):
flags = d.getVarFlag('do_bundle_initramfs', 'depends', False).split()
try:
i = flags.index('${INITRAMFS_IMAGE}:do_image_complete')
del flags[i]
d.setVarFlag('do_bundle_initramfs', 'depends', ' '.join(flags))
except ValueError:
bb.warn('did not find it in %s' % ','.join(flags))
pass
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
From 26ffd973703ca765fce04d644a78de8e0b180725 Mon Sep 17 00:00:00 2001
From: Jon Hunter <[email protected]>
Date: Thu, 12 Oct 2023 11:49:09 +0100
Subject: [PATCH 1/9] memory: tegra: Add Tegra234 clients for RCE and VI

Add the Tegra234 memory client entries for the Real-time Camera Engine
(RCE) and Video Input (VI) devices.

Upstream-Status: Pending
Signed-off-by: Jon Hunter <[email protected]>
Acked-by: Thierry Reding <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/memory/tegra/tegra234.c | 60 +++++++++++++++++++++++++++++++++
1 file changed, 60 insertions(+)

diff --git a/drivers/memory/tegra/tegra234.c b/drivers/memory/tegra/tegra234.c
index fa40c49b070d..b8a7af2d36c1 100644
--- a/drivers/memory/tegra/tegra234.c
+++ b/drivers/memory/tegra/tegra234.c
@@ -449,6 +449,18 @@ static const struct tegra_mc_client tegra234_mc_clients[] = {
.security = 0x38c,
},
},
+ }, {
+ .id = TEGRA234_MEMORY_CLIENT_VIW,
+ .name = "viw",
+ .bpmp_id = TEGRA_ICC_BPMP_VI,
+ .type = TEGRA_ICC_ISO_VI,
+ .sid = TEGRA234_SID_ISO_VI,
+ .regs = {
+ .sid = {
+ .override = 0x390,
+ .security = 0x394,
+ },
+ },
}, {
.id = TEGRA234_MEMORY_CLIENT_NVDECSRD,
.name = "nvdecsrd",
@@ -621,6 +633,30 @@ static const struct tegra_mc_client tegra234_mc_clients[] = {
.security = 0x50c,
},
},
+ }, {
+ .id = TEGRA234_MEMORY_CLIENT_VIFALR,
+ .name = "vifalr",
+ .bpmp_id = TEGRA_ICC_BPMP_VIFAL,
+ .type = TEGRA_ICC_ISO_VIFAL,
+ .sid = TEGRA234_SID_ISO_VIFALC,
+ .regs = {
+ .sid = {
+ .override = 0x5e0,
+ .security = 0x5e4,
+ },
+ },
+ }, {
+ .id = TEGRA234_MEMORY_CLIENT_VIFALW,
+ .name = "vifalw",
+ .bpmp_id = TEGRA_ICC_BPMP_VIFAL,
+ .type = TEGRA_ICC_ISO_VIFAL,
+ .sid = TEGRA234_SID_ISO_VIFALC,
+ .regs = {
+ .sid = {
+ .override = 0x5e8,
+ .security = 0x5ec,
+ },
+ },
}, {
.id = TEGRA234_MEMORY_CLIENT_DLA0RDA,
.name = "dla0rda",
@@ -701,6 +737,30 @@ static const struct tegra_mc_client tegra234_mc_clients[] = {
.security = 0x62c,
},
},
+ }, {
+ .id = TEGRA234_MEMORY_CLIENT_RCER,
+ .name = "rcer",
+ .bpmp_id = TEGRA_ICC_BPMP_RCE,
+ .type = TEGRA_ICC_NISO,
+ .sid = TEGRA234_SID_RCE,
+ .regs = {
+ .sid = {
+ .override = 0x690,
+ .security = 0x694,
+ },
+ },
+ }, {
+ .id = TEGRA234_MEMORY_CLIENT_RCEW,
+ .name = "rcew",
+ .bpmp_id = TEGRA_ICC_BPMP_RCE,
+ .type = TEGRA_ICC_NISO,
+ .sid = TEGRA234_SID_RCE,
+ .regs = {
+ .sid = {
+ .override = 0x698,
+ .security = 0x69c,
+ },
+ },
}, {
.id = TEGRA234_MEMORY_CLIENT_PCIE0R,
.name = "pcie0r",
--
2.25.1

Loading