forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/arch/arm/mach-exynos/exynos.c
....@@ -1,6 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0
22 //
3
-// SAMSUNG EXYNOS Flattened Device Tree enabled machine
3
+// Samsung Exynos Flattened Device Tree enabled machine
44 //
55 // Copyright (c) 2010-2014 Samsung Electronics Co., Ltd.
66 // http://www.samsung.com
....@@ -19,10 +19,11 @@
1919 #include <asm/mach/arch.h>
2020 #include <asm/mach/map.h>
2121
22
-#include <mach/map.h>
23
-#include <plat/cpu.h>
24
-
2522 #include "common.h"
23
+
24
+#define S3C_ADDR_BASE 0xF6000000
25
+#define S3C_ADDR(x) ((void __iomem __force *)S3C_ADDR_BASE + (x))
26
+#define S5P_VA_CHIPID S3C_ADDR(0x02000000)
2627
2728 static struct platform_device exynos_cpuidle = {
2829 .name = "exynos_cpuidle",
....@@ -33,7 +34,16 @@
3334 };
3435
3536 void __iomem *sysram_base_addr __ro_after_init;
37
+phys_addr_t sysram_base_phys __ro_after_init;
3638 void __iomem *sysram_ns_base_addr __ro_after_init;
39
+
40
+unsigned long exynos_cpu_id;
41
+static unsigned int exynos_cpu_rev;
42
+
43
+unsigned int exynos_rev(void)
44
+{
45
+ return exynos_cpu_rev;
46
+}
3747
3848 void __init exynos_sysram_init(void)
3949 {
....@@ -43,6 +53,9 @@
4353 if (!of_device_is_available(node))
4454 continue;
4555 sysram_base_addr = of_iomap(node, 0);
56
+ sysram_base_phys = of_translate_address(node,
57
+ of_get_address(node, 0, NULL, NULL));
58
+ of_node_put(node);
4659 break;
4760 }
4861
....@@ -50,6 +63,7 @@
5063 if (!of_device_is_available(node))
5164 continue;
5265 sysram_ns_base_addr = of_iomap(node, 0);
66
+ of_node_put(node);
5367 break;
5468 }
5569 }
....@@ -83,7 +97,11 @@
8397 of_scan_flat_dt(exynos_fdt_map_chipid, NULL);
8498
8599 /* detect cpu id and rev. */
86
- s5p_init_cpu(S5P_VA_CHIPID);
100
+ exynos_cpu_id = readl_relaxed(S5P_VA_CHIPID);
101
+ exynos_cpu_rev = exynos_cpu_id & 0xFF;
102
+
103
+ pr_info("Samsung CPU ID: 0x%08lx\n", exynos_cpu_id);
104
+
87105 }
88106
89107 /*
....@@ -131,6 +149,7 @@
131149 np = of_find_matching_node(NULL, exynos_dt_pmu_match);
132150 if (np)
133151 pmu_base_addr = of_iomap(np, 0);
152
+ of_node_put(np);
134153 }
135154
136155 static void __init exynos_init_irq(void)
....@@ -189,9 +208,9 @@
189208 of_fdt_limit_memory(8);
190209 }
191210
192
-DT_MACHINE_START(EXYNOS_DT, "SAMSUNG EXYNOS (Flattened Device Tree)")
193
- .l2c_aux_val = 0x3c400001,
194
- .l2c_aux_mask = 0xc20fffff,
211
+DT_MACHINE_START(EXYNOS_DT, "Samsung Exynos (Flattened Device Tree)")
212
+ .l2c_aux_val = 0x38400000,
213
+ .l2c_aux_mask = 0xc60fffff,
195214 .smp = smp_ops(exynos_smp_ops),
196215 .map_io = exynos_init_io,
197216 .init_early = exynos_firmware_init,