From 57d03cac4b31b7c589cb7e6748d2e70b029626fb 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 (cherry picked from commit af4c57cd9528539f6a355eab6d311b9af7c05c72) Reviewed-on: https://git-master.nvidia.com/r/c/device/hardware/nvidia/t23x-public-dts/+/3001549 GVS: Gerrit_Virtual_Submit Reviewed-by: Gautham Srinivasan Reviewed-by: Laxman Dewangan --- 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 e69e62f..ba78a77 100644 --- a/overlay/Makefile +++ b/overlay/Makefile @@ -16,9 +16,11 @@ 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-pcie-no-tra.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 33cdb60..42db9a5 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 2d2b1f4..51442dc 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 c01dcff..c7c77a0 100644 --- a/overlay/tegra234-p3768-0000+p3767-0000.dts +++ b/overlay/tegra234-p3768-0000+p3767-0000.dts @@ -458,11 +458,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"