Signed-off-by: Ralf Ramsauer <[email protected]>
---
 .../include/mach-sun7i/mach/{uart.h => debug.h}    |  8 ++++--
 .../include/mach-tegra124/mach/{uart.h => debug.h} |  9 ++++--
 .../include/mach-vexpress/mach/{uart.h => debug.h} |  4 ++-
 inmates/lib/arm/printk.c                           | 33 ++++++++++++++++++----
 .../mach/uart.h => mach-amd-seattle/mach/debug.h}  |  4 ++-
 .../uart.h => mach-foundation-v8/mach/debug.h}     |  4 ++-
 .../include/mach-hi6220/mach/{uart.h => debug.h}   |  4 ++-
 7 files changed, 50 insertions(+), 16 deletions(-)
 rename inmates/lib/arm/include/mach-sun7i/mach/{uart.h => debug.h} (71%)
 rename inmates/lib/arm/include/mach-tegra124/mach/{uart.h => debug.h} (68%)
 rename inmates/lib/arm/include/mach-vexpress/mach/{uart.h => debug.h} (84%)
 rename inmates/lib/arm64/include/{mach-foundation-v8/mach/uart.h => 
mach-amd-seattle/mach/debug.h} (84%)
 rename inmates/lib/arm64/include/{mach-amd-seattle/mach/uart.h => 
mach-foundation-v8/mach/debug.h} (84%)
 rename inmates/lib/arm64/include/mach-hi6220/mach/{uart.h => debug.h} (81%)

diff --git a/inmates/lib/arm/include/mach-sun7i/mach/uart.h 
b/inmates/lib/arm/include/mach-sun7i/mach/debug.h
similarity index 71%
rename from inmates/lib/arm/include/mach-sun7i/mach/uart.h
rename to inmates/lib/arm/include/mach-sun7i/mach/debug.h
index a1b2f472fa..c3970bc6a2 100644
--- a/inmates/lib/arm/include/mach-sun7i/mach/uart.h
+++ b/inmates/lib/arm/include/mach-sun7i/mach/debug.h
@@ -10,6 +10,8 @@
  * the COPYING file in the top-level directory.
  */
 
-#define UART_BASE      ((void *)0x01c29c00)
-#define UART_CLOCK_REG ((void *)0x01c2006c)
-#define UART_GATE_NR   23
+#define DBG_TYPE       "8250"
+
+#define DBG_BASE       0x01c29c00
+#define DBG_CLOCK_REG  0x01c2006c
+#define DBG_GATE_NR    23
diff --git a/inmates/lib/arm/include/mach-tegra124/mach/uart.h 
b/inmates/lib/arm/include/mach-tegra124/mach/debug.h
similarity index 68%
rename from inmates/lib/arm/include/mach-tegra124/mach/uart.h
rename to inmates/lib/arm/include/mach-tegra124/mach/debug.h
index 75aaa68377..5b0d44d6bf 100644
--- a/inmates/lib/arm/include/mach-tegra124/mach/uart.h
+++ b/inmates/lib/arm/include/mach-tegra124/mach/debug.h
@@ -10,9 +10,12 @@
  * the COPYING file in the top-level directory.
  */
 
-#define UART_BASE      ((void *)0x70006300)
+#define DBG_TYPE       "8250"
+
+#define DBG_BASE       0x70006300 /* UART D on tegra124, exposed to the DB9
+                                     connector of the Jetson TK1 */
 
 /* Do not enable the clock in the inmate, as enabling the clock requires access
  * to the tegra-car (Clock and Reset Controller) */
-#define UART_CLOCK_REG  ((void *)0)
-#define UART_GATE_NR    0
+#define DBG_CLOCK_REG  0
+#define DBG_GATE_NR    0
diff --git a/inmates/lib/arm/include/mach-vexpress/mach/uart.h 
b/inmates/lib/arm/include/mach-vexpress/mach/debug.h
similarity index 84%
rename from inmates/lib/arm/include/mach-vexpress/mach/uart.h
rename to inmates/lib/arm/include/mach-vexpress/mach/debug.h
index 8b58cab8c3..0586750502 100644
--- a/inmates/lib/arm/include/mach-vexpress/mach/uart.h
+++ b/inmates/lib/arm/include/mach-vexpress/mach/debug.h
@@ -10,4 +10,6 @@
  * the COPYING file in the top-level directory.
  */
 
-#define UART_BASE      ((void *)0x1c090000)
+#define DBG_TYPE       "PL011"
+
+#define DBG_BASE       0x1c090000
diff --git a/inmates/lib/arm/printk.c b/inmates/lib/arm/printk.c
index 9fa5bf25fa..adf3cac16f 100644
--- a/inmates/lib/arm/printk.c
+++ b/inmates/lib/arm/printk.c
@@ -13,7 +13,27 @@
 #include <inmate.h>
 #include <stdarg.h>
 #include <uart.h>
-#include <mach/uart.h>
+#include <mach/debug.h>
+
+#ifndef DBG_TYPE
+#define DBG_TYPE "none"
+#endif
+
+#ifndef DBG_BASE
+#define DBG_BASE 0
+#endif
+
+#ifndef DBG_DIVIDER
+#define DBG_DIVIDER 0
+#endif
+
+#ifndef DBG_CLOCK_REG
+#define DBG_CLOCK_REG 0
+#endif
+
+#ifndef DBG_GATE_NR
+#define DBG_GATE_NR 0
+#endif
 
 static struct uart_chip *chip = NULL;
 
@@ -41,7 +61,7 @@ static void dbg_init(void)
        char buf[32];
        const char *type;
 
-       type = cmdline_parse_str("dbg-type", buf, sizeof(buf), "none");
+       type = cmdline_parse_str("dbg-type", buf, sizeof(buf), DBG_TYPE);
        if (!strncmp(type, "8250", 4))
                chip = &uart_8250_ops;
        else if (!strncmp(type, "PL011", 5))
@@ -50,11 +70,12 @@ static void dbg_init(void)
        if (!chip)
                return;
 
-       chip->base = (void *)(unsigned long) cmdline_parse_int("dbg-base", 0);
-       chip->divider = cmdline_parse_int("dbg-divider", 0);
-       chip->gate_nr = cmdline_parse_int("dbg-gate_nr", 0);
+       chip->base = (void *)(unsigned long)
+               cmdline_parse_int("dbg-base", DBG_BASE);
+       chip->divider = cmdline_parse_int("dbg-divider", DBG_DIVIDER);
+       chip->gate_nr = cmdline_parse_int("dbg-gate_nr", DBG_GATE_NR);
        chip->clock_reg = (void *)(unsigned long)
-               cmdline_parse_int("dbg-clock_reg", 0);
+               cmdline_parse_int("dbg-clock_reg", DBG_CLOCK_REG);
 
        chip->init(chip);
 }
diff --git a/inmates/lib/arm64/include/mach-foundation-v8/mach/uart.h 
b/inmates/lib/arm64/include/mach-amd-seattle/mach/debug.h
similarity index 84%
rename from inmates/lib/arm64/include/mach-foundation-v8/mach/uart.h
rename to inmates/lib/arm64/include/mach-amd-seattle/mach/debug.h
index 5ac3f878c6..8864643080 100644
--- a/inmates/lib/arm64/include/mach-foundation-v8/mach/uart.h
+++ b/inmates/lib/arm64/include/mach-amd-seattle/mach/debug.h
@@ -10,4 +10,6 @@
  * the COPYING file in the top-level directory.
  */
 
-#define UART_BASE      ((void *)0x1c090000)
+#define DBG_TYPE       "PL011"
+
+#define DBG_BASE       0xe1010000
diff --git a/inmates/lib/arm64/include/mach-amd-seattle/mach/uart.h 
b/inmates/lib/arm64/include/mach-foundation-v8/mach/debug.h
similarity index 84%
rename from inmates/lib/arm64/include/mach-amd-seattle/mach/uart.h
rename to inmates/lib/arm64/include/mach-foundation-v8/mach/debug.h
index 512b6cb37e..18e47acc5d 100644
--- a/inmates/lib/arm64/include/mach-amd-seattle/mach/uart.h
+++ b/inmates/lib/arm64/include/mach-foundation-v8/mach/debug.h
@@ -10,4 +10,6 @@
  * the COPYING file in the top-level directory.
  */
 
-#define UART_BASE      ((void *)0xe1010000)
+#define DBG_TYPE       "PL011"
+
+#define DBG_BASE       0x1c090000
diff --git a/inmates/lib/arm64/include/mach-hi6220/mach/uart.h 
b/inmates/lib/arm64/include/mach-hi6220/mach/debug.h
similarity index 81%
rename from inmates/lib/arm64/include/mach-hi6220/mach/uart.h
rename to inmates/lib/arm64/include/mach-hi6220/mach/debug.h
index 4748168960..2e6d7ca9ce 100644
--- a/inmates/lib/arm64/include/mach-hi6220/mach/uart.h
+++ b/inmates/lib/arm64/include/mach-hi6220/mach/debug.h
@@ -10,4 +10,6 @@
  * the COPYING file in the top-level directory.
  */
 
-#define UART_BASE      ((void *)0xf7113000)
+#define DBG_TYPE       "PL011"
+
+#define DBG_BASE       0xf7113000
-- 
2.11.0.rc2

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to