Skip to contentSkip to conversation

arm: aspeed: Add Romulus BMC-specific early setup

PATCH In review Joel Stanley 3 participants 9 messages Nov 2, 2016 – Nov 4, 2016

Subsystems (3)
lore
Share & tools
lore

Joel Stanley

author maintainer
#0 lore raw

PATCH 1/2 arm: aspeed: Add Romulus BMC-specific early setup

---
 arch/arm/mach-aspeed/aspeed.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mach-aspeed/aspeed.c +6 -0
index ebb2224dcd13..0a4578290d5e 100644
@@ -214,6 +214,10 @@ static void __init do_zaius_setup(void)
 	}
 }
 
+static void __init do_romulus_setup(void)
+{
+	do_ast2500_common_setup();
+}
 
 #define SCU_PASSWORD	0x1688A8A8
 
@@ -262,6 +266,8 @@ static void __init aspeed_init_early(void)
 		do_witherspoon_setup();
 	if (of_machine_is_compatible("ingrasys,zaius-bmc"))
 		do_zaius_setup();
+	if (of_machine_is_compatible("ibm,romulus-bmc"))
+		do_romulus_setup();
 }
 
 static void __init aspeed_map_io(void)
Signature · 1 line
2.9.3
author maintainer
#1 lore raw

PATCH 2/2 arm: aspeed: Set SPI master strap for all boards

All of the ast2500 systems that we support have incorrect strapping for SPI. This commit moves the Zaius specific strapping change to the common ast2500 setup, so that Witherspoon, Romulus and the EVB can benefit.

This moves the strapping change out from the Zaius board version check. I don't see an issue there, as the will still be correct for future boards.

---
 arch/arm/mach-aspeed/aspeed.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm/mach-aspeed/aspeed.c +6 -6
index 0a4578290d5e..57c32ff0fa83 100644
@@ -152,6 +152,12 @@ static void __init do_ast2500_common_setup(void)
 	reg = readl(AST_IO(AST_BASE_MAC0 | 0x40));
 	reg &= ~0x80000000;
 	writel(reg, AST_IO(AST_BASE_MAC0 | 0x40));
+
+	/* Set strap[13:12] to 01, Enable SPI master */
+	/* Set bits in writes to SCU7C are cleared from SCU70 */
+	writel(BIT(13), AST_IO(AST_BASE_SCU | 0x7C));
+	/* SCU70 is set-only, so no read-modify-write needed */
+	writel(BIT(12), AST_IO(AST_BASE_SCU | 0x70));
 }
 
 static void __init do_ast2500evb_setup(void)
@@ -190,12 +196,6 @@ static void __init do_zaius_setup(void)
 		/* D3 in GPIOA/B/C/D direction and data registers */
 		unsigned long phy_reset_mask = BIT(27);
 
-		/* Set strap[13:12] to 01, Enable SPI master */
-		/* Set bits in writes to SCU7C are cleared from SCU70 */
-		writel(BIT(13), AST_IO(AST_BASE_SCU | 0x7C));
-		/* SCU70 is set-only, so no read-modify-write needed */
-		writel(BIT(12), AST_IO(AST_BASE_SCU | 0x70));
-
 		/* Disable GPIO I, G/AB pulldowns due to weak driving buffers */
 		reg = readl(AST_IO(AST_BASE_SCU | 0x8C));
 		writel(reg | BIT(24) | BIT(22), AST_IO(AST_BASE_SCU | 0x8C));
Signature · 1 line
2.9.3
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] arm: aspeed: Set SPI master strap for all boards

Quoted 9 lines · Joel Stanley

All of the ast2500 systems that we support have incorrect strapping for SPI. This commit moves the Zaius specific strapping change to the common ast2500 setup, so that Witherspoon, Romulus and the EVB can benefit.

This moves the strapping change out from the Zaius board version check. I don't see an issue there, as the will still be correct for future boards.

Quoted 34 lines

---
 arch/arm/mach-aspeed/aspeed.c | 12 ++++++------

 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm/mach-aspeed/aspeed.c +6 -0
index 0a4578290d5e..57c32ff0fa83 100644
@@ -152,6 +152,12 @@ static void __init do_ast2500_common_setup(void)
  	reg = readl(AST_IO(AST_BASE_MAC0 | 0x40));
  	reg &= ~0x80000000;
  	writel(reg, AST_IO(AST_BASE_MAC0 | 0x40));
+
+	/* Set strap[13:12] to 01, Enable SPI master */
+	/* Set bits in writes to SCU7C are cleared from SCU70 */
+	writel(BIT(13), AST_IO(AST_BASE_SCU | 0x7C));
+	/* SCU70 is set-only, so no read-modify-write needed */
+	writel(BIT(12), AST_IO(AST_BASE_SCU | 0x70));
  }


 static void __init do_ast2500evb_setup(void)

arch/arm/mach-aspeed/aspeed.c +0 -0
@@ -190,12 +196,6 @@ static void __init do_zaius_setup(void)
  		/* D3 in GPIOA/B/C/D direction and data registers */
  		unsigned long phy_reset_mask = BIT(27);

arch/arm/mach-aspeed/aspeed.c +0 -6
-		/* Set strap[13:12] to 01, Enable SPI master */
-		/* Set bits in writes to SCU7C are cleared from SCU70 */
-		writel(BIT(13), AST_IO(AST_BASE_SCU | 0x7C));
-		/* SCU70 is set-only, so no read-modify-write needed */
-		writel(BIT(12), AST_IO(AST_BASE_SCU | 0x70));
-

  /* Disable GPIO I, G/AB pulldowns due to weak driving buffers */ reg = readl(AST_IO(AST_BASE_SCU | 0x8C)); writel(reg | BIT(24) | BIT(22), AST_IO(AST_BASE_SCU | 0x8C));

Reviewed-by
#3 lore raw

Re: [PATCH 2/2] arm: aspeed: Set SPI master strap for all boards

Quoted 5 lines · Andrew Jeffery
Quoted 4 lines · Joel Stanley

All of the ast2500 systems that we support have incorrect strapping for SPI. This commit moves the Zaius specific strapping change to the common ast2500 setup, so that Witherspoon, Romulus and the EVB can benefit.

Quoted 8 lines
Quoted 5 lines

This moves the strapping change out from the Zaius board version check. I don't see an issue there, as the will still be correct for future boards.

Quoted 34 lines
Quoted 34 lines
---
 arch/arm/mach-aspeed/aspeed.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm/mach-aspeed/aspeed.c +6 -6
index 0a4578290d5e..57c32ff0fa83 100644
@@ -152,6 +152,12 @@ static void __init do_ast2500_common_setup(void)
      reg = readl(AST_IO(AST_BASE_MAC0 | 0x40));
      reg &= ~0x80000000;
      writel(reg, AST_IO(AST_BASE_MAC0 | 0x40));
+
+     /* Set strap[13:12] to 01, Enable SPI master */
+     /* Set bits in writes to SCU7C are cleared from SCU70 */
+     writel(BIT(13), AST_IO(AST_BASE_SCU | 0x7C));
+     /* SCU70 is set-only, so no read-modify-write needed */
+     writel(BIT(12), AST_IO(AST_BASE_SCU | 0x70));
 }
 
 static void __init do_ast2500evb_setup(void)
@@ -190,12 +196,6 @@ static void __init do_zaius_setup(void)
              /* D3 in GPIOA/B/C/D direction and data registers */
              unsigned long phy_reset_mask = BIT(27);
 
-             /* Set strap[13:12] to 01, Enable SPI master */
-             /* Set bits in writes to SCU7C are cleared from SCU70 */
-             writel(BIT(13), AST_IO(AST_BASE_SCU | 0x7C));
-             /* SCU70 is set-only, so no read-modify-write needed */
-             writel(BIT(12), AST_IO(AST_BASE_SCU | 0x70));
-
              /* Disable GPIO I, G/AB pulldowns due to weak driving buffers */
              reg = readl(AST_IO(AST_BASE_SCU | 0x8C));
              writel(reg | BIT(24) | BIT(22), AST_IO(AST_BASE_SCU | 0x8C));
author maintainer Applied
#4 lore raw

Re: [PATCH 2/2] arm: aspeed: Set SPI master strap for all boards

Quoted 10 lines · Xo Wang
Quoted 9 lines · Andrew Jeffery
Quoted 8 lines · Joel Stanley

All of the ast2500 systems that we support have incorrect strapping for SPI. This commit moves the Zaius specific strapping change to the common ast2500 setup, so that Witherspoon, Romulus and the EVB can benefit.

This moves the strapping change out from the Zaius board version check. I don't see an issue there, as the will still be correct for future boards.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Thank you both for the prompt review.

Applied to dev-4.7.

Cheers,

Joel

#5 lore raw

Re: [PATCH 2/2] arm: aspeed: Set SPI master strap for all boards

Quoted 14 lines · Joel Stanley
Quoted 13 lines · Xo Wang
Quoted 11 lines · Andrew Jeffery
Quoted 9 lines · Joel Stanley

All of the ast2500 systems that we support have incorrect strapping for SPI. This commit moves the Zaius specific strapping change to the common ast2500 setup, so that Witherspoon, Romulus and the EVB can benefit.

This moves the strapping change out from the Zaius board version check. I don't see an issue there, as the will still be correct for future boards.

Quoted 7 lines
Quoted 4 lines
Quoted 3 lines
Quoted 1 line

Thank you both for the prompt review.

Applied to dev-4.7.

Just noting that a this will likely be backed out in favour of Kun Yi's patch[1]. That way we can configure it in the devicetree in spite of the platform's strapping.

Andrew

[1] https://lists.ozlabs.org/pipermail/openbmc/2016-November/005393.html

Quoted 4 lines

Cheers,

Joel

author maintainer
#6 lore raw

Re: [PATCH 2/2] arm: aspeed: Set SPI master strap for all boards

Quoted 7 lines · Andrew Jeffery
Quoted 3 lines

Thank you both for the prompt review.

Applied to dev-4.7.

Just noting that a this will likely be backed out in favour of Kun Yi's patch[1]. That way we can configure it in the devicetree in spite of the platform's strapping.

Yup. Unapplied! Wheeee

Cheers,

Joel

Reviewed-by on v1 1/2
#7 lore raw
In reply to Joel Stanley
Quoted 1 line · Joel Stanley
Quoted 29 lines

---
 arch/arm/mach-aspeed/aspeed.c | 6 ++++++

 1 file changed, 6 insertions(+)
arch/arm/mach- renamed from arch/arm/mach-aspeed/aspeed.c +0 -0

aspeed/aspeed.c
index ebb2224dcd13..0a4578290d5e 100644

arch/arm/mach-aspeed/aspeed.c +0 -0
@@ -214,6 +214,10 @@ static void __init do_zaius_setup(void)
  	}
  }

arch/arm/mach-aspeed/aspeed.c +4 -0
+static void __init do_romulus_setup(void)
+{
+	do_ast2500_common_setup();
+}


 #define SCU_PASSWORD 0x1688A8A8

arch/arm/mach-aspeed/aspeed.c +2 -0
@@ -262,6 +266,8 @@ static void __init aspeed_init_early(void)
  		do_witherspoon_setup();
  	if (of_machine_is_compatible("ingrasys,zaius-bmc"))
  		do_zaius_setup();
+	if (of_machine_is_compatible("ibm,romulus-bmc"))
+		do_romulus_setup();
  }


 static void __init aspeed_map_io(void)