mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/6] MIPS: XBurst: use mach-specific debug_ll setup
Date: Sat,  1 Jun 2013 11:52:44 +0400	[thread overview]
Message-ID: <1370073169-29009-2-git-send-email-antonynpavlov@gmail.com> (raw)
In-Reply-To: <1370073169-29009-1-git-send-email-antonynpavlov@gmail.com>

Ingenic JZ4755 SoC (JZ4750D family) has three UARTs.
So we can give to the user choose which one of them
to use for low level debug (debug_ll) output.

Also this commit adapts the only JZ4755 board
(Ritmix RZX50) for using the new debug_ll port
selection.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/mips/boards/rzx50/include/board/debug_ll.h    |    5 +--
 arch/mips/mach-xburst/Kconfig                      |   18 ++++++++++
 .../mach-xburst/include/mach/debug_ll_jz4750d.h    |   37 ++++++++++++++++++++
 arch/mips/mach-xburst/include/mach/jz4750d_regs.h  |    2 ++
 4 files changed, 58 insertions(+), 4 deletions(-)
 create mode 100644 arch/mips/mach-xburst/include/mach/debug_ll_jz4750d.h

diff --git a/arch/mips/boards/rzx50/include/board/debug_ll.h b/arch/mips/boards/rzx50/include/board/debug_ll.h
index 3d183b0..7ae0e2a 100644
--- a/arch/mips/boards/rzx50/include/board/debug_ll.h
+++ b/arch/mips/boards/rzx50/include/board/debug_ll.h
@@ -18,9 +18,6 @@
 #ifndef __INCLUDE_RZX50_BOARD_DEBUG_LL_H__
 #define __INCLUDE_RZX50_BOARD_DEBUG_LL_H__
 
-#include <mach/jz4750d_regs.h>
-
-#define DEBUG_LL_UART_ADDR	UART1_BASE
-#define DEBUG_LL_UART_SHIFT	2
+#include <mach/debug_ll_jz4750d.h>
 
 #endif  /* __INCLUDE_RZX50_BOARD_DEBUG_LL_H__ */
diff --git a/arch/mips/mach-xburst/Kconfig b/arch/mips/mach-xburst/Kconfig
index c72b741..e6413d5 100644
--- a/arch/mips/mach-xburst/Kconfig
+++ b/arch/mips/mach-xburst/Kconfig
@@ -17,6 +17,24 @@ config BOARD_RZX50
 
 endchoice
 
+if DEBUG_LL
+if CPU_JZ4755
+choice
+	prompt "DEBUG_LL port"
+
+config JZ4750D_DEBUG_LL_UART0
+	bool "UART0"
+
+config JZ4750D_DEBUG_LL_UART1
+	bool "UART1"
+
+config JZ4750D_DEBUG_LL_UART2
+	bool "UART2"
+
+endchoice
+endif # CPU_JZ4755
+endif # DEBUG_LL
+
 source arch/mips/boards/rzx50/Kconfig
 
 endif
diff --git a/arch/mips/mach-xburst/include/mach/debug_ll_jz4750d.h b/arch/mips/mach-xburst/include/mach/debug_ll_jz4750d.h
new file mode 100644
index 0000000..7bf66b1
--- /dev/null
+++ b/arch/mips/mach-xburst/include/mach/debug_ll_jz4750d.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2013 Antony Pavlov <antonynpavlov@gmail.com>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __INCLUDE_DEBUG_LL_JZ4750D_H__
+#define __INCLUDE_DEBUG_LL_JZ4750D_H__
+
+#include <mach/jz4750d_regs.h>
+
+#ifdef CONFIG_JZ4750D_DEBUG_LL_UART0
+#define DEBUG_LL_UART_ADDR	UART0_BASE
+#endif
+
+#ifdef CONFIG_JZ4750D_DEBUG_LL_UART1
+#define DEBUG_LL_UART_ADDR	UART1_BASE
+#endif
+
+#ifdef CONFIG_JZ4750D_DEBUG_LL_UART2
+#define DEBUG_LL_UART_ADDR	UART2_BASE
+#endif
+
+#define DEBUG_LL_UART_SHIFT	2
+
+#endif /* __INCLUDE_DEBUG_LL_JZ4750D_H__ */
diff --git a/arch/mips/mach-xburst/include/mach/jz4750d_regs.h b/arch/mips/mach-xburst/include/mach/jz4750d_regs.h
index eafdd2f..7a3daad 100644
--- a/arch/mips/mach-xburst/include/mach/jz4750d_regs.h
+++ b/arch/mips/mach-xburst/include/mach/jz4750d_regs.h
@@ -16,7 +16,9 @@
 #define TCU_BASE        0xb0002000
 #define WDT_BASE        0xb0002000
 #define RTC_BASE        0xb0003000
+#define UART0_BASE      0xb0030000
 #define UART1_BASE      0xb0031000
+#define UART2_BASE      0xb0032000
 
 /*************************************************************************
  * TCU (Timer Counter Unit)
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-06-01  7:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-01  7:52 [PATCH 0/6] MIPS: rework ns16550 debug_ll Antony Pavlov
2013-06-01  7:52 ` Antony Pavlov [this message]
2013-06-01  7:52 ` [PATCH 2/6] MIPS: pbl: add low-level debug asm macros for ns16550 Antony Pavlov
2013-06-01  7:52 ` [PATCH 3/6] MIPS: rzx50: pbl: use debug_ll Antony Pavlov
2013-06-03  7:31   ` Sascha Hauer
2013-06-03  7:46     ` antonynpavlov
2013-06-01  7:52 ` [PATCH 4/6] MIPS: rzx50_defconfig: use UART1 for low-level debug Antony Pavlov
2013-06-01  7:52 ` [PATCH 5/6] MIPS: malta: adapt for new debug_ll Antony Pavlov
2013-06-01  7:52 ` [PATCH 6/6] MIPS: unificate ns16550 debug_ll support code Antony Pavlov
2013-06-01  8:07   ` antonynpavlov
2013-06-02  9:25     ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370073169-29009-2-git-send-email-antonynpavlov@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox