[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH V2 3/3] xen/arm: Add SCIFA UART support for early printk



From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>

Add support for Renesas "Stout" development board based on
R-Car H2 SoC which has SCIFA compatible UART.

Actually existing SCIF UART support (debug-scif.inc) and
newly added SCIFA UART support (debug-scifa.inc) differ only
in registers offsets.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>

---
    Changes in v2:
        - Move clarification regarding Lager board to separate patch
        - Drop changes in early-printk.txt and Rules.mk, earlyprink
          usage for Stout board should be documented on a Xen wiki
---
 xen/arch/arm/arm32/debug-scifa.inc | 51 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 xen/arch/arm/arm32/debug-scifa.inc

diff --git a/xen/arch/arm/arm32/debug-scifa.inc 
b/xen/arch/arm/arm32/debug-scifa.inc
new file mode 100644
index 0000000..b5e60db
--- /dev/null
+++ b/xen/arch/arm/arm32/debug-scifa.inc
@@ -0,0 +1,51 @@
+/*
+ * xen/arch/arm/arm32/debug-scifa.inc
+ *
+ * SCIFA specific debug code
+ *
+ * Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
+ * Copyright (C) 2018 EPAM Systems Inc.
+ *
+ * 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 <asm/scif-uart.h>
+
+/*
+ * SCIFA 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:
+        ldrh   \rc, [\rb, #SCIFA_SCASSR]   /* <- SCASSR (status register) */
+        tst    \rc, #SCASSR_TDFE           /* Check TDFE bit */
+        beq    1b                          /* Wait for the UART to be ready */
+.endm
+
+/*
+ * SCIFA 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
+        strb   \rt, [\rb, #SCIFA_SCAFTDR]                  /* -> SCAFTDR (data 
register) */
+        ldrh   \rt, [\rb, #SCIFA_SCASSR]                   /* <- SCASSR 
(status register) */
+        and    \rt, \rt, #(~(SCASSR_TEND | SCASSR_TDFE))   /* Clear TEND and 
TDFE bits */
+        strh   \rt, [\rb, #SCIFA_SCASSR]                   /* -> SCASSR 
(status register) */
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.