From af4c57cd9528539f6a355eab6d311b9af7c05c72 Mon Sep 17 00:00:00 2001 From: Brad Griffis Date: Thu, 5 Oct 2023 01:15:16 +0000 Subject: [PATCH] overlay: put runtime fragments in separate overlay This is an incremental step toward having a "with-oot" base dtb that contains both the upstream dtb as well as the nvidia-oot data in a single statically built dtb. Note that currently the base dtb is stored and managed in the rootfs via extlinux.conf file. The overlays however live inside the UEFI partition. The ultimate goal is to have consistency in how the dtb files are managed. After we combine the data from nvidia-oot overlay dtb into the future "with-oot" base dtb then we can move the remaining overlays to the rootfs and manage all dtbs/overlays there. This patch takes the first critical step toward this goal by separating the static overlay data from the dynamic overlay data that gets applied conditionally at run-time. Bug 4290389 Change-Id: I403ac84b0737368b8bc96952552729ab7e46802b Signed-off-by: Brad Griffis Reviewed-on: https://git-master.nvidia.com/r/c/device/hardware/nvidia/t23x-public-dts/+/2991524 Tested-by: mobile promotions Reviewed-by: mobile promotions --- overlay/Makefile | 2 + overlay/tegra234-p3701-0000.dtsi | 14 ---- ...tegra234-p3737-0000+p3701-0000-dynamic.dts | 84 +++++++++++++++++++ overlay/tegra234-p3737-0000.dtsi | 60 ------------- ...tegra234-p3768-0000+p3767-0000-dynamic.dts | 13 +++ overlay/tegra234-p3768-0000+p3767-0000.dts | 8 -- 6 files changed, 99 insertions(+), 82 deletions(-) create mode 100644 overlay/tegra234-p3737-0000+p3701-0000-dynamic.dts create mode 100644 overlay/tegra234-p3768-0000+p3767-0000-dynamic.dts diff --git a/overlay/Makefile b/overlay/Makefile index a08e3f4..335a42b 100644 --- a/overlay/Makefile +++ b/overlay/Makefile @@ -14,9 +14,11 @@ dtbo-y += tegra234-audio-overlay.dtbo dtbo-y += tegra234-carveouts.dtbo dtbo-y += tegra234-jetson.dtbo dtbo-y += tegra234-p3737-0000+p3701-0000.dtbo +dtbo-y += tegra234-p3737-0000+p3701-0000-dynamic.dtbo dtbo-y += tegra234-p3740-0002+p3701-0008.dtbo dtbo-y += tegra234-p3740-0002+p3701-0008-safety.dtbo dtbo-y += tegra234-p3768-0000+p3767-0000.dtbo +dtbo-y += tegra234-p3768-0000+p3767-0000-dynamic.dtbo dtbo-y += tegra234-p3737-0000+p3701-0000-audio-adafruit-uda1334a.dtbo dtbo-y += tegra234-p3737-0000+p3701-0000-audio-adafruit-sph0645lm4h.dtbo dtbo-y += tegra234-p3737-0000+p3701-0000-audio-fe-pi.dtbo diff --git a/overlay/tegra234-p3701-0000.dtsi b/overlay/tegra234-p3701-0000.dtsi index a27cbb6..244d6f1 100644 --- a/overlay/tegra234-p3701-0000.dtsi +++ b/overlay/tegra234-p3701-0000.dtsi @@ -151,18 +151,4 @@ }; }; }; - - fragment-t234-p3701-0000@1 { - target-path = "/"; - board_config { - ids = "3701-0005-*","3701-0008-*"; - }; - __overlay__ { - reserved-memory { - linux,cma { /* Needed for nvgpu comptags */ - size = <0x0 0x20000000>; /* 512MB */ - }; - }; - }; - }; }; diff --git a/overlay/tegra234-p3737-0000+p3701-0000-dynamic.dts b/overlay/tegra234-p3737-0000+p3701-0000-dynamic.dts new file mode 100644 index 0000000..fddbac3 --- /dev/null +++ b/overlay/tegra234-p3737-0000+p3701-0000-dynamic.dts @@ -0,0 +1,84 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +/dts-v1/; +/plugin/; + +#include +#include + +/ { + fragment-t234-p3737-0000-p3701-0000@0 { + target-path = "/"; + board_config { + ids = "3701-0005-*","3701-0008-*"; + }; + __overlay__ { + reserved-memory { + linux,cma { /* Needed for nvgpu comptags */ + size = <0x0 0x20000000>; /* 512MB */ + }; + }; + }; + }; + + fragment-t234-p3737-0000-p3701-0000@1 { + target-path = "/"; + board_config { + ids = ">=3737-0000-TS4", ">=3737-0000-RC1", ">=3737-0000-300"; + }; + __overlay__ { + bus@0 { + i2c@31e0000 { + rt5640: audio-codec@1c { + #sound-dai-cells = <1>; + status = "okay"; + }; + }; + }; + + sound { + nvidia-audio-card,widgets = + "Headphone", "CVB-RT Headphone Jack", + "Microphone", "CVB-RT Mic Jack", + "Speaker", "CVB-RT Int Spk", + "Microphone", "CVB-RT Int Mic"; + + nvidia-audio-card,routing = + "CVB-RT Headphone Jack", "CVB-RT HPOL", + "CVB-RT Headphone Jack", "CVB-RT HPOR", + "CVB-RT IN1P", "CVB-RT Mic Jack", + "CVB-RT IN2P", "CVB-RT Mic Jack", + "CVB-RT Int Spk", "CVB-RT SPOLP", + "CVB-RT Int Spk", "CVB-RT SPORP", + "CVB-RT DMIC1", "CVB-RT Int Mic", + "CVB-RT DMIC2", "CVB-RT Int Mic"; + + nvidia-audio-card,dai-link@76 { + link-name = "rt5640-playback"; + codec { + sound-dai = <&rt5640 0>; + prefix = "CVB-RT"; + }; + }; + }; + }; + }; + + fragment-t234-p3737-0000-p3701-0000@2 { + target-path = "/"; + board_config { + ids = "3737-0000-TS1","3737-0000-TS2","3737-0000-TS3","3737-0000-EB1","3737-0000-EB2","3737-0000-EB3","3737-0000-000","3737-0000-100","3737-0000-200"; + }; + __overlay__ { + bus@0{ + i2c@c240000 { + typec@8 { + interrupt-parent = <&gpio_aon>; + interrupts = ; + }; + }; + }; + }; + }; +}; diff --git a/overlay/tegra234-p3737-0000.dtsi b/overlay/tegra234-p3737-0000.dtsi index 852194d..201e710 100644 --- a/overlay/tegra234-p3737-0000.dtsi +++ b/overlay/tegra234-p3737-0000.dtsi @@ -127,64 +127,4 @@ }; }; }; - - fragment-t234-p3737-0000@1 { - target-path = "/"; - board_config { - ids = ">=3737-0000-TS4", ">=3737-0000-RC1", ">=3737-0000-300"; - }; - __overlay__ { - bus@0 { - i2c@31e0000 { - rt5640: audio-codec@1c { - #sound-dai-cells = <1>; - status = "okay"; - }; - }; - }; - - sound { - nvidia-audio-card,widgets = - "Headphone", "CVB-RT Headphone Jack", - "Microphone", "CVB-RT Mic Jack", - "Speaker", "CVB-RT Int Spk", - "Microphone", "CVB-RT Int Mic"; - - nvidia-audio-card,routing = - "CVB-RT Headphone Jack", "CVB-RT HPOL", - "CVB-RT Headphone Jack", "CVB-RT HPOR", - "CVB-RT IN1P", "CVB-RT Mic Jack", - "CVB-RT IN2P", "CVB-RT Mic Jack", - "CVB-RT Int Spk", "CVB-RT SPOLP", - "CVB-RT Int Spk", "CVB-RT SPORP", - "CVB-RT DMIC1", "CVB-RT Int Mic", - "CVB-RT DMIC2", "CVB-RT Int Mic"; - - nvidia-audio-card,dai-link@76 { - link-name = "rt5640-playback"; - codec { - sound-dai = <&rt5640 0>; - prefix = "CVB-RT"; - }; - }; - }; - }; - }; - - fragment-t234-p3737-0000@3 { - target-path = "/"; - board_config { - ids = "3737-0000-TS1","3737-0000-TS2","3737-0000-TS3","3737-0000-EB1","3737-0000-EB2","3737-0000-EB3","3737-0000-000","3737-0000-100","3737-0000-200"; - }; - __overlay__ { - bus@0{ - i2c@c240000 { - typec@8 { - interrupt-parent = <&gpio_aon>; - interrupts = ; - }; - }; - }; - }; - }; }; diff --git a/overlay/tegra234-p3768-0000+p3767-0000-dynamic.dts b/overlay/tegra234-p3768-0000+p3767-0000-dynamic.dts new file mode 100644 index 0000000..a29c06c --- /dev/null +++ b/overlay/tegra234-p3768-0000+p3767-0000-dynamic.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +/dts-v1/; +/plugin/; + +/* + * Include this file last in the device tree. It manages run-time + * pruning of peripherals that are not available across the various + * SKUs of p3767. For example PVA can be enabled in the device tree + * and it will automatically be disabled for SKUs without PVA support. + */ +#include "tegra234-p3767-sku-handling.dtsi" diff --git a/overlay/tegra234-p3768-0000+p3767-0000.dts b/overlay/tegra234-p3768-0000+p3767-0000.dts index dd59d28..0cb411b 100644 --- a/overlay/tegra234-p3768-0000+p3767-0000.dts +++ b/overlay/tegra234-p3768-0000+p3767-0000.dts @@ -393,11 +393,3 @@ }; }; }; - -/* - * Include this file last in the device tree. It manages run-time - * pruning of peripherals that are not available across the various - * SKUs of p3767. For example PVA can be enabled in the device tree - * and it will automatically be disabled for SKUs without PVA support. - */ -#include "tegra234-p3767-sku-handling.dtsi"