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 5/9] MIPS: xburst: debug_ll: rework common code, add JZ4780 support
Date: Wed, 10 Sep 2014 11:42:22 +0400	[thread overview]
Message-ID: <1410334946-12922-6-git-send-email-antonynpavlov@gmail.com> (raw)
In-Reply-To: <1410334946-12922-1-git-send-email-antonynpavlov@gmail.com>

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/mips/mach-xburst/Kconfig                      | 19 +++++---
 .../mach-xburst/include/mach/debug_ll_jz4750d.h    |  6 +--
 .../mach-xburst/include/mach/debug_ll_jz4780.h     | 51 ++++++++++++++++++++++
 arch/mips/mach-xburst/include/mach/jz4780.h        | 30 +++++++++++++
 4 files changed, 98 insertions(+), 8 deletions(-)

diff --git a/arch/mips/mach-xburst/Kconfig b/arch/mips/mach-xburst/Kconfig
index 4d57015..e3db61e 100644
--- a/arch/mips/mach-xburst/Kconfig
+++ b/arch/mips/mach-xburst/Kconfig
@@ -27,21 +27,30 @@ config BOARD_RZX50
 endchoice
 
 if DEBUG_LL
-if CPU_JZ4755
 choice
 	prompt "DEBUG_LL port"
 
-config JZ4750D_DEBUG_LL_UART0
+config JZ47XX_DEBUG_LL_UART0
+	depends on CPU_JZ4755 || CPU_JZ4780
 	bool "UART0"
 
-config JZ4750D_DEBUG_LL_UART1
+config JZ47XX_DEBUG_LL_UART1
+	depends on CPU_JZ4755 || CPU_JZ4780
 	bool "UART1"
 
-config JZ4750D_DEBUG_LL_UART2
+config JZ47XX_DEBUG_LL_UART2
+	depends on CPU_JZ4755 || CPU_JZ4780
 	bool "UART2"
 
+config JZ47XX_DEBUG_LL_UART3
+	depends on CPU_JZ4780
+	bool "UART3"
+
+config JZ47XX_DEBUG_LL_UART4
+	depends on CPU_JZ4780
+	bool "UART4"
+
 endchoice
-endif # CPU_JZ4755
 endif # DEBUG_LL
 
 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
index 2a55dea..6d18366 100644
--- a/arch/mips/mach-xburst/include/mach/debug_ll_jz4750d.h
+++ b/arch/mips/mach-xburst/include/mach/debug_ll_jz4750d.h
@@ -20,15 +20,15 @@
 
 #include <mach/jz4750d_regs.h>
 
-#ifdef CONFIG_JZ4750D_DEBUG_LL_UART0
+#ifdef CONFIG_JZ47XX_DEBUG_LL_UART0
 #define DEBUG_LL_UART_ADDR	UART0_BASE
 #endif
 
-#ifdef CONFIG_JZ4750D_DEBUG_LL_UART1
+#ifdef CONFIG_JZ47XX_DEBUG_LL_UART1
 #define DEBUG_LL_UART_ADDR	UART1_BASE
 #endif
 
-#ifdef CONFIG_JZ4750D_DEBUG_LL_UART2
+#ifdef CONFIG_JZ47XX_DEBUG_LL_UART2
 #define DEBUG_LL_UART_ADDR	UART2_BASE
 #endif
 
diff --git a/arch/mips/mach-xburst/include/mach/debug_ll_jz4780.h b/arch/mips/mach-xburst/include/mach/debug_ll_jz4780.h
new file mode 100644
index 0000000..0bdc58c
--- /dev/null
+++ b/arch/mips/mach-xburst/include/mach/debug_ll_jz4780.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2014 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_JZ4780_H__
+#define __INCLUDE_DEBUG_LL_JZ4780_H__
+
+#include <mach/jz4780.h>
+
+#ifdef CONFIG_JZ47XX_DEBUG_LL_UART0
+#define DEBUG_LL_UART_ADDR	JZ4780_UART0_BASE
+#endif
+
+#ifdef CONFIG_JZ47XX_DEBUG_LL_UART1
+#define DEBUG_LL_UART_ADDR	JZ4780_UART1_BASE
+#endif
+
+#ifdef CONFIG_JZ47XX_DEBUG_LL_UART2
+#define DEBUG_LL_UART_ADDR	JZ4780_UART2_BASE
+#endif
+
+#ifdef CONFIG_JZ47XX_DEBUG_LL_UART3
+#define DEBUG_LL_UART_ADDR	JZ4780_UART3_BASE
+#endif
+
+#ifdef CONFIG_JZ47XX_DEBUG_LL_UART4
+#define DEBUG_LL_UART_ADDR	JZ4780_UART4_BASE
+#endif
+
+#define DEBUG_LL_UART_SHIFT	2
+
+#ifndef DEBUG_LL_UART_CLK
+#define DEBUG_LL_UART_CLK	(48000000 / 16)
+#endif
+#define DEBUG_LL_UART_BPS	CONFIG_BAUDRATE
+#define DEBUG_LL_UART_DIVISOR	(DEBUG_LL_UART_CLK / DEBUG_LL_UART_BPS)
+
+#endif /* __INCLUDE_DEBUG_LL_JZ4780_H__ */
diff --git a/arch/mips/mach-xburst/include/mach/jz4780.h b/arch/mips/mach-xburst/include/mach/jz4780.h
new file mode 100644
index 0000000..4503a93
--- /dev/null
+++ b/arch/mips/mach-xburst/include/mach/jz4780.h
@@ -0,0 +1,30 @@
+/*
+ * JZ4780 SoC definitions
+ *
+ * Copyright (c) 2013 Imagination Technologies
+ * Author: Paul Burton <paul.burton@imgtec.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * 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 __MIPS_ASM_MACH_JZ4780_JZ4780_H__
+#define __MIPS_ASM_MACH_JZ4780_JZ4780_H__
+
+/* APB bus devices */
+#define JZ4780_UART0_BASE	0xb0030000
+#define JZ4780_UART1_BASE	0xb0031000
+#define JZ4780_UART2_BASE	0xb0032000
+#define JZ4780_UART3_BASE	0xb0033000
+#define JZ4780_UART4_BASE	0xb0034000
+#define JZ4780_UARTn_BASE(n)	(JZ4780_UART0_BASE + (n * 0x1000))
+
+#endif /* __MIPS_ASM_MACH_JZ4780_JZ4780_H__ */
-- 
2.1.0


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

  parent reply	other threads:[~2014-09-10  7:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10  7:42 [PATCH 0/9] MIPS: xburst: add JZ4780 SoC and MIPS Creator CI20 board support Antony Pavlov
2014-09-10  7:42 ` [PATCH 1/9] common.h: use special IOMEM() for MIPS Antony Pavlov
2014-09-10  7:42 ` [PATCH 2/9] MIPS: dts: use physical addresses (as Linux does) Antony Pavlov
2014-09-10  7:42 ` [PATCH 3/9] MIPS: xburst: add JZ4780 SoC support Antony Pavlov
2014-09-10  7:42 ` [PATCH 4/9] MIPS: add (another) Ingenic vendor ID Antony Pavlov
2014-09-10  7:42 ` Antony Pavlov [this message]
2014-09-10  7:42 ` [PATCH 6/9] MIPS: dts: add jz4780.dtsi Antony Pavlov
2014-09-10  7:42 ` [PATCH 7/9] MIPS: add MIPS Creator CI20 board support Antony Pavlov
2014-09-10  7:42 ` [PATCH 8/9] MIPS: add img-ci20_defconfig Antony Pavlov
2014-09-10  7:42 ` [PATCH 9/9] Documentation: add MIPS Creator CI20 board mini-howto Antony Pavlov
2014-09-11  6:02 ` [PATCH 0/9] MIPS: xburst: add JZ4780 SoC and MIPS Creator CI20 board support 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=1410334946-12922-6-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