[PATCH u-boot v2] Move UART setup outside DRAM init
OpenBMC Patches
openbmc-patches at stwcx.xyz
Mon Feb 22 13:01:01 AEDT 2016
From: Norman James <njames at us.ibm.com>
When a BMC reboot occurs an SOC reset is performed.
An SOC reset does not reset the DRAM. The uboot platform
code initialized UART in dram init section. So an SOC
reset was causing the UART to not be initialized on reboot.
This moves the UART setup code before dram init stage.
Signed-off-by: Norman James <nkskjames at gmail.com>
---
board/aspeed/ast2400/platform.S | 81 +++++++++++++++++++++--------------------
1 file changed, 42 insertions(+), 39 deletions(-)
diff --git a/board/aspeed/ast2400/platform.S b/board/aspeed/ast2400/platform.S
index dd94da0..5e048a5 100644
--- a/board/aspeed/ast2400/platform.S
+++ b/board/aspeed/ast2400/platform.S
@@ -184,6 +184,48 @@ LPC_Patch_E:
.globl lowlevel_init
lowlevel_init:
+ /* setup UART */
+ ldr r0, =CONFIG_ASPEED_COM_LCR
+ mov r1, #0x83
+ str r1, [r0]
+
+ ldr r0, =0x1e6e202c
+ ldr r1, =0x00000010
+ str r1, [r0]
+
+ ldr r2, [r0]
+ mov r2, r2, lsr #12
+ tst r2, #0x01
+ ldr r0, =CONFIG_ASPEED_COM
+#if CONFIG_BAUDRATE == 115200
+ moveq r1, #0x0D @ Baudrate 115200
+ movne r1, #0x01 @ Baudrate 115200, div13
+#endif
+#if CONFIG_BAUDRATE == 57600
+ moveq r1, #0x1A @ Baudrate 57600
+ movne r1, #0x02 @ Baudrate 57600, div13
+#endif
+#if CONFIG_BAUDRATE == 38400
+ moveq r1, #0x27 @ Baudrate 38400
+ movne r1, #0x03 @ Baudrate 38400 , div13
+#endif
+#if CONFIG_BAUDRATE == 9600
+ moveq r1, #0x9c @ Baudrate 9600
+ movne r1, #0x0C @ Baudrate 9600 , div13
+#endif
+ str r1, [r0]
+
+ ldr r0, =CONFIG_ASPEED_COM_IER
+ mov r1, #0x00
+ str r1, [r0]
+
+ ldr r0, =CONFIG_ASPEED_COM_LCR
+ mov r1, #0x03
+ str r1, [r0]
+
+ ldr r0, =CONFIG_ASPEED_COM_IIR
+ mov r1, #0x07
+ str r1, [r0]
init_dram:
/* save lr */
@@ -338,45 +380,6 @@ set_MPLL:
ldr r1, =0xFFFF0000 @ enable UART3 and UART4
str r1, [r0]
- ldr r0, =CONFIG_ASPEED_COM_LCR
- mov r1, #0x83
- str r1, [r0]
-
- ldr r0, =0x1e6e202c
- ldr r2, [r0]
- mov r2, r2, lsr #12
- tst r2, #0x01
- ldr r0, =CONFIG_ASPEED_COM
-#if CONFIG_BAUDRATE == 115200
- moveq r1, #0x0D @ Baudrate 115200
- movne r1, #0x01 @ Baudrate 115200, div13
-#endif
-#if CONFIG_BAUDRATE == 57600
- moveq r1, #0x1A @ Baudrate 57600
- movne r1, #0x02 @ Baudrate 57600, div13
-#endif
-#if CONFIG_BAUDRATE == 38400
- moveq r1, #0x27 @ Baudrate 38400
- movne r1, #0x03 @ Baudrate 38400 , div13
-#endif
-#if CONFIG_BAUDRATE == 9600
- moveq r1, #0x9c @ Baudrate 9600
- movne r1, #0x0C @ Baudrate 9600 , div13
-#endif
- str r1, [r0]
-
- ldr r0, =CONFIG_ASPEED_COM_IER
- mov r1, #0x00
- str r1, [r0]
-
- ldr r0, =CONFIG_ASPEED_COM_LCR
- mov r1, #0x03
- str r1, [r0]
-
- ldr r0, =CONFIG_ASPEED_COM_IIR
- mov r1, #0x07
- str r1, [r0]
-
ldr r0, =CONFIG_ASPEED_COM
mov r1, #0x0D @ '\r'
str r1, [r0]
--
2.7.1
More information about the openbmc
mailing list