Skip to contentSkip to conversation

arm: dts: aspeed: Set SPI1 mode to master

PATCH In review Joel Stanley 3 participants 5 messages Nov 4, 2016

Subsystems (4)
lore
Share & tools
lore

Joel Stanley

author maintainer
#0 lore raw

PATCH 1/2 arm: dts: aspeed: Set SPI1 mode to master

Now that we can modify the strapping with pinmux, select the mode we wish the flash to be in with the device tree.

---
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts     | 2 +-
 arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +1 -1
index e1be7b0c5484..4c4c547fe412 100644
@@ -36,7 +36,7 @@
 &spi1 {
 	status = "okay";
 	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_spi1debug_default>;
+	pinctrl-0 = <&pinctrl_spi1_default>;
 
 	flash@0 {
 		status = "okay";
arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts +1 -1
index 9ff2412eef67..5c93139ad200 100644
@@ -36,7 +36,7 @@
 &spi1 {
 	status = "okay";
 	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_spi1debug_default>;
+	pinctrl-0 = <&pinctrl_spi1_default>;
 
 	flash@0 {
 		status = "okay";
Signature · 1 line
2.9.3
author maintainer
#1 lore raw

PATCH 2/2 arm: aspeed: Remove SPI1 strapping hacks

Now that we have device tree and pinmux support for setting the strapping we can remove these from the board file.

---
 arch/arm/mach-aspeed/aspeed.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
arch/arm/mach-aspeed/aspeed.c +1 -12
index ebb2224dcd13..2100e54ffbc2 100644
@@ -160,13 +160,8 @@ static void __init do_ast2500evb_setup(void)
 
 	do_ast2500_common_setup();
 
-	reg = readl(AST_IO(AST_BASE_SCU | 0x70));
-
 	/* Set strap to RGMII for dedicated PHY networking */
-	reg |= BIT(6) | BIT(7);
-	/* Enable SPI Master and SPI Slave to AHB Bridge */
-	reg |= BIT(13);
-	writel(reg, AST_IO(AST_BASE_SCU | 0x70));
+	writel(BIT(6) | BIT(7), AST_IO(AST_BASE_SCU | 0x70));
 }
 
 static void __init do_witherspoon_setup(void)
@@ -190,12 +185,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 1/2
#4 lore raw
In reply to Joel Stanley
Quoted 4 lines · Joel Stanley

Now that we can modify the strapping with pinmux, select the mode we wish the flash to be in with the device tree.

Also opened an issue[1] to fix g4 platforms.

Andrew

[1] https://github.com/openbmc/linux/issues/110

Quoted 31 lines

---
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts     | 2 +- arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts | 2 +-

 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +1 -1
index e1be7b0c5484..4c4c547fe412 100644
@@ -36,7 +36,7 @@
  &spi1 {
  	status = "okay";
  	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_spi1debug_default>;
+	pinctrl-0 = <&pinctrl_spi1_default>;


  flash@0 {
  status = "okay";

arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts +1 -1
index 9ff2412eef67..5c93139ad200 100644
@@ -36,7 +36,7 @@
  &spi1 {
  	status = "okay";
  	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_spi1debug_default>;
+	pinctrl-0 = <&pinctrl_spi1_default>;


  flash@0 {
  status = "okay";

Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] arm: aspeed: Remove SPI1 strapping hacks

In reply to Joel Stanley
Quoted 4 lines · Joel Stanley

Now that we have device tree and pinmux support for setting the strapping we can remove these from the board file.

Quoted 36 lines

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

 1 file changed, 1 insertion(+), 12 deletions(-)
arch/arm/mach-aspeed/aspeed.c +0 -0
index ebb2224dcd13..2100e54ffbc2 100644
@@ -160,13 +160,8 @@ static void __init do_ast2500evb_setup(void)


  do_ast2500_common_setup();

arch/arm/mach-aspeed/aspeed.c +0 -2
-	reg = readl(AST_IO(AST_BASE_SCU | 0x70));
-

  /* Set strap to RGMII for dedicated PHY networking */

arch/arm/mach-aspeed/aspeed.c +1 -4
-	reg |= BIT(6) | BIT(7);
-	/* Enable SPI Master and SPI Slave to AHB Bridge */
-	reg |= BIT(13);
-	writel(reg, AST_IO(AST_BASE_SCU | 0x70));
+	writel(BIT(6) | BIT(7), AST_IO(AST_BASE_SCU | 0x70));

 }

 static void __init do_witherspoon_setup(void)

arch/arm/mach-aspeed/aspeed.c +0 -0
@@ -190,12 +185,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: Remove SPI1 strapping hacks

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

Now that we have device tree and pinmux support for setting the strapping we can remove these from the board file.

Quoted 37 lines
Quoted 37 lines
---
 arch/arm/mach-aspeed/aspeed.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
arch/arm/mach-aspeed/aspeed.c +1 -12
index ebb2224dcd13..2100e54ffbc2 100644
@@ -160,13 +160,8 @@ static void __init do_ast2500evb_setup(void)
 
      do_ast2500_common_setup();
 
-     reg = readl(AST_IO(AST_BASE_SCU | 0x70));
-
      /* Set strap to RGMII for dedicated PHY networking */
-     reg |= BIT(6) | BIT(7);
-     /* Enable SPI Master and SPI Slave to AHB Bridge */
-     reg |= BIT(13);
-     writel(reg, AST_IO(AST_BASE_SCU | 0x70));
+     writel(BIT(6) | BIT(7), AST_IO(AST_BASE_SCU | 0x70));
 }
 
 static void __init do_witherspoon_setup(void)
@@ -190,12 +185,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));