forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 297b60346df8beafee954a0fd7c2d64f33f3b9bc
kernel/arch/arm/mach-imx/cpu-imx35.c
....@@ -1,14 +1,11 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * MX35 CPU type detection
34 *
45 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
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 as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
106 */
117 #include <linux/module.h>
8
+#include <linux/of_address.h>
129 #include <linux/io.h>
1310
1411 #include "hardware.h"
....@@ -18,9 +15,16 @@
1815
1916 static int mx35_read_cpu_rev(void)
2017 {
18
+ void __iomem *iim_base;
19
+ struct device_node *np;
2120 u32 rev;
2221
23
- rev = imx_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV));
22
+ np = of_find_compatible_node(NULL, NULL, "fsl,imx35-iim");
23
+ iim_base = of_iomap(np, 0);
24
+ of_node_put(np);
25
+ BUG_ON(!iim_base);
26
+
27
+ rev = imx_readl(iim_base + MXC_IIMSREV);
2428 switch (rev) {
2529 case 0x00:
2630 return IMX_CHIP_REVISION_1_0;