]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: uniphier: fix glitch signal problem for low-level debug
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 21 Sep 2015 15:27:36 +0000 (00:27 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 24 Sep 2015 15:27:53 +0000 (00:27 +0900)
Currently, IECTRL is enabled after pin-mux settings for the low-level
debugging for PH1-LD4 and PH1-sLD8.  While IECTRL is disabled, input
signals are pulled-down, i.e. glitch signal (Low to High transition)
problem occurs if pin-mux is set up first.  As a result, one invalid
character is input to the UART block and the auto-boot counting is
terminated immediately.

The correct initialization procedure is:
 [1] Enable IECTRL (if IECTRL exists for the pins)
 [2] Set up pin-muxing
 [3] Deassert the reset of the hardware block

Currently, the low-level debugging is working for PH1-sLD3 and
PH1-Pro4, but just in case, follow the sequence for all the SoCs.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
arch/arm/mach-uniphier/ph1-ld4/lowlevel_debug.S
arch/arm/mach-uniphier/ph1-pro4/lowlevel_debug.S
arch/arm/mach-uniphier/ph1-sld3/lowlevel_debug.S
arch/arm/mach-uniphier/ph1-sld8/lowlevel_debug.S

index fd393dcfb3cda0dea56ca99650c6dc31ac866827..c0f14e08b188ee7682b6a7eab51e7efc2ae1bf1a 100644 (file)
 #include <mach/debug-uart.S>
 
 ENTRY(setup_lowlevel_debug)
-               init_debug_uart r0, r1, r2
+               ldr             r0, =SG_IECTRL
+               ldr             r1, [r0]
+               orr             r1, r1, #1
+               str             r1, [r0]
 
                /* UART Port 0 */
                sg_set_pinsel   85, 1, 8, 4, r0, r1
                sg_set_pinsel   88, 1, 8, 4, r0, r1
 
-               ldr             r0, =SG_IECTRL
-               ldr             r1, [r0]
-               orr             r1, r1, #1
-               str             r1, [r0]
+               init_debug_uart r0, r1, r2
 
                mov             pc, lr
 ENDPROC(setup_lowlevel_debug)
index ce5dd4b15d51307bcd2c1d356099f2af2ffed7a2..56f385104397a27782c511b625111206a1f4e9ef 100644 (file)
 #include <mach/debug-uart.S>
 
 ENTRY(setup_lowlevel_debug)
-               ldr             r0, =SC_CLKCTRL
-               ldr             r1, [r0]
-               orr             r1, r1, #SC_CLKCTRL_CEN_PERI
-               str             r1, [r0]
-
-               init_debug_uart r0, r1, r2
-
                /* UART Port 0 */
                sg_set_pinsel   127, 0, 4, 8, r0, r1
                sg_set_pinsel   128, 0, 4, 8, r0, r1
@@ -30,5 +23,12 @@ ENTRY(setup_lowlevel_debug)
                mov             r1, #1
                str             r1, [r0]
 
+               ldr             r0, =SC_CLKCTRL
+               ldr             r1, [r0]
+               orr             r1, r1, #SC_CLKCTRL_CEN_PERI
+               str             r1, [r0]
+
+               init_debug_uart r0, r1, r2
+
                mov             pc, lr
 ENDPROC(setup_lowlevel_debug)
index ee2eae6bf7e809d275cd2ef25f7d89fc3577c022..f4eccb46123da2d45cda701524cdc0efc3efdb3a 100644 (file)
@@ -15,6 +15,9 @@
 #include <mach/debug-uart.S>
 
 ENTRY(setup_lowlevel_debug)
+               sg_set_pinsel   63, 0, 4, 4, r0, r1
+               sg_set_pinsel   64, 1, 4, 4, r0, r1
+
                ldr             r0, =BCSCR5
                ldr             r1, =0x24440000
                str             r1, [r0]
@@ -26,8 +29,5 @@ ENTRY(setup_lowlevel_debug)
 
                init_debug_uart r0, r1, r2
 
-               sg_set_pinsel   63, 0, 4, 4, r0, r1
-               sg_set_pinsel   64, 1, 4, 4, r0, r1
-
                mov             pc, lr
 ENDPROC(setup_lowlevel_debug)
index 3ada4c99481cbc7be2406edaedb51a5712153d19..571ce60698b93252fe4fcea145c895875f222d21 100644 (file)
 #include <mach/debug-uart.S>
 
 ENTRY(setup_lowlevel_debug)
-               init_debug_uart r0, r1, r2
+               ldr             r0, =SG_IECTRL
+               ldr             r1, [r0]
+               orr             r1, r1, #1
+               str             r1, [r0]
 
                /* UART Port 0 */
                sg_set_pinsel   70, 3, 8, 4, r0, r1
                sg_set_pinsel   71, 3, 8, 4, r0, r1
 
-               ldr             r0, =SG_IECTRL
-               ldr             r1, [r0]
-               orr             r1, r1, #1
-               str             r1, [r0]
+               init_debug_uart r0, r1, r2
 
                mov             pc, lr
 ENDPROC(setup_lowlevel_debug)