forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 10ebd8556b7990499c896a550e3d416b444211e6
kernel/arch/arm/mach-mmp/common.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/mach-mmp/common.c
34 *
45 * Code common to PXA168 processor lines
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
96 */
107
118 #include <linux/init.h>
....@@ -16,11 +13,11 @@
1613 #include <asm/mach/map.h>
1714 #include <asm/system_misc.h>
1815 #include "addr-map.h"
19
-#include "cputype.h"
16
+#include <linux/soc/mmp/cputype.h>
2017
2118 #include "common.h"
2219
23
-#define MMP_CHIPID (AXI_VIRT_BASE + 0x82c00)
20
+#define MMP_CHIPID CIU_REG(0x00)
2421
2522 unsigned int mmp_chip_id;
2623 EXPORT_SYMBOL(mmp_chip_id);
....@@ -39,6 +36,15 @@
3936 },
4037 };
4138
39
+static struct map_desc mmp2_io_desc[] __initdata = {
40
+ {
41
+ .pfn = __phys_to_pfn(PGU_PHYS_BASE),
42
+ .virtual = (unsigned long)PGU_VIRT_BASE,
43
+ .length = PGU_PHYS_SIZE,
44
+ .type = MT_DEVICE,
45
+ },
46
+};
47
+
4248 void __init mmp_map_io(void)
4349 {
4450 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
....@@ -47,6 +53,12 @@
4753 mmp_chip_id = __raw_readl(MMP_CHIPID);
4854 }
4955
56
+void __init mmp2_map_io(void)
57
+{
58
+ mmp_map_io();
59
+ iotable_init(mmp2_io_desc, ARRAY_SIZE(mmp2_io_desc));
60
+}
61
+
5062 void mmp_restart(enum reboot_mode mode, const char *cmd)
5163 {
5264 soft_restart(0);