From 00d53f39f956fd74c3c3b1f2b798cb85aca71e85 Mon Sep 17 00:00:00 2001 From: Bhavik Joshi Date: Wed, 5 Jun 2024 17:59:25 +0000 Subject: [PATCH] t23x: nv-public: Build android kdump DTBOs Create dts files for enabling kdump Separate android bootargs into header file Bug 4652476 Change-Id: I357c6579da819316800c7fd33034788bcb77c3d2 Signed-off-by: Bhavik Joshi Reviewed-on: https://git-master.nvidia.com/r/c/device/hardware/nvidia/t23x-public-dts/+/3164575 Reviewed-by: svcacv GVS: buildbot_gerritrpt Reviewed-by: Laxman Dewangan --- .../dt-bindings/tegra234-android-bootargs.h | 22 +++++++++++ overlay/Makefile | 5 +++ overlay/tegra234-android-crash-kernel.dts | 38 +++++++++++++++++++ overlay/tegra234-android-kdump.dts | 20 ++++++++++ overlay/tegra234-android.dts | 6 ++- 5 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 include/platforms/dt-bindings/tegra234-android-bootargs.h create mode 100644 overlay/tegra234-android-crash-kernel.dts create mode 100644 overlay/tegra234-android-kdump.dts diff --git a/include/platforms/dt-bindings/tegra234-android-bootargs.h b/include/platforms/dt-bindings/tegra234-android-bootargs.h new file mode 100644 index 0000000..fb7a68c --- /dev/null +++ b/include/platforms/dt-bindings/tegra234-android-bootargs.h @@ -0,0 +1,22 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. + * SPDX-License-Identifier: LicenseRef-NvidiaProprietary + * + * NVIDIA Corporation and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA Corporation is strictly prohibited. + */ + +// Definitions for tegra234 android bootargs + +// Make sure ANDROID_BOOTARGS and ANDROID_KDUMP_BOOTARGS are consistent except the later has "crashkernel=512M enforcing=0 androidboot.selinux=permissive" appended +#define ANDROID_BOOTARGS "androidboot.boot_devices=bus@0/3460000.mmc console=ttyTCU0,115200 rootfstype=ext4 mminit_loglevel=4 androidboot.slot_suffix=_a androidboot.hypervisor=disabled androidboot.verifiedbootstate=orange androidboot.xudc=3550000.usb androidboot.hardware=t234ref loop.max_part=7 firmware_class.path=/vendor/firmware" + +#define ANDROID_KDUMP_BOOTARGS "androidboot.boot_devices=bus@0/3460000.mmc console=ttyTCU0,115200 rootfstype=ext4 mminit_loglevel=4 androidboot.slot_suffix=_a androidboot.hypervisor=disabled androidboot.verifiedbootstate=orange androidboot.xudc=3550000.usb androidboot.hardware=t234ref loop.max_part=7 firmware_class.path=/vendor/firmware crashkernel=512M enforcing=0 androidboot.selinux=permissive" + +// Make sure ANDROID_FIRESPRAY_BOOTARGS and ANDROID_FIRESPRAY_KDUMP_BOOTARGS are consistent except the later has "crashkernel=512M" appended +#define ANDROID_FIRESPRAY_BOOTARGS "androidboot.boot_devices=bus@0/3460000.mmc console=ttyTCU0,115200 rootfstype=ext4 mminit_loglevel=4 enforcing=0 androidboot.selinux=permissive androidboot.slot_suffix=_a androidboot.hypervisor=disabled androidboot.verifiedbootstate=orange androidboot.xudc=3550000.usb androidboot.hardware=t234ref loop.max_part=7 firmware_class.path=/vendor/firmware androidboot.serialno=1423522020643" + +#define ANDROID_FIRESPRAY_KDUMP_BOOTARGS "androidboot.boot_devices=bus@0/3460000.mmc console=ttyTCU0,115200 rootfstype=ext4 mminit_loglevel=4 enforcing=0 androidboot.selinux=permissive androidboot.slot_suffix=_a androidboot.hypervisor=disabled androidboot.verifiedbootstate=orange androidboot.xudc=3550000.usb androidboot.hardware=t234ref loop.max_part=7 firmware_class.path=/vendor/firmware androidboot.serialno=1423522020643 crashkernel=512M" \ No newline at end of file diff --git a/overlay/Makefile b/overlay/Makefile index 07965d2..fc4d077 100644 --- a/overlay/Makefile +++ b/overlay/Makefile @@ -11,6 +11,11 @@ makefile-path := t23x/nv-public/overlay dtbo-y += tegra-optee.dtbo dtbo-y += tegra234-android.dtbo +# Build Kdump DTBOs for Android +ifeq ($(CONFIG_TEGRA_SYSTEM_TYPE_ACK),y) +dtbo-y += tegra234-android-kdump.dtbo +dtbo-y += tegra234-android-crash-kernel.dtbo +endif dtbo-y += tegra234-audio-overlay.dtbo dtbo-y += tegra234-carveouts.dtbo dtbo-y += tegra234-dcb-p3767-0000-hdmi.dtbo diff --git a/overlay/tegra234-android-crash-kernel.dts b/overlay/tegra234-android-crash-kernel.dts new file mode 100644 index 0000000..a1f1a21 --- /dev/null +++ b/overlay/tegra234-android-crash-kernel.dts @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// +// This file contains the DT reserved-memory disable nodes of the kdump crash kernel + +/dts-v1/; +/plugin/; + +/ { + fragment-t234-android@0 { + target-path = "/"; + __overlay__ { + reserved-memory { + linux,cma { + status = "disabled"; + }; + fsi-carveout { + status = "disabled"; + }; + pva-carveout { + status = "disabled"; + }; + rce-reservation { + status = "disabled"; + }; + ramoops_carveout { + status = "disabled"; + }; + vpr-carveout { + status = "disabled"; + }; + camdbg_carveout { + status = "disabled"; + }; + }; + }; + }; +}; \ No newline at end of file diff --git a/overlay/tegra234-android-kdump.dts b/overlay/tegra234-android-kdump.dts new file mode 100644 index 0000000..73f2e0a --- /dev/null +++ b/overlay/tegra234-android-kdump.dts @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// +// This file contains the Android bootargs for the kdump enabled kernel + +/dts-v1/; +/plugin/; + +#include + +/ { + fragment-t234-android@0 { + target-path = "/"; + __overlay__ { + chosen { + bootargs=ANDROID_KDUMP_BOOTARGS; + }; + }; + }; +}; diff --git a/overlay/tegra234-android.dts b/overlay/tegra234-android.dts index 28fce66..d8fea3f 100644 --- a/overlay/tegra234-android.dts +++ b/overlay/tegra234-android.dts @@ -1,11 +1,13 @@ // SPDX-License-Identifier: GPL-2.0-only -// SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. // // This file contains the DT nodes of T234 which are not in base/tegra234.dtsi /dts-v1/; /plugin/; +#include + / { fragment-t234-android@0 { target-path = "/"; @@ -24,7 +26,7 @@ chosen { use_dts_cmdline; - bootargs ="androidboot.boot_devices=bus@0/3460000.mmc console=ttyTCU0,115200 rootfstype=ext4 mminit_loglevel=4 androidboot.slot_suffix=_a androidboot.hypervisor=disabled androidboot.verifiedbootstate=orange androidboot.xudc=3550000.usb androidboot.hardware=t234ref loop.max_part=7 firmware_class.path=/vendor/firmware"; + bootargs=ANDROID_BOOTARGS; }; bus@0 {