Skip to contentSkip to conversation

arm: aspeed: romulus: Do common setup

PATCH Applied Lei YU 2 participants 5 messages Feb 18, 2017 – Feb 21, 2017

Subsystems (3)
lore
Share & tools
lore

Lei YU

author
#0 lore raw

PATCH 1/1 arm: aspeed: romulus: Do common setup

Call do_common_setup for romulus.
No other romulus specific setup is needed. Consider moving do_common_setup() to a common place.

---
 arch/arm/mach-aspeed/aspeed.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach-aspeed/aspeed.c +7 -0
index 2a11c2e..726b8fa 100644
@@ -218,6 +218,11 @@ static void __init do_witherspoon_setup(void)
 	writel(0x68600000, AST_IO(AST_BASE_SPI | 0x30));
 }
 
+static void __init do_romulus_setup(void)
+{
+	do_common_setup();
+}
+
 #define SCU_PASSWORD	0x1688A8A8
 
 static void __init aspeed_init_early(void)
@@ -253,6 +258,8 @@ static void __init aspeed_init_early(void)
 		do_zaius_setup();
 	if (of_machine_is_compatible("ibm,witherspoon-bmc"))
 		do_witherspoon_setup();
+	if (of_machine_is_compatible("ibm,romulus-bmc"))
+		do_romulus_setup();
 }
 
 static void __init aspeed_map_io(void)
Signature · 1 line
1.9.1
author
#1 lore raw

I thought do_common_setup() is called by default, but actually it's not. So Romulus needs to call do_common_setup() as well.

--
BRs,
Lei YU

Quoted 37 lines · Lei YU

Call do_common_setup for romulus.
No other romulus specific setup is needed. Consider moving do_common_setup() to a common place.

---
 arch/arm/mach-aspeed/aspeed.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach-aspeed/aspeed.c +7 -1
index 2a11c2e..726b8fa 100644
@@ -218,6 +218,11 @@ static void __init do_witherspoon_setup(void)
        writel(0x68600000, AST_IO(AST_BASE_SPI | 0x30));
 }
 
+static void __init do_romulus_setup(void)
+{
+       do_common_setup();
+}
+
 #define SCU_PASSWORD   0x1688A8A8
 
 static void __init aspeed_init_early(void)
@@ -253,6 +258,8 @@ static void __init aspeed_init_early(void)
                do_zaius_setup();
        if (of_machine_is_compatible("ibm,witherspoon-bmc"))
                do_witherspoon_setup();
+       if (of_machine_is_compatible("ibm,romulus-bmc"))
+               do_romulus_setup();
 }
 
 static void __init aspeed_map_io(void)
--

1.9.1

maintainer
#2 lore raw

Hi Lei,

Quoted 2 lines · Mine

I thought do_common_setup() is called by default, but actually it's not. So Romulus needs to call do_common_setup() as well.

We don't need most of what this is doing on any platform.

Quoted 2 lines
       /* Enable LPC FWH cycles, Enable LPC to AHB bridge */
       writel(0x00000500, AST_IO(AST_BASE_LPC | 0x80));

This is performed by the LPC driver that Cyril has written.

Quoted 2 lines
       /* Set UART routing */
       writel(0x00000000, AST_IO(AST_BASE_LPC | 0x9c));

This is the default. If we need to change it in the future we might write a pinmux driver, but for now we could omit this.

Quoted 3 lines
       /* Setup scratch registers */
       writel(0x00000042, AST_IO(AST_BASE_LPC | 0x170));
       writel(0x00008000, AST_IO(AST_BASE_LPC | 0x174));

We don't have a driver for this. Andrew was thinking about a UIO driver. Ben started a discussion[1] upstream about the preferred approach.

[1] https://lkml.org/lkml/2017/2/17/30

Cheers,

Joel

Quoted 43 lines

--
BRs,
Lei YU

Quoted 37 lines · Lei YU

Call do_common_setup for romulus.
No other romulus specific setup is needed. Consider moving do_common_setup() to a common place.

---
 arch/arm/mach-aspeed/aspeed.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach-aspeed/aspeed.c +7 -1
index 2a11c2e..726b8fa 100644
@@ -218,6 +218,11 @@ static void __init do_witherspoon_setup(void)
        writel(0x68600000, AST_IO(AST_BASE_SPI | 0x30));
 }
 
+static void __init do_romulus_setup(void)
+{
+       do_common_setup();
+}
+
 #define SCU_PASSWORD   0x1688A8A8
 
 static void __init aspeed_init_early(void)
@@ -253,6 +258,8 @@ static void __init aspeed_init_early(void)
                do_zaius_setup();
        if (of_machine_is_compatible("ibm,witherspoon-bmc"))
                do_witherspoon_setup();
+       if (of_machine_is_compatible("ibm,romulus-bmc"))
+               do_romulus_setup();
 }
 
 static void __init aspeed_map_io(void)
--

1.9.1

author
#3 lore raw

Hi Joel,

Quoted 19 lines · Joel Stanley

Hi Lei,

Quoted 2 lines · Mine

I thought do_common_setup() is called by default, but actually it's not. So Romulus needs to call do_common_setup() as well.

We don't need most of what this is doing on any platform.

Quoted 2 lines
       /* Enable LPC FWH cycles, Enable LPC to AHB bridge */
       writel(0x00000500, AST_IO(AST_BASE_LPC | 0x80));

This is performed by the LPC driver that Cyril has written.

Quoted 2 lines
       /* Set UART routing */
       writel(0x00000000, AST_IO(AST_BASE_LPC | 0x9c));

This is the default. If we need to change it in the future we might write a pinmux driver, but for now we could omit this.

Quoted 7 lines
Quoted 3 lines
       /* Setup scratch registers */
       writel(0x00000042, AST_IO(AST_BASE_LPC | 0x170));
       writel(0x00008000, AST_IO(AST_BASE_LPC | 0x174));

We don't have a driver for this. Andrew was thinking about a UIO driver. Ben started a discussion[1] upstream about the preferred approach.

It means for now they are needed, before the UIO driver is implemented, is it? So I assume Romulus will need do_common_setup() anyway, at least for the current kernel.
Otherwise I'm afraid the VUART may not work since it requires register 0x174 to be set to 0x00008000.

Quoted 50 lines

[1] https://lkml.org/lkml/2017/2/17/30

Cheers,

Joel

Quoted 43 lines

--
BRs,
Lei YU

Quoted 37 lines · Lei YU

Call do_common_setup for romulus.
No other romulus specific setup is needed. Consider moving do_common_setup() to a common place.

---
 arch/arm/mach-aspeed/aspeed.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach-aspeed/aspeed.c +7 -1
index 2a11c2e..726b8fa 100644
@@ -218,6 +218,11 @@ static void __init do_witherspoon_setup(void)
        writel(0x68600000, AST_IO(AST_BASE_SPI | 0x30));
 }
 
+static void __init do_romulus_setup(void)
+{
+       do_common_setup();
+}
+
 #define SCU_PASSWORD   0x1688A8A8
 
 static void __init aspeed_init_early(void)
@@ -253,6 +258,8 @@ static void __init aspeed_init_early(void)
                do_zaius_setup();
        if (of_machine_is_compatible("ibm,witherspoon-bmc"))
                do_witherspoon_setup();
+       if (of_machine_is_compatible("ibm,romulus-bmc"))
+               do_romulus_setup();
 }
 
 static void __init aspeed_map_io(void)
--

1.9.1

maintainer Applied
#4 lore raw
Quoted 30 lines · Mine

Hi Joel,

Quoted 19 lines · Joel Stanley

Hi Lei,

Quoted 2 lines · Mine

I thought do_common_setup() is called by default, but actually it's not. So Romulus needs to call do_common_setup() as well.

We don't need most of what this is doing on any platform.

Quoted 2 lines
       /* Enable LPC FWH cycles, Enable LPC to AHB bridge */
       writel(0x00000500, AST_IO(AST_BASE_LPC | 0x80));

This is performed by the LPC driver that Cyril has written.

Quoted 2 lines
       /* Set UART routing */
       writel(0x00000000, AST_IO(AST_BASE_LPC | 0x9c));

This is the default. If we need to change it in the future we might write a pinmux driver, but for now we could omit this.

Quoted 7 lines
Quoted 3 lines
       /* Setup scratch registers */
       writel(0x00000042, AST_IO(AST_BASE_LPC | 0x170));
       writel(0x00008000, AST_IO(AST_BASE_LPC | 0x174));

We don't have a driver for this. Andrew was thinking about a UIO driver. Ben started a discussion[1] upstream about the preferred approach.

Quoted 5 lines

It means for now they are needed, before the UIO driver is implemented, is it? So I assume Romulus will need do_common_setup() anyway, at least for the current kernel.
Otherwise I'm afraid the VUART may not work since it requires register 0x174 to be set to 0x00008000.

Okay. We can include this one for now while the UIO driver is developed.

Applied to dev-4.7.

Cheers,

Joel

Quoted 51 lines
Quoted 51 lines

[1] https://lkml.org/lkml/2017/2/17/30

Cheers,

Joel

Quoted 43 lines

--
BRs,
Lei YU

Quoted 37 lines · Lei YU

Call do_common_setup for romulus.
No other romulus specific setup is needed. Consider moving do_common_setup() to a common place.

---
 arch/arm/mach-aspeed/aspeed.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach-aspeed/aspeed.c +7 -1
index 2a11c2e..726b8fa 100644
@@ -218,6 +218,11 @@ static void __init do_witherspoon_setup(void)
        writel(0x68600000, AST_IO(AST_BASE_SPI | 0x30));
 }
 
+static void __init do_romulus_setup(void)
+{
+       do_common_setup();
+}
+
 #define SCU_PASSWORD   0x1688A8A8
 
 static void __init aspeed_init_early(void)
@@ -253,6 +258,8 @@ static void __init aspeed_init_early(void)
                do_zaius_setup();
        if (of_machine_is_compatible("ibm,witherspoon-bmc"))
                do_witherspoon_setup();
+       if (of_machine_is_compatible("ibm,romulus-bmc"))
+               do_romulus_setup();
 }
 
 static void __init aspeed_map_io(void)
--

1.9.1