meson64: adjust patch to work with 7.0

This commit is contained in:
EvilOlaf 2026-03-01 14:39:37 +00:00 committed by Igor
parent 1c6b281af4
commit 74d0bf7f5d

View File

@ -8,16 +8,17 @@ to header file. Create new structures for store meson64 cpu_id and chip_id.
Signed-off-by: Viacheslav Bocharov <adeep@lexina.in>
---
drivers/soc/amlogic/meson-gx-socinfo-internal.h | 132 ++++++++
drivers/soc/amlogic/meson-gx-socinfo.c | 156 +---------
2 files changed, 147 insertions(+), 141 deletions(-)
drivers/soc/amlogic/meson-gx-socinfo-internal.h | 139 +++++++++++++++++++++
drivers/soc/amlogic/meson-gx-socinfo.c | 163 +--------------------
2 files changed, 142 insertions(+), 160 deletions(-)
create mode 100644 drivers/soc/amlogic/meson-gx-socinfo-internal.h
diff --git a/drivers/soc/amlogic/meson-gx-socinfo-internal.h b/drivers/soc/amlogic/meson-gx-socinfo-internal.h
new file mode 100644
index 000000000000..111111111111
index 000000000000..81d77094dae8
--- /dev/null
+++ b/drivers/soc/amlogic/meson-gx-socinfo-internal.h
@@ -0,0 +1,132 @@
@@ -0,0 +1,139 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2017 BayLibre, SAS
@ -81,6 +82,9 @@ index 000000000000..111111111111
+ { "A5", 0x3c },
+ { "C3", 0x3d },
+ { "A4", 0x40 },
+ { "S7", 0x46 },
+ { "S7D", 0x47 },
+ { "S6", 0x48 },
+};
+
+static const struct meson_gx_package_id {
@ -117,10 +121,14 @@ index 000000000000..111111111111
+ { "S905D3", 0x2b, 0x30, 0x3f },
+ { "A113L", 0x2c, 0x0, 0xf8 },
+ { "S805X2", 0x37, 0x2, 0xf },
+ { "S905Y4", 0x37, 0x3, 0xf },
+ { "C308L", 0x3d, 0x1, 0xf },
+ { "A311D2", 0x36, 0x1, 0xf },
+ { "A113X2", 0x3c, 0x1, 0xf },
+ { "A113L2", 0x40, 0x1, 0xf },
+ { "S805X3", 0x46, 0x3, 0xf },
+ { "S905X5M", 0x47, 0x1, 0xf },
+ { "S905X5", 0x48, 0x1, 0xf },
+};
+
+static inline const char *socinfo_v1_to_package_id(union meson_cpu_id socinfo)
@ -151,7 +159,7 @@ index 000000000000..111111111111
+
+#endif /* _MESON_GX_SOCINFO_INTERNAL_H_ */
diff --git a/drivers/soc/amlogic/meson-gx-socinfo.c b/drivers/soc/amlogic/meson-gx-socinfo.c
index 111111111111..222222222222 100644
index c20f685e56f9..08eceefe03ae 100644
--- a/drivers/soc/amlogic/meson-gx-socinfo.c
+++ b/drivers/soc/amlogic/meson-gx-socinfo.c
@@ -1,8 +1,8 @@
@ -162,13 +170,12 @@ index 111111111111..222222222222 100644
*
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <linux/io.h>
@@ -15,133 +15,7 @@
#include <linux/bitfield.h>
@@ -16,133 +16,7 @@
#include <linux/regmap.h>
#include <linux/mfd/syscon.h>
-
-#define AO_SEC_SD_CFG8 0xe0
-#define AO_SEC_SOCINFO_OFFSET AO_SEC_SD_CFG8
-
@ -238,6 +245,7 @@ index 111111111111..222222222222 100644
- { "S905D3", 0x2b, 0x30, 0x3f },
- { "A113L", 0x2c, 0x0, 0xf8 },
- { "S805X2", 0x37, 0x2, 0xf },
- { "S905Y4", 0x37, 0x3, 0xf },
- { "C308L", 0x3d, 0x1, 0xf },
- { "A311D2", 0x36, 0x1, 0xf },
- { "A113X2", 0x3c, 0x1, 0xf },
@ -296,10 +304,10 @@ index 111111111111..222222222222 100644
- return "Unknown";
-}
+#include "meson-gx-socinfo-internal.h"
static int __init meson_gx_socinfo_init(void)
{
@@ -149,7 +23,7 @@ static int __init meson_gx_socinfo_init(void)
@@ -150,7 +24,7 @@ static int __init meson_gx_socinfo_init(void)
struct soc_device *soc_dev;
struct device_node *np;
struct regmap *regmap;
@ -307,23 +315,23 @@ index 111111111111..222222222222 100644
+ union meson_cpu_id socinfo;
struct device *dev;
int ret;
@@ -178,11 +52,11 @@ static int __init meson_gx_socinfo_init(void)
@@ -179,11 +53,11 @@ static int __init meson_gx_socinfo_init(void)
return -ENODEV;
}
- ret = regmap_read(regmap, AO_SEC_SOCINFO_OFFSET, &socinfo);
+ ret = regmap_read(regmap, AO_SEC_SOCINFO_OFFSET, &socinfo.raw);
if (ret < 0)
return ret;
- if (!socinfo) {
+ if (!socinfo.raw) {
pr_err("%s: invalid chipid value\n", __func__);
return -EINVAL;
}
@@ -193,13 +67,13 @@ static int __init meson_gx_socinfo_init(void)
@@ -194,13 +68,13 @@ static int __init meson_gx_socinfo_init(void)
soc_dev_attr->family = "Amlogic Meson";
soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%x:%x - %x:%x",
- socinfo_to_major(socinfo),
@ -339,11 +347,11 @@ index 111111111111..222222222222 100644
- socinfo_to_package_id(socinfo));
+ socinfo_v1_to_soc_id(socinfo),
+ socinfo_v1_to_package_id(socinfo));
soc_dev = soc_device_register(soc_dev_attr);
if (IS_ERR(soc_dev)) {
@@ -212,10 +86,10 @@ static int __init meson_gx_socinfo_init(void)
@@ -213,10 +87,10 @@ static int __init meson_gx_socinfo_init(void)
dev_info(dev, "Amlogic Meson %s Revision %x:%x (%x:%x) Detected\n",
soc_dev_attr->soc_id,
- socinfo_to_major(socinfo),
@ -354,9 +362,8 @@ index 111111111111..222222222222 100644
+ socinfo.v1.chip_rev,
+ socinfo.v1.pack_id,
+ (socinfo.v1.reserved<<4) + socinfo.v1.layout_ver);
return 0;
}
--
--
Armbian