]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: imx: add low-level debug for Vybrid
authorShawn Guo <shawn.guo@freescale.com>
Sun, 12 May 2013 09:22:17 +0000 (17:22 +0800)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:53:40 +0000 (09:53 +0800)
Add low-level debug support for Vybrid, so that earlyprintk can be
enabled for debugging early boot issue.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
arch/arm/Kconfig.debug
arch/arm/include/debug/vf.S [new file with mode: 0644]
arch/arm/mach-imx/mach-vf610.c

index 29f7623553c195703e0cd1a610cb5ec4165c4ae1..f87333d350338956bda2354f8743f65d540a571b 100644 (file)
@@ -316,6 +316,13 @@ choice
                  Say Y here if you want kernel low-level debugging support
                  on MVEBU based platforms.
 
+       config DEBUG_VF_UART
+               bool "Vybrid UART"
+               depends on SOC_VF610
+               help
+                 Say Y here if you want kernel low-level debugging support
+                 on Vybrid based platforms.
+
        config DEBUG_NOMADIK_UART
                bool "Kernel low-level debugging messages via NOMADIK UART"
                depends on ARCH_NOMADIK
@@ -655,6 +662,7 @@ config DEBUG_LL_INCLUDE
        default "debug/ux500.S" if DEBUG_UX500_UART
        default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
                DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1
+       default "debug/vf.S" if DEBUG_VF_UART
        default "debug/vt8500.S" if DEBUG_VT8500_UART0
        default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1
        default "mach/debug-macro.S"
diff --git a/arch/arm/include/debug/vf.S b/arch/arm/include/debug/vf.S
new file mode 100644 (file)
index 0000000..3791e5e
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+       .macro  addruart, rp, rv, tmp
+       ldr     \rp, =0x40028000        @ physical
+       ldr     \rv, =0xfe028000        @ virtual
+       .endm
+
+       .macro  senduart, rd, rx
+       strb    \rd, [\rx, #0x7]        @ Data Register
+       .endm
+
+       .macro  busyuart, rd, rx
+1001:  ldrb    \rd, [\rx, #0x4]        @ Status Register 1
+       tst     \rd, #1 << 6            @ TC
+       beq     1001b                   @ wait until transmit done
+       .endm
+
+       .macro  waituart,rd,rx
+       .endm
index 816991deb9b86ef9ba61139cf2ae17257f9b89a5..bac37cbb933c6a1c237adfdec93f6fc163d3f8c1 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/irqchip.h>
 #include <linux/clk-provider.h>
 #include <asm/mach/arch.h>
+#include <asm/mach/map.h>
 #include <asm/hardware/cache-l2x0.h>
 
 #include "common.h"
@@ -40,6 +41,7 @@ static const char *vf610_dt_compat[] __initdata = {
 };
 
 DT_MACHINE_START(VYBRID_VF610, "Freescale Vybrid VF610 (Device Tree)")
+       .map_io         = debug_ll_io_init,
        .init_irq       = vf610_init_irq,
        .init_time      = vf610_init_time,
        .init_machine   = vf610_init_machine,