forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/arch/arm/mach-tegra/tegra.c
....@@ -1,19 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * NVIDIA Tegra SoC device tree board support
34 *
45 * Copyright (C) 2011, 2013, NVIDIA Corporation
56 * Copyright (C) 2010 Secret Lab Technologies, Ltd.
67 * Copyright (C) 2010 Google, Inc.
7
- *
8
- * This software is licensed under the terms of the GNU General Public
9
- * License version 2, as published by the Free Software Foundation, and
10
- * may be copied, distributed, and modified under those terms.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
178 */
189
1910 #include <linux/clk.h>
....@@ -35,21 +26,22 @@
3526 #include <linux/sys_soc.h>
3627 #include <linux/usb/tegra_usb_phy.h>
3728
29
+#include <linux/firmware/trusted_foundations.h>
30
+
3831 #include <soc/tegra/fuse.h>
3932 #include <soc/tegra/pmc.h>
4033
34
+#include <asm/firmware.h>
4135 #include <asm/hardware/cache-l2x0.h>
4236 #include <asm/mach/arch.h>
4337 #include <asm/mach/time.h>
4438 #include <asm/mach-types.h>
39
+#include <asm/psci.h>
4540 #include <asm/setup.h>
46
-#include <asm/trusted_foundations.h>
4741
4842 #include "board.h"
4943 #include "common.h"
50
-#include "cpuidle.h"
5144 #include "iomap.h"
52
-#include "irq.h"
5345 #include "pm.h"
5446 #include "reset.h"
5547 #include "sleep.h"
....@@ -74,6 +66,7 @@
7466 {
7567 of_register_trusted_foundations();
7668 tegra_cpu_reset_handler_init();
69
+ call_firmware_op(l2x0_init);
7770 }
7871
7972 static void __init tegra_dt_init_irq(void)
....@@ -92,7 +85,6 @@
9285 static void __init tegra_dt_init_late(void)
9386 {
9487 tegra_init_suspend();
95
- tegra_cpuidle_init();
9688
9789 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) &&
9890 of_machine_is_compatible("compal,paz00"))
....@@ -101,6 +93,13 @@
10193 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) &&
10294 of_machine_is_compatible("nvidia,tegra20"))
10395 platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0);
96
+
97
+ if (IS_ENABLED(CONFIG_ARM_TEGRA_CPUIDLE) && !psci_smp_available())
98
+ platform_device_register_simple("tegra-cpuidle", -1, NULL, 0);
99
+
100
+ if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) &&
101
+ of_machine_is_compatible("nvidia,tegra30"))
102
+ platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0);
104103 }
105104
106105 static const char * const tegra_dt_board_compat[] = {