arm: dts: aspeed: Set SPI1 mode to master
Joel Stanley
maintainerPATCH 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
@@ -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
@@ -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
Joel Stanley
maintainerPATCH 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
@@ -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
Re: [PATCH 2/2] arm: aspeed: Remove SPI1 strapping hacks
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.
Signed-off-by Joel Stanley <[email protected]>
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@@ -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__initdo_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));
Xo Wang
Reviewed-byRe: [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.
Signed-off-by Joel Stanley <[email protected]>Reviewed-by Andrew Jeffery <[email protected]>
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@@ -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 ));
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.
Signed-off-by Joel Stanley <[email protected]>
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@@ -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@@ -36,7 +36,7 @@ &spi1 { status = "okay"; pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_spi1debug_default>; + pinctrl-0 = <&pinctrl_spi1_default>;
flash@0 {
status = "okay";