From: Chen Baozi <baozich@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>,
Julien Grall <julien.grall@linaro.org>
Cc: Chen Baozi <baozich@gmail.com>, xen-devel@lists.xen.org
Subject: [PATCH 2/5] xen/arm: add OMAP5432 UART support for early_printk
Date: Mon, 5 Aug 2013 19:49:03 +0800 [thread overview]
Message-ID: <1375703346-3801-4-git-send-email-baozich@gmail.com> (raw)
In-Reply-To: <1375703346-3801-1-git-send-email-baozich@gmail.com>
Signed-off-by: Chen Baozi <baozich@gmail.com>
---
docs/misc/arm/early-printk.txt | 1 +
xen/arch/arm/Rules.mk | 4 ++++
xen/arch/arm/arm32/debug-8250.inc | 41 +++++++++++++++++++++++++++++++++++++++
xen/include/xen/8250-uart.h | 6 ++++++
4 files changed, 52 insertions(+)
create mode 100644 xen/arch/arm/arm32/debug-8250.inc
diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index fbc3208..874488f 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -13,6 +13,7 @@ where mach is the name of the machine:
- exynos5250: printk with the second UART
- midway: printk with the pl011 on Calxeda Midway processors
- fastmodel: printk on ARM Fastmodel software emulators
+ - omap5432: printk with UART3 on TI OMAP5432 processors
The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk,
see there when adding support for new machines.
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index a18e7fd..346c824 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -64,6 +64,10 @@ EARLY_PRINTK_INC := pl011
EARLY_PRINTK_BAUD := 115200
EARLY_UART_BASE_ADDRESS := 0xfff36000
endif
+ifeq ($(CONFIG_EARLY_PRINTK), omap5432)
+EARLY_PRINTK_INC := 8250
+EARLY_UART_BASE_ADDRESS := 0x48020000
+endif
ifneq ($(EARLY_PRINTK_INC),)
EARLY_PRINTK := y
diff --git a/xen/arch/arm/arm32/debug-8250.inc b/xen/arch/arm/arm32/debug-8250.inc
new file mode 100644
index 0000000..955d90c
--- /dev/null
+++ b/xen/arch/arm/arm32/debug-8250.inc
@@ -0,0 +1,41 @@
+/*
+ * xen/arch/arm/arm32/debug-8250.inc
+ *
+ * 8250 specific debug code
+ *
+ * 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.
+ */
+
+#include <xen/8250-uart.h>
+
+/* OMAP UART wait UART to be ready to transmit
+ * rb: register which contains the UART base address
+ * rc: scratch register */
+.macro early_uart_ready rb rc
+1:
+ ldr \rc, [\rb, #(UART_LSR << REG_SHIFT)] /* Read LSR */
+ tst \rc, #UART_LSR_THRE /* Check Xmit holding register flag */
+ beq 1b /* Wait for the UART to be ready */
+.endm
+
+/* OMAP UART transmit character
+ * rb: register which contains the UART base address
+ * rt: register which contains the character to transmit */
+.macro early_uart_transmit rb rt
+ str \rt, [\rb, #UART_THR] /* Write Transmit buffer */
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/8250-uart.h b/xen/include/xen/8250-uart.h
index 7287364..0e6c6bd 100644
--- a/xen/include/xen/8250-uart.h
+++ b/xen/include/xen/8250-uart.h
@@ -22,6 +22,12 @@
#ifndef __XEN_8250_UART_H__
#define __XEN_8250_UART_H__
+#ifdef CONFIG_ARM
+#define REG_SHIFT 2
+#else
+#define REG_SHIFT 0
+#endif
+
/* Register offsets */
#define UART_RBR 0x00 /* receive buffer */
#define UART_THR 0x00 /* transmit holding */
--
1.8.1.4
next prev parent reply other threads:[~2013-08-05 11:49 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-05 11:49 [PATCH 0/5] Add UART support and arch timer initialization for OMAP5 Chen Baozi
2013-08-05 11:49 ` Chen Baozi
2013-08-05 11:49 ` [PATCH 1/5] xen: rename ns16550-uart.h to 8250-uart.h and fix some typos Chen Baozi
2013-08-05 11:49 ` Chen Baozi [this message]
2013-08-06 21:50 ` [PATCH 2/5] xen/arm: add OMAP5432 UART support for early_printk Julien Grall
2013-08-07 3:22 ` Chen Baozi
2013-08-05 11:49 ` [PATCH 3/5] xen/arm: Add the new OMAP UART driver Chen Baozi
2013-08-06 19:14 ` Julien Grall
2013-08-07 3:14 ` Chen Baozi
2013-08-07 8:46 ` Ian Campbell
2013-08-07 11:08 ` Chen Baozi
2013-08-05 11:49 ` [PATCH 4/5] xen/arm: Introduce platform recognition codes for the OMAP5 Chen Baozi
2013-08-06 22:00 ` Julien Grall
2013-08-07 3:24 ` Chen Baozi
2013-08-07 11:21 ` Julien Grall
2013-08-05 11:49 ` [PATCH 5/5] xen/arm: Add OMAP5 architected timer initialization codes Chen Baozi
2013-08-06 22:14 ` Julien Grall
2013-08-07 3:28 ` Chen Baozi
2013-08-07 10:25 ` Andrii Anisov
2013-08-07 10:32 ` Andrii Anisov
2013-08-07 11:37 ` Julien Grall
2013-08-07 11:58 ` Andrii Anisov
2013-08-07 12:04 ` Andrii Anisov
-- strict thread matches above, loose matches on Subject: below --
2013-08-07 12:31 [PATCHv2 0/5] Add UART support and arch timer initialization for OMAP5 Chen Baozi
2013-08-07 12:31 ` [PATCH 2/5] xen/arm: add OMAP5432 UART support for early_printk Chen Baozi
2013-08-07 12:40 ` Chen Baozi
2013-08-07 12:44 ` Ian Campbell
2013-08-07 12:46 ` Chen Baozi
2013-08-07 12:49 ` Julien Grall
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=1375703346-3801-4-git-send-email-baozich@gmail.com \
--to=baozich@gmail.com \
--cc=Ian.Campbell@citrix.com \
--cc=julien.grall@linaro.org \
--cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).