Skip to contentSkip to conversation

meson-gx-socinfo: Fix package id parsing

PATCH New Arnaud Patard 3 participants 3 messages Nov 29, 2017 – Nov 30, 2017 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson-gx-socinfo: Fix package id parsing

I've noticed the following message while booting a S905X based board:

soc soc0: Amlogic Meson GXL (S905D) Revision 21:82 (b:2) Detected

The S905D string is obviously wrong. The vendor code does:
...

        ver = (readl(assist_hw_rev) >> 8) & 0xff;
        meson_cpu_version[MESON_CPU_VERSION_LVL_MINOR] = ver;
        ver =  (readl(assist_hw_rev) >> 16) & 0xff;
        meson_cpu_version[MESON_CPU_VERSION_LVL_PACK] = ver;

...

while the current code does:
...
#define SOCINFO_MINOR GENMASK(23, 16)
#define SOCINFO_PACK GENMASK(15, 8)
...

This means that the current mainline code has package id and minor version reversed.

Fixes a9daaba2965e8 ("soc: Add Amlogic SoC Information driver")
drivers/soc/amlogic/meson-gx-socinfo.c +2 -2
Index: linux/drivers/soc/amlogic/meson-gx-socinfo.c
===================================================================
@@ -20,8 +20,8 @@
 #define AO_SEC_SOCINFO_OFFSET	AO_SEC_SD_CFG8
 
 #define SOCINFO_MAJOR	GENMASK(31, 24)
-#define SOCINFO_MINOR	GENMASK(23, 16)
-#define SOCINFO_PACK	GENMASK(15, 8)
+#define SOCINFO_PACK	GENMASK(23, 16)
+#define SOCINFO_MINOR	GENMASK(15, 8)
 #define SOCINFO_MISC	GENMASK(7, 0)
 
 static const struct meson_gx_soc_id {
#1 lore raw

PATCH 1/1 meson-gx-socinfo: Fix package id parsing

Quoted 30 lines · Arnaud Patard

I've noticed the following message while booting a S905X based board:

soc soc0: Amlogic Meson GXL (S905D) Revision 21:82 (b:2) Detected

The S905D string is obviously wrong. The vendor code does:
...

        ver = (readl(assist_hw_rev) >> 8) & 0xff;
        meson_cpu_version[MESON_CPU_VERSION_LVL_MINOR] = ver;
        ver =  (readl(assist_hw_rev) >> 16) & 0xff;
        meson_cpu_version[MESON_CPU_VERSION_LVL_PACK] = ver;

...

while the current code does:
...
#define SOCINFO_MINOR GENMASK(23, 16)
#define SOCINFO_PACK GENMASK(15, 8)
...

This means that the current mainline code has package id and minor version reversed.

Fixes a9daaba2965e8 ("soc: Add Amlogic SoC Information driver")

Index: linux/drivers/soc/amlogic/meson-gx-socinfo.c
===================================================================

drivers/soc/amlogic/meson-gx-socinfo.c line 27

Quoted 10 lines
drivers/soc/amlogic/meson-gx-socinfo.c +2 -2
@@ -20,8 +20,8 @@
 #define AO_SEC_SOCINFO_OFFSET	AO_SEC_SD_CFG8
 
 #define SOCINFO_MAJOR	GENMASK(31, 24)
-#define SOCINFO_MINOR	GENMASK(23, 16)
-#define SOCINFO_PACK	GENMASK(15, 8)
+#define SOCINFO_PACK	GENMASK(23, 16)
+#define SOCINFO_MINOR	GENMASK(15, 8)
 #define SOCINFO_MISC	GENMASK(7, 0)
 
 static const struct meson_gx_soc_id {
maintainer Applied
#2 lore raw

PATCH 1/1 meson-gx-socinfo: Fix package id parsing

Hi Arnaud,

Quoted 38 lines · Neil Armstrong
Quoted 37 lines · Arnaud Patard

I've noticed the following message while booting a S905X based board:

soc soc0: Amlogic Meson GXL (S905D) Revision 21:82 (b:2) Detected

The S905D string is obviously wrong. The vendor code does:
...

        ver = (readl(assist_hw_rev) >> 8) & 0xff;
        meson_cpu_version[MESON_CPU_VERSION_LVL_MINOR] = ver;
        ver =  (readl(assist_hw_rev) >> 16) & 0xff;
        meson_cpu_version[MESON_CPU_VERSION_LVL_PACK] = ver;

...

while the current code does:
...
#define SOCINFO_MINOR GENMASK(23, 16)
#define SOCINFO_PACK GENMASK(15, 8)
...

This means that the current mainline code has package id and minor version reversed.

Fixes a9daaba2965e8 ("soc: Add Amlogic SoC Information driver")

Index: linux/drivers/soc/amlogic/meson-gx-socinfo.c
===================================================================

drivers/soc/amlogic/meson-gx-socinfo.c +2 -2
@@ -20,8 +20,8 @@
 #define AO_SEC_SOCINFO_OFFSET	AO_SEC_SD_CFG8
 
 #define SOCINFO_MAJOR	GENMASK(31, 24)
-#define SOCINFO_MINOR	GENMASK(23, 16)
-#define SOCINFO_PACK	GENMASK(15, 8)
+#define SOCINFO_PACK	GENMASK(23, 16)
+#define SOCINFO_MINOR	GENMASK(15, 8)
 #define SOCINFO_MISC	GENMASK(7, 0)
 
Quoted 5 lines

drivers/soc/amlogic/meson-gx-socinfo.c line 27

Quoted 3 lines
drivers/soc/amlogic/meson-gx-socinfo.c +0 -0
 static const struct meson_gx_soc_id {

Thanks for the fix!

Applied to v4.15/fixes with Neil's ack.

Kevin