From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: Ian Campbell <ian.campbell@citrix.com>,
Anup Patel <anup.patel@linaro.org>,
stefano.stabellini@eu.citrix.com, julien.grall@linaro.org,
tim@xen.org, pranavkumar@linaro.org
Subject: [PATCH v2 01/15] xen: arm64: Add 8250 earlyprintk support
Date: Fri, 22 Nov 2013 16:24:20 +0000 [thread overview]
Message-ID: <1385137474-31245-1-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <foo>
From: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
Extracted from "Basic Platform support for APM X-Gene Storm."
Signed-off-by: Anup Patel <anup.patel@linaro.org>
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
Reworked into generic 8250 driver, use EARLY_UART_REG_SHIFT.
While there observe a missing shift in the arm32 version (UART_THR is zero so
it doesn't really matter). Changed for consistency.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Drop unused early_uart_init macro
---
xen/arch/arm/Rules.mk | 6 +++++
xen/arch/arm/arm64/debug-8250.inc | 45 +++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+)
create mode 100644 xen/arch/arm/arm64/debug-8250.inc
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index c27c2eb..aaa203e 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -82,6 +82,12 @@ EARLY_PRINTK_INC := 8250
EARLY_UART_BASE_ADDRESS := 0xF0406B00
EARLY_UART_REG_SHIFT := 2
endif
+ifeq ($(CONFIG_EARLY_PRINTK), xgene-storm)
+EARLY_PRINTK_INC := 8250
+EARLY_PRINTK_BAUD := 115200
+EARLY_UART_BASE_ADDRESS := 0x1c020000
+EARLY_UART_REG_SHIFT := 2
+endif
ifneq ($(EARLY_PRINTK_INC),)
EARLY_PRINTK := y
diff --git a/xen/arch/arm/arm64/debug-8250.inc b/xen/arch/arm/arm64/debug-8250.inc
new file mode 100644
index 0000000..158549a
--- /dev/null
+++ b/xen/arch/arm/arm64/debug-8250.inc
@@ -0,0 +1,45 @@
+/*
+ * xen/arch/arm/arm64/debug-8250.inc
+ *
+ * 8250 specific debug code
+ *
+ * Copyright (c) 2013 Applied Micro.
+ *
+ * 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>
+
+/* UART wait UART to be ready to transmit
+ * xb: register which contains the UART base address
+ * c: scratch register */
+.macro early_uart_ready xb c
+1:
+ ldrb w\c, [\xb, #UART_LSR << EARLY_UART_REG_SHIFT]
+ and w\c, w\c, #UART_LSR_THRE
+ cmp w\c, #UART_LSR_THRE
+ b.ne 1b
+.endm
+
+/* UART transmit character
+ * xb: register which contains the UART base address
+ * wt: register which contains the character to transmit */
+.macro early_uart_transmit xb wt
+ /* UART_THR transmit holding */
+ strb \wt, [\xb, #UART_THR << EARLY_UART_REG_SHIFT]
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
--
1.7.10.4
next parent reply other threads:[~2013-11-22 16:24 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <foo>
2013-11-22 16:24 ` Ian Campbell [this message]
2013-11-22 16:27 ` [PATCH 00/15] xen: arm initial support for xgene arm64 platform Ian Campbell
2013-11-22 17:02 ` George Dunlap
2013-11-22 17:09 ` Ian Campbell
2013-11-29 10:30 ` Ian Campbell
2013-11-22 16:29 ` [PATCH v2 01/15] xen: arm64: Add 8250 earlyprintk support Julien Grall
2013-11-22 16:24 ` [PATCH v2 02/15] xen: arm64: Add Basic Platform support for APM X-Gene Storm Ian Campbell
2013-11-22 16:35 ` Julien Grall
2013-11-22 16:43 ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 03/15] xen: arm64: Add APM implementor id to processor implementers Ian Campbell
2013-11-22 16:24 ` [PATCH v2 04/15] xen: arm: add a quirk to handle platforms with unusual GIC layout Ian Campbell
2013-11-22 16:46 ` Julien Grall
2013-11-22 17:03 ` Ian Campbell
2013-11-22 17:10 ` Julien Grall
2013-11-22 17:16 ` Ian Campbell
2013-11-22 16:46 ` George Dunlap
2013-11-22 16:24 ` [PATCH v2 05/15] xen: arm: allow platform code to select dom0 event channel irq Ian Campbell
2013-11-22 16:48 ` George Dunlap
2013-11-22 17:01 ` Julien Grall
2013-11-22 16:24 ` [PATCH v2 06/15] xen: arm64: Map xgene PCI memory regions and interrupts to dom0 Ian Campbell
2013-11-22 16:50 ` George Dunlap
2013-11-22 16:59 ` Julien Grall
2013-11-22 17:13 ` Ian Campbell
2013-11-22 17:17 ` Julien Grall
2013-11-22 16:24 ` [PATCH v2 07/15] xen: arm: include ns16550 driver on arm64 too Ian Campbell
2013-11-22 16:24 ` [PATCH v2 08/15] xen: arm: early logging of command line Ian Campbell
2013-11-22 17:04 ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 09/15] xen: arm: Handle cpus nodes with #address-cells > 1 Ian Campbell
2013-11-22 16:59 ` George Dunlap
2013-11-22 17:22 ` Julien Grall
2013-11-22 17:50 ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 10/15] xen: arm: Make register bit definitions unsigned Ian Campbell
2013-11-22 17:23 ` Julien Grall
2013-11-22 16:24 ` [PATCH v2 11/15] xen: arm: explicitly map 64 bit release address Ian Campbell
2013-11-22 16:24 ` [PATCH v2 12/15] xen: arm: enable synchronous console while starting secondary CPUs Ian Campbell
2013-11-22 17:36 ` Julien Grall
2013-11-22 17:49 ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 13/15] xen: arm: Add debug keyhandler to dump the physical GIC state Ian Campbell
2013-11-22 16:37 ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 14/15] xen: arm: improve early memory map readability Ian Campbell
2013-11-22 16:24 ` [PATCH v2 15/15] xen: arm: handle 40-bit addresses in the p2m Ian Campbell
2013-11-28 17:41 ` Stefano Stabellini
2013-11-28 17:45 ` Ian Campbell
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=1385137474-31245-1-git-send-email-ian.campbell@citrix.com \
--to=ian.campbell@citrix.com \
--cc=anup.patel@linaro.org \
--cc=julien.grall@linaro.org \
--cc=pranavkumar@linaro.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.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).