From d76427e85c3dd3770cffaa2a8c6de9d7adb366ad Mon Sep 17 00:00:00 2001 From: Viacheslav Bocharov Date: Mon, 18 Nov 2024 15:43:48 +0300 Subject: [PATCH] meson64-6.12: Update meson-gx-socinfo patchset for 6.12 Signed-off-by: Viacheslav Bocharov --- ...-gx-socinfo-move-common-code-to-hea.patch} | 40 ++++++++++++++----- ...-gx-socinfo-sm-Add-Amlogic-secure-m.patch} | 10 ++--- ...mlogic-amlogic-meson-gx-ao-secure-a.patch} | 2 +- ...dd-dts-links-to-secure-monitor-for-.patch} | 0 4 files changed, 35 insertions(+), 17 deletions(-) rename patch/kernel/archive/meson64-6.12/{general-socinfo-sm-3-soc-amlogic-meson-gx-socinfo-move-common-code-to-hea.patch => general-soc-0001-soc-amlogic-meson-gx-socinfo-move-common-code-to-hea.patch} (89%) rename patch/kernel/archive/meson64-6.12/{general-socinfo-sm-4-soc-amlogic-meson-gx-socinfo-sm-Add-Amlogic-secure-m.patch => general-soc-0002-soc-amlogic-meson-gx-socinfo-sm-Add-Amlogic-secure-m.patch} (96%) rename patch/kernel/archive/meson64-6.12/{general-socinfo-sm-6-dt-bindings-arm-amlogic-amlogic-meson-gx-ao-secure-a.patch => general-soc-0003-dt-bindings-arm-amlogic-amlogic-meson-gx-ao-secure-a.patch} (97%) rename patch/kernel/archive/meson64-6.12/{general-socinfo-sm-5-arm64-dts-meson-add-dts-links-to-secure-monitor-for-.patch => general-soc-0004-arm64-dts-meson-add-dts-links-to-secure-monitor-for-.patch} (100%) diff --git a/patch/kernel/archive/meson64-6.12/general-socinfo-sm-3-soc-amlogic-meson-gx-socinfo-move-common-code-to-hea.patch b/patch/kernel/archive/meson64-6.12/general-soc-0001-soc-amlogic-meson-gx-socinfo-move-common-code-to-hea.patch similarity index 89% rename from patch/kernel/archive/meson64-6.12/general-socinfo-sm-3-soc-amlogic-meson-gx-socinfo-move-common-code-to-hea.patch rename to patch/kernel/archive/meson64-6.12/general-soc-0001-soc-amlogic-meson-gx-socinfo-move-common-code-to-hea.patch index 25b9ece37c..676805b8c1 100644 --- a/patch/kernel/archive/meson64-6.12/general-socinfo-sm-3-soc-amlogic-meson-gx-socinfo-move-common-code-to-hea.patch +++ b/patch/kernel/archive/meson64-6.12/general-soc-0001-soc-amlogic-meson-gx-socinfo-move-common-code-to-hea.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Viacheslav Bocharov -Date: Tue, 4 Jun 2024 17:18:08 +0300 +Date: Mon, 18 Nov 2024 15:36:06 +0300 Subject: soc: amlogic: meson-gx-socinfo: move common code to header file Move common constants and inline functions from meson-gx-socinfo driver @@ -8,16 +8,16 @@ to header file. Create new structures for store meson64 cpu_id and chip_id. Signed-off-by: Viacheslav Bocharov --- - drivers/soc/amlogic/meson-gx-socinfo-internal.h | 122 ++++++++ - drivers/soc/amlogic/meson-gx-socinfo.c | 140 +--------- - 2 files changed, 137 insertions(+), 125 deletions(-) + drivers/soc/amlogic/meson-gx-socinfo-internal.h | 132 ++++++++ + drivers/soc/amlogic/meson-gx-socinfo.c | 150 +--------- + 2 files changed, 147 insertions(+), 135 deletions(-) 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 --- /dev/null +++ b/drivers/soc/amlogic/meson-gx-socinfo-internal.h -@@ -0,0 +1,122 @@ +@@ -0,0 +1,132 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2017 BayLibre, SAS @@ -76,6 +76,11 @@ index 000000000000..111111111111 + { "G12B", 0x29 }, + { "SM1", 0x2b }, + { "A1", 0x2c }, ++ { "T7", 0x36 }, ++ { "S4", 0x37 }, ++ { "A5", 0x3c }, ++ { "C3", 0x3d }, ++ { "A4", 0x40 }, +}; + +static const struct meson_gx_package_id { @@ -111,6 +116,11 @@ index 000000000000..111111111111 + { "S905X3", 0x2b, 0x10, 0x3f }, + { "S905D3", 0x2b, 0x30, 0x3f }, + { "A113L", 0x2c, 0x0, 0xf8 }, ++ { "S805X2", 0x37, 0x2, 0xf }, ++ { "C308L", 0x3d, 0x1, 0xf }, ++ { "A311D2", 0x36, 0x1, 0xf }, ++ { "A113X2", 0x3c, 0x1, 0xf }, ++ { "A113L2", 0x40, 0x1, 0xf }, +}; + +static inline const char *socinfo_v1_to_package_id(union meson_cpu_id socinfo) @@ -154,7 +164,7 @@ index 111111111111..222222222222 100644 */ #include -@@ -12,120 +12,10 @@ +@@ -12,130 +12,10 @@ #include #include #include @@ -187,6 +197,11 @@ index 111111111111..222222222222 100644 - { "G12B", 0x29 }, - { "SM1", 0x2b }, - { "A1", 0x2c }, +- { "T7", 0x36 }, +- { "S4", 0x37 }, +- { "A5", 0x3c }, +- { "C3", 0x3d }, +- { "A4", 0x40 }, -}; - -static const struct meson_gx_package_id { @@ -222,6 +237,11 @@ index 111111111111..222222222222 100644 - { "S905X3", 0x2b, 0x10, 0x3f }, - { "S905D3", 0x2b, 0x30, 0x3f }, - { "A113L", 0x2c, 0x0, 0xf8 }, +- { "S805X2", 0x37, 0x2, 0xf }, +- { "C308L", 0x3d, 0x1, 0xf }, +- { "A311D2", 0x36, 0x1, 0xf }, +- { "A113X2", 0x3c, 0x1, 0xf }, +- { "A113L2", 0x40, 0x1, 0xf }, -}; - -static inline unsigned int socinfo_to_major(u32 socinfo) @@ -276,7 +296,7 @@ index 111111111111..222222222222 100644 static int __init meson_gx_socinfo_init(void) { -@@ -133,7 +23,7 @@ static int __init meson_gx_socinfo_init(void) +@@ -143,7 +23,7 @@ static int __init meson_gx_socinfo_init(void) struct soc_device *soc_dev; struct device_node *np; struct regmap *regmap; @@ -285,7 +305,7 @@ index 111111111111..222222222222 100644 struct device *dev; int ret; -@@ -162,11 +52,11 @@ static int __init meson_gx_socinfo_init(void) +@@ -172,11 +52,11 @@ static int __init meson_gx_socinfo_init(void) return -ENODEV; } @@ -299,7 +319,7 @@ index 111111111111..222222222222 100644 pr_err("%s: invalid chipid value\n", __func__); return -EINVAL; } -@@ -177,13 +67,13 @@ static int __init meson_gx_socinfo_init(void) +@@ -187,13 +67,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", @@ -319,7 +339,7 @@ index 111111111111..222222222222 100644 soc_dev = soc_device_register(soc_dev_attr); if (IS_ERR(soc_dev)) { -@@ -196,10 +86,10 @@ static int __init meson_gx_socinfo_init(void) +@@ -206,10 +86,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, diff --git a/patch/kernel/archive/meson64-6.12/general-socinfo-sm-4-soc-amlogic-meson-gx-socinfo-sm-Add-Amlogic-secure-m.patch b/patch/kernel/archive/meson64-6.12/general-soc-0002-soc-amlogic-meson-gx-socinfo-sm-Add-Amlogic-secure-m.patch similarity index 96% rename from patch/kernel/archive/meson64-6.12/general-socinfo-sm-4-soc-amlogic-meson-gx-socinfo-sm-Add-Amlogic-secure-m.patch rename to patch/kernel/archive/meson64-6.12/general-soc-0002-soc-amlogic-meson-gx-socinfo-sm-Add-Amlogic-secure-m.patch index 4c6713041c..ebdc92555a 100644 --- a/patch/kernel/archive/meson64-6.12/general-socinfo-sm-4-soc-amlogic-meson-gx-socinfo-sm-Add-Amlogic-secure-m.patch +++ b/patch/kernel/archive/meson64-6.12/general-soc-0002-soc-amlogic-meson-gx-socinfo-sm-Add-Amlogic-secure-m.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Viacheslav Bocharov -Date: Wed, 21 Feb 2024 16:41:30 +0300 +Date: Mon, 18 Nov 2024 15:36:49 +0300 Subject: soc: amlogic: meson-gx-socinfo-sm: Add Amlogic secure-monitor SoC Information driver @@ -10,8 +10,6 @@ This patchs adds support for secure-monitor call decoding and exposing with the SoC bus infrastructure in addition to the previous SoC Information driver. -- rpardini: hack to fix "initialization of 'void (*)(struct platform_device *)' from incompatible pointer type 'int (*)(struct platform_device *)'" - Signed-off-by: Viacheslav Bocharov --- drivers/soc/amlogic/Kconfig | 10 + @@ -71,7 +69,7 @@ index 111111111111..222222222222 100644 + } v2; + struct { // raw + u32 version; -+ u8 buf[12+sizeof(union meson_cpu_id)]; ++ u8 buf[12 + sizeof(union meson_cpu_id)]; + } raw; }; @@ -243,12 +241,12 @@ index 000000000000..111111111111 +} + + -+static void meson_gx_socinfo_sm_remove(struct platform_device *pdev) ++static int meson_gx_socinfo_sm_remove(struct platform_device *pdev) +{ + struct soc_device *soc_dev = platform_get_drvdata(pdev); + + soc_device_unregister(soc_dev); -+ // return 0; ++ return 0; +} + +static const struct of_device_id meson_gx_socinfo_match[] = { diff --git a/patch/kernel/archive/meson64-6.12/general-socinfo-sm-6-dt-bindings-arm-amlogic-amlogic-meson-gx-ao-secure-a.patch b/patch/kernel/archive/meson64-6.12/general-soc-0003-dt-bindings-arm-amlogic-amlogic-meson-gx-ao-secure-a.patch similarity index 97% rename from patch/kernel/archive/meson64-6.12/general-socinfo-sm-6-dt-bindings-arm-amlogic-amlogic-meson-gx-ao-secure-a.patch rename to patch/kernel/archive/meson64-6.12/general-soc-0003-dt-bindings-arm-amlogic-amlogic-meson-gx-ao-secure-a.patch index 0f5fa737b3..71f842c1df 100644 --- a/patch/kernel/archive/meson64-6.12/general-socinfo-sm-6-dt-bindings-arm-amlogic-amlogic-meson-gx-ao-secure-a.patch +++ b/patch/kernel/archive/meson64-6.12/general-soc-0003-dt-bindings-arm-amlogic-amlogic-meson-gx-ao-secure-a.patch @@ -15,7 +15,7 @@ diff --git a/Documentation/devicetree/bindings/arm/amlogic/amlogic,meson-gx-ao-s index 111111111111..222222222222 100644 --- a/Documentation/devicetree/bindings/arm/amlogic/amlogic,meson-gx-ao-secure.yaml +++ b/Documentation/devicetree/bindings/arm/amlogic/amlogic,meson-gx-ao-secure.yaml -@@ -32,6 +32,10 @@ properties: +@@ -40,6 +40,10 @@ properties: reg: maxItems: 1 diff --git a/patch/kernel/archive/meson64-6.12/general-socinfo-sm-5-arm64-dts-meson-add-dts-links-to-secure-monitor-for-.patch b/patch/kernel/archive/meson64-6.12/general-soc-0004-arm64-dts-meson-add-dts-links-to-secure-monitor-for-.patch similarity index 100% rename from patch/kernel/archive/meson64-6.12/general-socinfo-sm-5-arm64-dts-meson-add-dts-links-to-secure-monitor-for-.patch rename to patch/kernel/archive/meson64-6.12/general-soc-0004-arm64-dts-meson-add-dts-links-to-secure-monitor-for-.patch