All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc: aspeed: socinfo: Add new systems
@ 2021-02-10 11:46 Joel Stanley
  2021-02-14 23:01 ` Andrew Jeffery
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Stanley @ 2021-02-10 11:46 UTC (permalink / raw)
  To: Andrew Jeffery; +Cc: Ryan Chen, linux-aspeed, linux-arm-kernel

Aspeed's u-boot sdk has been updated with the SoC IDs for the AST2605
variant, as well as A2 and A3 variants of the 2600 family.

From u-boot's arch/arm/mach-aspeed/ast2600/scu_info.c:

    SOC_ID("AST2600-A0", 0x0500030305000303),
    SOC_ID("AST2600-A1", 0x0501030305010303),
    SOC_ID("AST2620-A1", 0x0501020305010203),
    SOC_ID("AST2600-A2", 0x0502030305010303),
    SOC_ID("AST2620-A2", 0x0502020305010203),
    SOC_ID("AST2605-A2", 0x0502010305010103),
    SOC_ID("AST2600-A3", 0x0503030305030303),
    SOC_ID("AST2620-A3", 0x0503020305030203),
    SOC_ID("AST2605-A3", 0x0503010305030103),

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 drivers/soc/aspeed/aspeed-socinfo.c | 33 ++++++++++++++++++++++-------
 1 file changed, 25 insertions(+), 8 deletions(-)

diff --git a/drivers/soc/aspeed/aspeed-socinfo.c b/drivers/soc/aspeed/aspeed-socinfo.c
index 773930e0cb10..e3215f826d17 100644
--- a/drivers/soc/aspeed/aspeed-socinfo.c
+++ b/drivers/soc/aspeed/aspeed-socinfo.c
@@ -25,6 +25,7 @@ static struct {
 	/* AST2600 */
 	{ "AST2600", 0x05000303 },
 	{ "AST2620", 0x05010203 },
+	{ "AST2605", 0x05030103 },
 };
 
 static const char *siliconid_to_name(u32 siliconid)
@@ -43,14 +44,30 @@ static const char *siliconid_to_name(u32 siliconid)
 static const char *siliconid_to_rev(u32 siliconid)
 {
 	unsigned int rev = (siliconid >> 16) & 0xff;
-
-	switch (rev) {
-	case 0:
-		return "A0";
-	case 1:
-		return "A1";
-	case 3:
-		return "A2";
+	unsigned int gen = (siliconid >> 24) & 0xff;
+
+	if (gen < 0x5) {
+		/* AST2500 and below */
+		switch (rev) {
+		case 0:
+			return "A0";
+		case 1:
+			return "A1";
+		case 3:
+			return "A2";
+		}
+	} else {
+		/* AST2600 */
+		switch (rev) {
+		case 0:
+			return "A0";
+		case 1:
+			return "A1";
+		case 2:
+			return "A2";
+		case 3:
+			return "A3";
+		}
 	}
 
 	return "??";
-- 
2.30.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] soc: aspeed: socinfo: Add new systems
  2021-02-10 11:46 [PATCH] soc: aspeed: socinfo: Add new systems Joel Stanley
@ 2021-02-14 23:01 ` Andrew Jeffery
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Jeffery @ 2021-02-14 23:01 UTC (permalink / raw)
  To: Joel Stanley; +Cc: Ryan Chen, linux-arm-kernel, linux-aspeed



On Wed, 10 Feb 2021, at 22:16, Joel Stanley wrote:
> Aspeed's u-boot sdk has been updated with the SoC IDs for the AST2605
> variant, as well as A2 and A3 variants of the 2600 family.
> 
> From u-boot's arch/arm/mach-aspeed/ast2600/scu_info.c:
> 
>     SOC_ID("AST2600-A0", 0x0500030305000303),
>     SOC_ID("AST2600-A1", 0x0501030305010303),
>     SOC_ID("AST2620-A1", 0x0501020305010203),
>     SOC_ID("AST2600-A2", 0x0502030305010303),
>     SOC_ID("AST2620-A2", 0x0502020305010203),
>     SOC_ID("AST2605-A2", 0x0502010305010103),
>     SOC_ID("AST2600-A3", 0x0503030305030303),
>     SOC_ID("AST2620-A3", 0x0503020305030203),
>     SOC_ID("AST2605-A3", 0x0503010305030103),
> 
> Signed-off-by: Joel Stanley <joel@jms.id.au>

Reviewed-by: Andrew Jeffery <andrew@aj.id.au>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-14 23:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10 11:46 [PATCH] soc: aspeed: socinfo: Add new systems Joel Stanley
2021-02-14 23:01 ` Andrew Jeffery

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.