* [PATCH v3 0/3] arm: introduce basic Renesas R-Car Gen2 platform support
@ 2015-01-23 15:33 Oleksandr Tyshchenko
2015-01-23 15:33 ` [PATCH v3 1/3] xen/arm: Add R-Car Gen2 support for early printk Oleksandr Tyshchenko
` (3 more replies)
0 siblings, 4 replies; 18+ messages in thread
From: Oleksandr Tyshchenko @ 2015-01-23 15:33 UTC (permalink / raw)
To: xen-devel; +Cc: julien.grall, tim, ian.campbell, stefano.stabellini
Changes in v3:
1. Rewrite uart driver code to use start_tx/stop_tx callbacks.
2. Uncomment udelay after setup desired baudrate.
3. Call platform_get_irq() before ioremap_nocache().
Changes in v2:
1. Remove timer initialization from board file (timer shold be initialized in u-boot)
2. Coding style fixes.
3. Change ioremap_attr() to ioremap_nocache().
4. Other misc fixes.
The following patch series adds basic support needed for R-Car Gen2 boards.
Verified on Xen 4.5.0 stable on Lager board with and without early_printk.
Procedure needed to run Xen on Lager board is described on Xen wiki:
http://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions/Lager
Iurii Konovalenko (1):
xen/arm: Introduce support for Renesas R-Car Gen2 platform
Oleksandr Tyshchenko (2):
xen/arm: Add R-Car Gen2 support for early printk
xen/arm: Add new driver for R-Car Gen2 UART
config/arm32.mk | 1 +
docs/misc/arm/early-printk.txt | 1 +
xen/arch/arm/Rules.mk | 4 +
xen/arch/arm/arm32/debug-rcar2.inc | 49 +++++
xen/arch/arm/platforms/Makefile | 1 +
xen/arch/arm/platforms/shmobile.c | 71 +++++++
xen/drivers/char/Makefile | 1 +
xen/drivers/char/rcar2-uart.c | 366 +++++++++++++++++++++++++++++++++++++
xen/include/asm-arm/rcar2-uart.h | 107 +++++++++++
9 files changed, 601 insertions(+)
create mode 100644 xen/arch/arm/arm32/debug-rcar2.inc
create mode 100644 xen/arch/arm/platforms/shmobile.c
create mode 100644 xen/drivers/char/rcar2-uart.c
create mode 100644 xen/include/asm-arm/rcar2-uart.h
--
1.9.1
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v3 1/3] xen/arm: Add R-Car Gen2 support for early printk
2015-01-23 15:33 [PATCH v3 0/3] arm: introduce basic Renesas R-Car Gen2 platform support Oleksandr Tyshchenko
@ 2015-01-23 15:33 ` Oleksandr Tyshchenko
2015-01-23 15:33 ` [PATCH v3 2/3] xen/arm: Add new driver for R-Car Gen2 UART Oleksandr Tyshchenko
` (2 subsequent siblings)
3 siblings, 0 replies; 18+ messages in thread
From: Oleksandr Tyshchenko @ 2015-01-23 15:33 UTC (permalink / raw)
To: xen-devel; +Cc: julien.grall, tim, ian.campbell, stefano.stabellini
Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
---
docs/misc/arm/early-printk.txt | 1 +
xen/arch/arm/Rules.mk | 4 ++
xen/arch/arm/arm32/debug-rcar2.inc | 49 +++++++++++++++++
xen/include/asm-arm/rcar2-uart.h | 107 +++++++++++++++++++++++++++++++++++++
4 files changed, 161 insertions(+)
create mode 100644 xen/arch/arm/arm32/debug-rcar2.inc
create mode 100644 xen/include/asm-arm/rcar2-uart.h
diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index 71a0247..1ca2a55 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -19,6 +19,7 @@ where mach is the name of the machine:
- brcm: printk with 8250 on Broadcom 7445D0 boards with A15 processors.
- hip04-d01: printk with 8250 on HiSilicon Hip-04 D01
- seattle: printk with pl011 for AMD Seattle processor
+ - lager: printk with SCIF0 on Renesas R-Car H2 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 4ee51a9..ff02893 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -109,6 +109,10 @@ ifeq ($(CONFIG_EARLY_PRINTK), seattle)
EARLY_PRINTK_INC := pl011
EARLY_UART_BASE_ADDRESS := 0xe1010000
endif
+ifeq ($(CONFIG_EARLY_PRINTK), lager)
+EARLY_PRINTK_INC := rcar2
+EARLY_UART_BASE_ADDRESS := 0xe6e60000
+endif
ifneq ($(EARLY_PRINTK_INC),)
EARLY_PRINTK := y
diff --git a/xen/arch/arm/arm32/debug-rcar2.inc b/xen/arch/arm/arm32/debug-rcar2.inc
new file mode 100644
index 0000000..e8d17f3
--- /dev/null
+++ b/xen/arch/arm/arm32/debug-rcar2.inc
@@ -0,0 +1,49 @@
+/*
+ * xen/arch/arm/arm32/debug-rcar2.inc
+ *
+ * R-Car Gen2 specific debug code
+ *
+ * Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
+ * Copyright (C) 2014, Globallogic.
+ *
+ * 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/rcar2-uart.h>
+
+/* R-Car Gen2 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, #SCIF_SCFSR] /* <- SCFSR (status register) */
+ tst \rc, #SCFSR_TDFE /* Check TDFE bit */
+ beq 1b /* Wait for the UART to be ready */
+.endm
+
+/* R-Car Gen2 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, #SCIF_SCFTDR] /* -> SCFTDR (data register) */
+ ldrh \rt, [\rb, #SCIF_SCFSR] /* <- SCFSR (status register) */
+ and \rt, \rt, #(~(SCFSR_TEND | SCFSR_TDFE)) /* Clear TEND and TDFE bits */
+ strh \rt, [\rb, #SCIF_SCFSR] /* -> SCFSR (status register) */
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/rcar2-uart.h b/xen/include/asm-arm/rcar2-uart.h
new file mode 100644
index 0000000..3a5871a
--- /dev/null
+++ b/xen/include/asm-arm/rcar2-uart.h
@@ -0,0 +1,107 @@
+/*
+ * xen/include/asm-arm/rcar2-uart.h
+ *
+ * Common constant definition between early printk and the UART driver
+ * for the R-Car Gen2 UART.
+ *
+ * Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
+ * Copyright (C) 2014, Globallogic.
+ *
+ * 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 __ASM_ARM_RCAR2_UART_H
+#define __ASM_ARM_RCAR2_UART_H
+
+#define SCIF_FIFO_MAX_SIZE 16
+#define SCIF_CLK_FREQ 14745600
+
+/* Register offsets */
+#define SCIF_SCSMR (0x00) /* Serial mode register */
+#define SCIF_SCBRR (0x04) /* Bit rate register */
+#define SCIF_SCSCR (0x08) /* Serial control register */
+#define SCIF_SCFTDR (0x0C) /* Transmit FIFO data register */
+#define SCIF_SCFSR (0x10) /* Serial status register */
+#define SCIF_SCFRDR (0x14) /* Receive FIFO data register */
+#define SCIF_SCFCR (0x18) /* FIFO control register */
+#define SCIF_SCFDR (0x1C) /* FIFO data count register */
+#define SCIF_SCSPTR (0x20) /* Serial port register */
+#define SCIF_SCLSR (0x24) /* Line status register */
+#define SCIF_DL (0x30) /* Frequency division register */
+#define SCIF_CKS (0x34) /* Clock Select register */
+
+/* Serial Control Register (SCSCR) */
+#define SCSCR_TIE (1 << 7) /* Transmit Interrupt Enable */
+#define SCSCR_RIE (1 << 6) /* Receive Interrupt Enable */
+#define SCSCR_TE (1 << 5) /* Transmit Enable */
+#define SCSCR_RE (1 << 4) /* Receive Enable */
+#define SCSCR_REIE (1 << 3) /* Receive Error Interrupt Enable */
+#define SCSCR_TOIE (1 << 2) /* Timeout Interrupt Enable */
+#define SCSCR_CKE1 (1 << 1) /* Clock Enable 1 */
+#define SCSCR_CKE0 (1 << 0) /* Clock Enable 0 */
+
+#define SCSCR_CKE00 (0)
+#define SCSCR_CKE01 (SCSCR_CKE0)
+#define SCSCR_CKE10 (SCSCR_CKE1)
+#define SCSCR_CKE11 (SCSCR_CKE1 | SCSCR_CKE0)
+
+/* Serial Mode Register (SCSMR) */
+#define SCSMR_CHR (1 << 6) /* 7-bit Character Length */
+#define SCSMR_PE (1 << 5) /* Parity Enable */
+#define SCSMR_ODD (1 << 4) /* Odd Parity */
+#define SCSMR_STOP (1 << 3) /* Stop Bit Length */
+
+/* Serial Status Register (SCFSR) */
+#define SCFSR_ER (1 << 7) /* Receive Error */
+#define SCFSR_TEND (1 << 6) /* Transmission End */
+#define SCFSR_TDFE (1 << 5) /* Transmit FIFO Data Empty */
+#define SCFSR_BRK (1 << 4) /* Break Detect */
+#define SCFSR_FER (1 << 3) /* Framing Error */
+#define SCFSR_PER (1 << 2) /* Parity Error */
+#define SCFSR_RDF (1 << 1) /* Receive FIFO Data Full */
+#define SCFSR_DR (1 << 0) /* Receive Data Ready */
+
+#define SCIF_ERRORS (SCFSR_PER | SCFSR_FER | SCFSR_ER | SCFSR_BRK)
+
+/* Line Status Register (SCLSR) */
+#define SCLSR_TO (1 << 2) /* Timeout */
+#define SCLSR_ORER (1 << 0) /* Overrun Error */
+
+/* FIFO Control Register (SCFCR) */
+#define SCFCR_RTRG1 (1 << 7) /* Receive FIFO Data Count Trigger 1 */
+#define SCFCR_RTRG0 (1 << 6) /* Receive FIFO Data Count Trigger 0 */
+#define SCFCR_TTRG1 (1 << 5) /* Transmit FIFO Data Count Trigger 1 */
+#define SCFCR_TTRG0 (1 << 4) /* Transmit FIFO Data Count Trigger 0 */
+#define SCFCR_MCE (1 << 3) /* Modem Control Enable */
+#define SCFCR_TFRST (1 << 2) /* Transmit FIFO Data Register Reset */
+#define SCFCR_RFRST (1 << 1) /* Receive FIFO Data Register Reset */
+#define SCFCR_LOOP (1 << 0) /* Loopback Test */
+
+#define SCFCR_RTRG00 (0)
+#define SCFCR_RTRG01 (SCFCR_RTRG0)
+#define SCFCR_RTRG10 (SCFCR_RTRG1)
+#define SCFCR_RTRG11 (SCFCR_RTRG1 | SCFCR_RTRG0)
+
+#define SCFCR_TTRG00 (0)
+#define SCFCR_TTRG01 (SCFCR_TTRG0)
+#define SCFCR_TTRG10 (SCFCR_TTRG1)
+#define SCFCR_TTRG11 (SCFCR_TTRG1 | SCFCR_TTRG0)
+
+#endif /* __ASM_ARM_RCAR2_UART_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
1.9.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v3 2/3] xen/arm: Add new driver for R-Car Gen2 UART
2015-01-23 15:33 [PATCH v3 0/3] arm: introduce basic Renesas R-Car Gen2 platform support Oleksandr Tyshchenko
2015-01-23 15:33 ` [PATCH v3 1/3] xen/arm: Add R-Car Gen2 support for early printk Oleksandr Tyshchenko
@ 2015-01-23 15:33 ` Oleksandr Tyshchenko
2015-01-23 22:40 ` Julien Grall
2015-01-23 15:33 ` [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform Oleksandr Tyshchenko
2015-01-23 22:36 ` [PATCH v3 0/3] arm: introduce basic Renesas R-Car Gen2 platform support Julien Grall
3 siblings, 1 reply; 18+ messages in thread
From: Oleksandr Tyshchenko @ 2015-01-23 15:33 UTC (permalink / raw)
To: xen-devel; +Cc: julien.grall, tim, ian.campbell, stefano.stabellini
Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
Signed-off-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
CC: Julien Grall <julien.grall@linaro.org>
---
config/arm32.mk | 1 +
xen/drivers/char/Makefile | 1 +
xen/drivers/char/rcar2-uart.c | 366 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 368 insertions(+)
create mode 100644 xen/drivers/char/rcar2-uart.c
diff --git a/config/arm32.mk b/config/arm32.mk
index 4f83a63..6ee5173 100644
--- a/config/arm32.mk
+++ b/config/arm32.mk
@@ -12,6 +12,7 @@ CFLAGS += -marm
HAS_PL011 := y
HAS_EXYNOS4210 := y
HAS_OMAP := y
+HAS_RCAR2 := y
HAS_NS16550 := y
# Use only if calling $(LD) directly.
diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile
index 911b788..64428b7 100644
--- a/xen/drivers/char/Makefile
+++ b/xen/drivers/char/Makefile
@@ -3,6 +3,7 @@ obj-$(HAS_NS16550) += ns16550.o
obj-$(HAS_PL011) += pl011.o
obj-$(HAS_EXYNOS4210) += exynos4210-uart.o
obj-$(HAS_OMAP) += omap-uart.o
+obj-$(HAS_RCAR2) += rcar2-uart.o
obj-$(HAS_EHCI) += ehci-dbgp.o
obj-$(CONFIG_ARM) += dt-uart.o
obj-y += serial.o
diff --git a/xen/drivers/char/rcar2-uart.c b/xen/drivers/char/rcar2-uart.c
new file mode 100644
index 0000000..7ace6ad
--- /dev/null
+++ b/xen/drivers/char/rcar2-uart.c
@@ -0,0 +1,366 @@
+/*
+ * xen/drivers/char/rcar2-uart.c
+ *
+ * Driver for R-Car Gen2 UART.
+ *
+ * Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
+ * Copyright (C) 2014, Globallogic.
+ *
+ * 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/config.h>
+#include <xen/console.h>
+#include <xen/errno.h>
+#include <xen/serial.h>
+#include <xen/init.h>
+#include <xen/irq.h>
+#include <xen/mm.h>
+#include <xen/delay.h>
+#include <asm/device.h>
+#include <asm/rcar2-uart.h>
+#include <asm/io.h>
+
+#define PARITY_NONE 0
+#define PARITY_EVEN 1
+#define PARITY_ODD 2
+
+#define rcar2_readb(uart, off) readb((uart)->regs + (off))
+#define rcar2_writeb(uart, off, val) writeb((val), (uart)->regs + (off))
+
+#define rcar2_readw(uart, off) readw((uart)->regs + (off))
+#define rcar2_writew(uart, off, val) writew((val), (uart)->regs + (off))
+
+static struct rcar2_uart {
+ unsigned int baud, clock_hz, data_bits, parity, stop_bits;
+ unsigned int irq;
+ char __iomem *regs;
+ struct irqaction irqaction;
+ struct vuart_info vuart;
+} rcar2_com = {0};
+
+static void rcar2_uart_interrupt(int irq, void *data, struct cpu_user_regs *regs)
+{
+ struct serial_port *port = data;
+ struct rcar2_uart *uart = port->uart;
+ uint16_t status, ctrl;
+
+ ctrl = rcar2_readw(uart, SCIF_SCSCR);
+ status = rcar2_readw(uart, SCIF_SCFSR) & ~SCFSR_TEND;
+ /* Ignore next flag if TX Interrupt is disabled */
+ if ( !(ctrl & SCSCR_TIE) )
+ status &= ~SCFSR_TDFE;
+
+ while ( status != 0 )
+ {
+ /* TX Interrupt */
+ if ( status & SCFSR_TDFE )
+ serial_tx_interrupt(port, regs);
+
+ /* RX Interrupt */
+ if ( status & (SCFSR_RDF | SCFSR_DR) )
+ serial_rx_interrupt(port, regs);
+
+ /* Error Interrupt */
+ if ( status & SCIF_ERRORS )
+ rcar2_writew(uart, SCIF_SCFSR, ~SCIF_ERRORS);
+ if ( rcar2_readw(uart, SCIF_SCLSR) & SCLSR_ORER )
+ rcar2_writew(uart, SCIF_SCLSR, 0);
+
+ ctrl = rcar2_readw(uart, SCIF_SCSCR);
+ status = rcar2_readw(uart, SCIF_SCFSR) & ~SCFSR_TEND;
+ /* Ignore next flag if TX Interrupt is disabled */
+ if ( !(ctrl & SCSCR_TIE) )
+ status &= ~SCFSR_TDFE;
+ }
+}
+
+static void __init rcar2_uart_init_preirq(struct serial_port *port)
+{
+ struct rcar2_uart *uart = port->uart;
+ unsigned int divisor;
+ uint16_t val;
+
+ /*
+ * Wait until last bit has been transmitted. This is needed for a smooth
+ * transition when we come from early printk
+ */
+ while ( !(rcar2_readw(uart, SCIF_SCFSR) & SCFSR_TEND) );
+
+ /* Disable TX/RX parts and all interrupts */
+ rcar2_writew(uart, SCIF_SCSCR, 0);
+
+ /* Reset TX/RX FIFOs */
+ rcar2_writew(uart, SCIF_SCFCR, SCFCR_RFRST | SCFCR_TFRST);
+
+ /* Clear all errors and flags */
+ rcar2_readw(uart, SCIF_SCFSR);
+ rcar2_writew(uart, SCIF_SCFSR, 0);
+ rcar2_readw(uart, SCIF_SCLSR);
+ rcar2_writew(uart, SCIF_SCLSR, 0);
+
+ /* Select Baud rate generator output as a clock source */
+ rcar2_writew(uart, SCIF_SCSCR, SCSCR_CKE10);
+
+ /* Setup protocol format and Baud rate, select Asynchronous mode */
+ val = 0;
+ ASSERT( uart->data_bits >= 7 && uart->data_bits <= 8 );
+ if ( uart->data_bits == 7 )
+ val |= SCSMR_CHR;
+ else
+ val &= ~SCSMR_CHR;
+
+ ASSERT( uart->stop_bits >= 1 && uart->stop_bits <= 2 );
+ if ( uart->stop_bits == 2 )
+ val |= SCSMR_STOP;
+ else
+ val &= ~SCSMR_STOP;
+
+ ASSERT( uart->parity >= PARITY_NONE && uart->parity <= PARITY_ODD );
+ switch ( uart->parity )
+ {
+ case PARITY_NONE:
+ val &= ~SCSMR_PE;
+ break;
+
+ case PARITY_EVEN:
+ val |= SCSMR_PE;
+ break;
+
+ case PARITY_ODD:
+ val |= SCSMR_PE | SCSMR_ODD;
+ break;
+ }
+ rcar2_writew(uart, SCIF_SCSMR, val);
+
+ ASSERT( uart->clock_hz > 0 );
+ if ( uart->baud != BAUD_AUTO )
+ {
+ /* Setup desired Baud rate */
+ divisor = uart->clock_hz / (uart->baud << 4);
+ ASSERT( divisor >= 1 && divisor <= (uint16_t)UINT_MAX );
+ rcar2_writew(uart, SCIF_DL, (uint16_t)divisor);
+ /* Selects the frequency divided clock (SC_CLK external input) */
+ rcar2_writew(uart, SCIF_CKS, 0);
+ udelay(1000000 / uart->baud + 1);
+ }
+ else
+ {
+ /* Read current Baud rate */
+ divisor = rcar2_readw(uart, SCIF_DL);
+ ASSERT( divisor >= 1 && divisor <= (uint16_t)UINT_MAX );
+ uart->baud = uart->clock_hz / (divisor << 4);
+ }
+
+ /* Setup trigger level for TX/RX FIFOs */
+ rcar2_writew(uart, SCIF_SCFCR, SCFCR_RTRG11 | SCFCR_TTRG11);
+
+ /* Enable TX/RX parts */
+ rcar2_writew(uart, SCIF_SCSCR, rcar2_readw(uart, SCIF_SCSCR) |
+ SCSCR_TE | SCSCR_RE);
+}
+
+static void __init rcar2_uart_init_postirq(struct serial_port *port)
+{
+ struct rcar2_uart *uart = port->uart;
+ int rc;
+
+ uart->irqaction.handler = rcar2_uart_interrupt;
+ uart->irqaction.name = "rcar2_uart";
+ uart->irqaction.dev_id = port;
+
+ if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
+ dprintk(XENLOG_ERR, "Failed to allocated rcar2_uart IRQ %d\n",
+ uart->irq);
+
+ /* Clear all errors */
+ if ( rcar2_readw(uart, SCIF_SCFSR) & SCIF_ERRORS )
+ rcar2_writew(uart, SCIF_SCFSR, ~SCIF_ERRORS);
+ if ( rcar2_readw(uart, SCIF_SCLSR) & SCLSR_ORER )
+ rcar2_writew(uart, SCIF_SCLSR, 0);
+
+ /* Enable TX/RX and Error Interrupts */
+ rcar2_writew(uart, SCIF_SCSCR, rcar2_readw(uart, SCIF_SCSCR) |
+ SCSCR_TIE | SCSCR_RIE | SCSCR_REIE);
+}
+
+static void rcar2_uart_suspend(struct serial_port *port)
+{
+ BUG();
+}
+
+static void rcar2_uart_resume(struct serial_port *port)
+{
+ BUG();
+}
+
+static int rcar2_uart_tx_ready(struct serial_port *port)
+{
+ struct rcar2_uart *uart = port->uart;
+ uint16_t cnt;
+
+ /* Check for empty space in TX FIFO */
+ if ( !(rcar2_readw(uart, SCIF_SCFSR) & SCFSR_TDFE) )
+ return 0;
+
+ /* Check number of data bytes stored in TX FIFO */
+ cnt = rcar2_readw(uart, SCIF_SCFDR) >> 8;
+ ASSERT( cnt >= 0 && cnt <= SCIF_FIFO_MAX_SIZE );
+
+ return (SCIF_FIFO_MAX_SIZE - cnt);
+}
+
+static void rcar2_uart_putc(struct serial_port *port, char c)
+{
+ struct rcar2_uart *uart = port->uart;
+
+ rcar2_writeb(uart, SCIF_SCFTDR, c);
+ /* Clear required TX flags */
+ rcar2_writew(uart, SCIF_SCFSR, rcar2_readw(uart, SCIF_SCFSR) &
+ ~(SCFSR_TEND | SCFSR_TDFE));
+}
+
+static int rcar2_uart_getc(struct serial_port *port, char *pc)
+{
+ struct rcar2_uart *uart = port->uart;
+
+ /* Check for available data bytes in RX FIFO */
+ if ( !(rcar2_readw(uart, SCIF_SCFSR) & (SCFSR_RDF | SCFSR_DR)) )
+ return 0;
+
+ *pc = rcar2_readb(uart, SCIF_SCFRDR);
+
+ /* dummy read */
+ rcar2_readw(uart, SCIF_SCFSR);
+ /* Clear required RX flags */
+ rcar2_writew(uart, SCIF_SCFSR, ~(SCFSR_RDF | SCFSR_DR));
+
+ return 1;
+}
+
+static int __init rcar2_uart_irq(struct serial_port *port)
+{
+ struct rcar2_uart *uart = port->uart;
+
+ return ((uart->irq > 0) ? uart->irq : -1);
+}
+
+static const struct vuart_info *rcar2_vuart_info(struct serial_port *port)
+{
+ struct rcar2_uart *uart = port->uart;
+
+ return &uart->vuart;
+}
+
+static void rcar2_uart_start_tx(struct serial_port *port)
+{
+ struct rcar2_uart *uart = port->uart;
+
+ rcar2_writew(uart, SCIF_SCSCR, rcar2_readw(uart, SCIF_SCSCR) | SCSCR_TIE);
+}
+
+static void rcar2_uart_stop_tx(struct serial_port *port)
+{
+ struct rcar2_uart *uart = port->uart;
+
+ rcar2_writew(uart, SCIF_SCSCR, rcar2_readw(uart, SCIF_SCSCR) & ~SCSCR_TIE);
+}
+
+static struct uart_driver __read_mostly rcar2_uart_driver = {
+ .init_preirq = rcar2_uart_init_preirq,
+ .init_postirq = rcar2_uart_init_postirq,
+ .endboot = NULL,
+ .suspend = rcar2_uart_suspend,
+ .resume = rcar2_uart_resume,
+ .tx_ready = rcar2_uart_tx_ready,
+ .putc = rcar2_uart_putc,
+ .getc = rcar2_uart_getc,
+ .irq = rcar2_uart_irq,
+ .start_tx = rcar2_uart_start_tx,
+ .stop_tx = rcar2_uart_stop_tx,
+ .vuart_info = rcar2_vuart_info,
+};
+
+static int __init rcar2_uart_init(struct dt_device_node *dev,
+ const void *data)
+{
+ const char *config = data;
+ struct rcar2_uart *uart;
+ int res;
+ u64 addr, size;
+
+ if ( strcmp(config, "") )
+ printk("WARNING: UART configuration is not supported\n");
+
+ uart = &rcar2_com;
+
+ uart->clock_hz = SCIF_CLK_FREQ;
+ uart->baud = BAUD_AUTO;
+ uart->data_bits = 8;
+ uart->parity = PARITY_NONE;
+ uart->stop_bits = 1;
+
+ res = dt_device_get_address(dev, 0, &addr, &size);
+ if ( res )
+ {
+ printk("rcar2-uart: Unable to retrieve the base"
+ " address of the UART\n");
+ return res;
+ }
+
+ res = platform_get_irq(dev, 0);
+ if ( res < 0 )
+ {
+ printk("rcar2-uart: Unable to retrieve the IRQ\n");
+ return res;
+ }
+ uart->irq = res;
+
+ uart->regs = ioremap_nocache(addr, size);
+ if ( !uart->regs )
+ {
+ printk("rcar2-uart: Unable to map the UART memory\n");
+ return -ENOMEM;
+ }
+
+ uart->vuart.base_addr = addr;
+ uart->vuart.size = size;
+ uart->vuart.data_off = SCIF_SCFTDR;
+ uart->vuart.status_off = SCIF_SCFSR;
+ uart->vuart.status = SCFSR_TDFE;
+
+ /* Register with generic serial driver */
+ serial_register_uart(SERHND_DTUART, &rcar2_uart_driver, uart);
+
+ dt_device_set_used_by(dev, DOMID_XEN);
+
+ return 0;
+}
+
+static const char * const rcar2_uart_dt_compat[] __initconst =
+{
+ "renesas,scif",
+ NULL
+};
+
+DT_DEVICE_START(rcar2_uart, "R-Car Gen2 UART", DEVICE_SERIAL)
+ .compatible = rcar2_uart_dt_compat,
+ .init = rcar2_uart_init,
+DT_DEVICE_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
1.9.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform
2015-01-23 15:33 [PATCH v3 0/3] arm: introduce basic Renesas R-Car Gen2 platform support Oleksandr Tyshchenko
2015-01-23 15:33 ` [PATCH v3 1/3] xen/arm: Add R-Car Gen2 support for early printk Oleksandr Tyshchenko
2015-01-23 15:33 ` [PATCH v3 2/3] xen/arm: Add new driver for R-Car Gen2 UART Oleksandr Tyshchenko
@ 2015-01-23 15:33 ` Oleksandr Tyshchenko
2015-01-28 13:26 ` Ian Campbell
2015-01-23 22:36 ` [PATCH v3 0/3] arm: introduce basic Renesas R-Car Gen2 platform support Julien Grall
3 siblings, 1 reply; 18+ messages in thread
From: Oleksandr Tyshchenko @ 2015-01-23 15:33 UTC (permalink / raw)
To: xen-devel; +Cc: julien.grall, tim, ian.campbell, stefano.stabellini
From: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
Signed-off-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
---
xen/arch/arm/platforms/Makefile | 1 +
xen/arch/arm/platforms/shmobile.c | 71 +++++++++++++++++++++++++++++++++++++++
2 files changed, 72 insertions(+)
create mode 100644 xen/arch/arm/platforms/shmobile.c
diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index 8f47c16..29e931a 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -4,5 +4,6 @@ obj-$(CONFIG_ARM_32) += exynos5.o
obj-$(CONFIG_ARM_32) += midway.o
obj-$(CONFIG_ARM_32) += omap5.o
obj-$(CONFIG_ARM_32) += sunxi.o
+obj-$(CONFIG_ARM_32) += shmobile.o
obj-$(CONFIG_ARM_64) += seattle.o
obj-$(CONFIG_ARM_64) += xgene-storm.o
diff --git a/xen/arch/arm/platforms/shmobile.c b/xen/arch/arm/platforms/shmobile.c
new file mode 100644
index 0000000..c462b0e
--- /dev/null
+++ b/xen/arch/arm/platforms/shmobile.c
@@ -0,0 +1,71 @@
+/*
+ * xen/arch/arm/platforms/shmobile.c
+ *
+ * Renesas R-Car Gen2 specific settings
+ *
+ * Iurii Konovalenko <iurii.konovalenko@globallogic.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.
+ */
+
+#include <xen/mm.h>
+#include <xen/vmap.h>
+#include <asm/platform.h>
+#include <asm/io.h>
+
+#define SHMOBILE_RAM_ADDR 0xE63C0000
+#define SHMOBILE_RAM_SIZE 0x1000
+#define SHMOBILE_SMP_START_OFFSET 0xFFC
+
+static int __init shmobile_smp_init(void)
+{
+ void __iomem *pram;
+
+ /* map ICRAM */
+ pram = ioremap_nocache(SHMOBILE_RAM_ADDR, SHMOBILE_RAM_SIZE);
+ if( !pram )
+ {
+ dprintk( XENLOG_ERR, "Unable to map Shmobile ICRAM\n");
+ return -ENOMEM;
+ }
+
+ /* setup reset vectors */
+ writel(__pa(init_secondary), pram + SHMOBILE_SMP_START_OFFSET);
+ iounmap(pram);
+
+ sev();
+
+ return 0;
+}
+
+static const char const *shmobile_dt_compat[] __initdata =
+{
+ "renesas,lager",
+ NULL
+};
+
+PLATFORM_START(shmobile, "Renesas R-Car Gen2")
+ .compatible = shmobile_dt_compat,
+ .cpu_up = cpu_up_send_sgi,
+ .smp_init = shmobile_smp_init,
+
+ .dom0_gnttab_start = 0xc0000000,
+ .dom0_gnttab_size = 0x20000,
+PLATFORM_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
1.9.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH v3 0/3] arm: introduce basic Renesas R-Car Gen2 platform support
2015-01-23 15:33 [PATCH v3 0/3] arm: introduce basic Renesas R-Car Gen2 platform support Oleksandr Tyshchenko
` (2 preceding siblings ...)
2015-01-23 15:33 ` [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform Oleksandr Tyshchenko
@ 2015-01-23 22:36 ` Julien Grall
2015-01-23 23:08 ` Oleksandr Tyshchenko
3 siblings, 1 reply; 18+ messages in thread
From: Julien Grall @ 2015-01-23 22:36 UTC (permalink / raw)
To: Oleksandr Tyshchenko, xen-devel; +Cc: tim, ian.campbell, stefano.stabellini
Hi Oleksandr,
On 23/01/2015 15:33, Oleksandr Tyshchenko wrote:
> Changes in v3:
> 1. Rewrite uart driver code to use start_tx/stop_tx callbacks.
> 2. Uncomment udelay after setup desired baudrate.
It might be worse to mention that this series depend on
http://www.gossamer-threads.com/lists/xen/devel/363758
Although, it's only in order to run Xen on R-Car 2.
Regards,
--
Julien Grall
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v3 2/3] xen/arm: Add new driver for R-Car Gen2 UART
2015-01-23 15:33 ` [PATCH v3 2/3] xen/arm: Add new driver for R-Car Gen2 UART Oleksandr Tyshchenko
@ 2015-01-23 22:40 ` Julien Grall
0 siblings, 0 replies; 18+ messages in thread
From: Julien Grall @ 2015-01-23 22:40 UTC (permalink / raw)
To: Oleksandr Tyshchenko, xen-devel; +Cc: tim, ian.campbell, stefano.stabellini
Hi Oleksandr,
On 23/01/2015 15:33, Oleksandr Tyshchenko wrote:
> Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
> Signed-off-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
> CC: Julien Grall <julien.grall@linaro.org>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Regards,
> ---
> config/arm32.mk | 1 +
> xen/drivers/char/Makefile | 1 +
> xen/drivers/char/rcar2-uart.c | 366 ++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 368 insertions(+)
> create mode 100644 xen/drivers/char/rcar2-uart.c
>
> diff --git a/config/arm32.mk b/config/arm32.mk
> index 4f83a63..6ee5173 100644
> --- a/config/arm32.mk
> +++ b/config/arm32.mk
> @@ -12,6 +12,7 @@ CFLAGS += -marm
> HAS_PL011 := y
> HAS_EXYNOS4210 := y
> HAS_OMAP := y
> +HAS_RCAR2 := y
> HAS_NS16550 := y
>
> # Use only if calling $(LD) directly.
> diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile
> index 911b788..64428b7 100644
> --- a/xen/drivers/char/Makefile
> +++ b/xen/drivers/char/Makefile
> @@ -3,6 +3,7 @@ obj-$(HAS_NS16550) += ns16550.o
> obj-$(HAS_PL011) += pl011.o
> obj-$(HAS_EXYNOS4210) += exynos4210-uart.o
> obj-$(HAS_OMAP) += omap-uart.o
> +obj-$(HAS_RCAR2) += rcar2-uart.o
> obj-$(HAS_EHCI) += ehci-dbgp.o
> obj-$(CONFIG_ARM) += dt-uart.o
> obj-y += serial.o
> diff --git a/xen/drivers/char/rcar2-uart.c b/xen/drivers/char/rcar2-uart.c
> new file mode 100644
> index 0000000..7ace6ad
> --- /dev/null
> +++ b/xen/drivers/char/rcar2-uart.c
> @@ -0,0 +1,366 @@
> +/*
> + * xen/drivers/char/rcar2-uart.c
> + *
> + * Driver for R-Car Gen2 UART.
> + *
> + * Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
> + * Copyright (C) 2014, Globallogic.
> + *
> + * 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/config.h>
> +#include <xen/console.h>
> +#include <xen/errno.h>
> +#include <xen/serial.h>
> +#include <xen/init.h>
> +#include <xen/irq.h>
> +#include <xen/mm.h>
> +#include <xen/delay.h>
> +#include <asm/device.h>
> +#include <asm/rcar2-uart.h>
> +#include <asm/io.h>
> +
> +#define PARITY_NONE 0
> +#define PARITY_EVEN 1
> +#define PARITY_ODD 2
> +
> +#define rcar2_readb(uart, off) readb((uart)->regs + (off))
> +#define rcar2_writeb(uart, off, val) writeb((val), (uart)->regs + (off))
> +
> +#define rcar2_readw(uart, off) readw((uart)->regs + (off))
> +#define rcar2_writew(uart, off, val) writew((val), (uart)->regs + (off))
> +
> +static struct rcar2_uart {
> + unsigned int baud, clock_hz, data_bits, parity, stop_bits;
> + unsigned int irq;
> + char __iomem *regs;
> + struct irqaction irqaction;
> + struct vuart_info vuart;
> +} rcar2_com = {0};
> +
> +static void rcar2_uart_interrupt(int irq, void *data, struct cpu_user_regs *regs)
> +{
> + struct serial_port *port = data;
> + struct rcar2_uart *uart = port->uart;
> + uint16_t status, ctrl;
> +
> + ctrl = rcar2_readw(uart, SCIF_SCSCR);
> + status = rcar2_readw(uart, SCIF_SCFSR) & ~SCFSR_TEND;
> + /* Ignore next flag if TX Interrupt is disabled */
> + if ( !(ctrl & SCSCR_TIE) )
> + status &= ~SCFSR_TDFE;
> +
> + while ( status != 0 )
> + {
> + /* TX Interrupt */
> + if ( status & SCFSR_TDFE )
> + serial_tx_interrupt(port, regs);
> +
> + /* RX Interrupt */
> + if ( status & (SCFSR_RDF | SCFSR_DR) )
> + serial_rx_interrupt(port, regs);
> +
> + /* Error Interrupt */
> + if ( status & SCIF_ERRORS )
> + rcar2_writew(uart, SCIF_SCFSR, ~SCIF_ERRORS);
> + if ( rcar2_readw(uart, SCIF_SCLSR) & SCLSR_ORER )
> + rcar2_writew(uart, SCIF_SCLSR, 0);
> +
> + ctrl = rcar2_readw(uart, SCIF_SCSCR);
> + status = rcar2_readw(uart, SCIF_SCFSR) & ~SCFSR_TEND;
> + /* Ignore next flag if TX Interrupt is disabled */
> + if ( !(ctrl & SCSCR_TIE) )
> + status &= ~SCFSR_TDFE;
> + }
> +}
> +
> +static void __init rcar2_uart_init_preirq(struct serial_port *port)
> +{
> + struct rcar2_uart *uart = port->uart;
> + unsigned int divisor;
> + uint16_t val;
> +
> + /*
> + * Wait until last bit has been transmitted. This is needed for a smooth
> + * transition when we come from early printk
> + */
> + while ( !(rcar2_readw(uart, SCIF_SCFSR) & SCFSR_TEND) );
> +
> + /* Disable TX/RX parts and all interrupts */
> + rcar2_writew(uart, SCIF_SCSCR, 0);
> +
> + /* Reset TX/RX FIFOs */
> + rcar2_writew(uart, SCIF_SCFCR, SCFCR_RFRST | SCFCR_TFRST);
> +
> + /* Clear all errors and flags */
> + rcar2_readw(uart, SCIF_SCFSR);
> + rcar2_writew(uart, SCIF_SCFSR, 0);
> + rcar2_readw(uart, SCIF_SCLSR);
> + rcar2_writew(uart, SCIF_SCLSR, 0);
> +
> + /* Select Baud rate generator output as a clock source */
> + rcar2_writew(uart, SCIF_SCSCR, SCSCR_CKE10);
> +
> + /* Setup protocol format and Baud rate, select Asynchronous mode */
> + val = 0;
> + ASSERT( uart->data_bits >= 7 && uart->data_bits <= 8 );
> + if ( uart->data_bits == 7 )
> + val |= SCSMR_CHR;
> + else
> + val &= ~SCSMR_CHR;
> +
> + ASSERT( uart->stop_bits >= 1 && uart->stop_bits <= 2 );
> + if ( uart->stop_bits == 2 )
> + val |= SCSMR_STOP;
> + else
> + val &= ~SCSMR_STOP;
> +
> + ASSERT( uart->parity >= PARITY_NONE && uart->parity <= PARITY_ODD );
> + switch ( uart->parity )
> + {
> + case PARITY_NONE:
> + val &= ~SCSMR_PE;
> + break;
> +
> + case PARITY_EVEN:
> + val |= SCSMR_PE;
> + break;
> +
> + case PARITY_ODD:
> + val |= SCSMR_PE | SCSMR_ODD;
> + break;
> + }
> + rcar2_writew(uart, SCIF_SCSMR, val);
> +
> + ASSERT( uart->clock_hz > 0 );
> + if ( uart->baud != BAUD_AUTO )
> + {
> + /* Setup desired Baud rate */
> + divisor = uart->clock_hz / (uart->baud << 4);
> + ASSERT( divisor >= 1 && divisor <= (uint16_t)UINT_MAX );
> + rcar2_writew(uart, SCIF_DL, (uint16_t)divisor);
> + /* Selects the frequency divided clock (SC_CLK external input) */
> + rcar2_writew(uart, SCIF_CKS, 0);
> + udelay(1000000 / uart->baud + 1);
> + }
> + else
> + {
> + /* Read current Baud rate */
> + divisor = rcar2_readw(uart, SCIF_DL);
> + ASSERT( divisor >= 1 && divisor <= (uint16_t)UINT_MAX );
> + uart->baud = uart->clock_hz / (divisor << 4);
> + }
> +
> + /* Setup trigger level for TX/RX FIFOs */
> + rcar2_writew(uart, SCIF_SCFCR, SCFCR_RTRG11 | SCFCR_TTRG11);
> +
> + /* Enable TX/RX parts */
> + rcar2_writew(uart, SCIF_SCSCR, rcar2_readw(uart, SCIF_SCSCR) |
> + SCSCR_TE | SCSCR_RE);
> +}
> +
> +static void __init rcar2_uart_init_postirq(struct serial_port *port)
> +{
> + struct rcar2_uart *uart = port->uart;
> + int rc;
> +
> + uart->irqaction.handler = rcar2_uart_interrupt;
> + uart->irqaction.name = "rcar2_uart";
> + uart->irqaction.dev_id = port;
> +
> + if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
> + dprintk(XENLOG_ERR, "Failed to allocated rcar2_uart IRQ %d\n",
> + uart->irq);
> +
> + /* Clear all errors */
> + if ( rcar2_readw(uart, SCIF_SCFSR) & SCIF_ERRORS )
> + rcar2_writew(uart, SCIF_SCFSR, ~SCIF_ERRORS);
> + if ( rcar2_readw(uart, SCIF_SCLSR) & SCLSR_ORER )
> + rcar2_writew(uart, SCIF_SCLSR, 0);
> +
> + /* Enable TX/RX and Error Interrupts */
> + rcar2_writew(uart, SCIF_SCSCR, rcar2_readw(uart, SCIF_SCSCR) |
> + SCSCR_TIE | SCSCR_RIE | SCSCR_REIE);
> +}
> +
> +static void rcar2_uart_suspend(struct serial_port *port)
> +{
> + BUG();
> +}
> +
> +static void rcar2_uart_resume(struct serial_port *port)
> +{
> + BUG();
> +}
> +
> +static int rcar2_uart_tx_ready(struct serial_port *port)
> +{
> + struct rcar2_uart *uart = port->uart;
> + uint16_t cnt;
> +
> + /* Check for empty space in TX FIFO */
> + if ( !(rcar2_readw(uart, SCIF_SCFSR) & SCFSR_TDFE) )
> + return 0;
> +
> + /* Check number of data bytes stored in TX FIFO */
> + cnt = rcar2_readw(uart, SCIF_SCFDR) >> 8;
> + ASSERT( cnt >= 0 && cnt <= SCIF_FIFO_MAX_SIZE );
> +
> + return (SCIF_FIFO_MAX_SIZE - cnt);
> +}
> +
> +static void rcar2_uart_putc(struct serial_port *port, char c)
> +{
> + struct rcar2_uart *uart = port->uart;
> +
> + rcar2_writeb(uart, SCIF_SCFTDR, c);
> + /* Clear required TX flags */
> + rcar2_writew(uart, SCIF_SCFSR, rcar2_readw(uart, SCIF_SCFSR) &
> + ~(SCFSR_TEND | SCFSR_TDFE));
> +}
> +
> +static int rcar2_uart_getc(struct serial_port *port, char *pc)
> +{
> + struct rcar2_uart *uart = port->uart;
> +
> + /* Check for available data bytes in RX FIFO */
> + if ( !(rcar2_readw(uart, SCIF_SCFSR) & (SCFSR_RDF | SCFSR_DR)) )
> + return 0;
> +
> + *pc = rcar2_readb(uart, SCIF_SCFRDR);
> +
> + /* dummy read */
> + rcar2_readw(uart, SCIF_SCFSR);
> + /* Clear required RX flags */
> + rcar2_writew(uart, SCIF_SCFSR, ~(SCFSR_RDF | SCFSR_DR));
> +
> + return 1;
> +}
> +
> +static int __init rcar2_uart_irq(struct serial_port *port)
> +{
> + struct rcar2_uart *uart = port->uart;
> +
> + return ((uart->irq > 0) ? uart->irq : -1);
> +}
> +
> +static const struct vuart_info *rcar2_vuart_info(struct serial_port *port)
> +{
> + struct rcar2_uart *uart = port->uart;
> +
> + return &uart->vuart;
> +}
> +
> +static void rcar2_uart_start_tx(struct serial_port *port)
> +{
> + struct rcar2_uart *uart = port->uart;
> +
> + rcar2_writew(uart, SCIF_SCSCR, rcar2_readw(uart, SCIF_SCSCR) | SCSCR_TIE);
> +}
> +
> +static void rcar2_uart_stop_tx(struct serial_port *port)
> +{
> + struct rcar2_uart *uart = port->uart;
> +
> + rcar2_writew(uart, SCIF_SCSCR, rcar2_readw(uart, SCIF_SCSCR) & ~SCSCR_TIE);
> +}
> +
> +static struct uart_driver __read_mostly rcar2_uart_driver = {
> + .init_preirq = rcar2_uart_init_preirq,
> + .init_postirq = rcar2_uart_init_postirq,
> + .endboot = NULL,
> + .suspend = rcar2_uart_suspend,
> + .resume = rcar2_uart_resume,
> + .tx_ready = rcar2_uart_tx_ready,
> + .putc = rcar2_uart_putc,
> + .getc = rcar2_uart_getc,
> + .irq = rcar2_uart_irq,
> + .start_tx = rcar2_uart_start_tx,
> + .stop_tx = rcar2_uart_stop_tx,
> + .vuart_info = rcar2_vuart_info,
> +};
> +
> +static int __init rcar2_uart_init(struct dt_device_node *dev,
> + const void *data)
> +{
> + const char *config = data;
> + struct rcar2_uart *uart;
> + int res;
> + u64 addr, size;
> +
> + if ( strcmp(config, "") )
> + printk("WARNING: UART configuration is not supported\n");
> +
> + uart = &rcar2_com;
> +
> + uart->clock_hz = SCIF_CLK_FREQ;
> + uart->baud = BAUD_AUTO;
> + uart->data_bits = 8;
> + uart->parity = PARITY_NONE;
> + uart->stop_bits = 1;
> +
> + res = dt_device_get_address(dev, 0, &addr, &size);
> + if ( res )
> + {
> + printk("rcar2-uart: Unable to retrieve the base"
> + " address of the UART\n");
> + return res;
> + }
> +
> + res = platform_get_irq(dev, 0);
> + if ( res < 0 )
> + {
> + printk("rcar2-uart: Unable to retrieve the IRQ\n");
> + return res;
> + }
> + uart->irq = res;
> +
> + uart->regs = ioremap_nocache(addr, size);
> + if ( !uart->regs )
> + {
> + printk("rcar2-uart: Unable to map the UART memory\n");
> + return -ENOMEM;
> + }
> +
> + uart->vuart.base_addr = addr;
> + uart->vuart.size = size;
> + uart->vuart.data_off = SCIF_SCFTDR;
> + uart->vuart.status_off = SCIF_SCFSR;
> + uart->vuart.status = SCFSR_TDFE;
> +
> + /* Register with generic serial driver */
> + serial_register_uart(SERHND_DTUART, &rcar2_uart_driver, uart);
> +
> + dt_device_set_used_by(dev, DOMID_XEN);
> +
> + return 0;
> +}
> +
> +static const char * const rcar2_uart_dt_compat[] __initconst =
> +{
> + "renesas,scif",
> + NULL
> +};
> +
> +DT_DEVICE_START(rcar2_uart, "R-Car Gen2 UART", DEVICE_SERIAL)
> + .compatible = rcar2_uart_dt_compat,
> + .init = rcar2_uart_init,
> +DT_DEVICE_END
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
>
--
Julien Grall
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v3 0/3] arm: introduce basic Renesas R-Car Gen2 platform support
2015-01-23 22:36 ` [PATCH v3 0/3] arm: introduce basic Renesas R-Car Gen2 platform support Julien Grall
@ 2015-01-23 23:08 ` Oleksandr Tyshchenko
0 siblings, 0 replies; 18+ messages in thread
From: Oleksandr Tyshchenko @ 2015-01-23 23:08 UTC (permalink / raw)
To: Julien Grall; +Cc: xen-devel, tim, Ian Campbell, Stefano Stabellini
[-- Attachment #1.1: Type: text/plain, Size: 654 bytes --]
24 янв. 2015 г. 0:36 пользователь "Julien Grall" <julien.grall@linaro.org>
написал:
>
> Hi Oleksandr,
>
Hi Julien
>
> On 23/01/2015 15:33, Oleksandr Tyshchenko wrote:
>>
>> Changes in v3:
>> 1. Rewrite uart driver code to use start_tx/stop_tx callbacks.
>> 2. Uncomment udelay after setup desired baudrate.
>
>
> It might be worse to mention that this series depend on
> http://www.gossamer-threads.com/lists/xen/devel/363758
>
I think yes, by default we do not change baudrate, so the driver does not
call udelay.
> Although, it's only in order to run Xen on R-Car 2.
>
> Regards,
>
> --
> Julien Grall
[-- Attachment #1.2: Type: text/html, Size: 981 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform
2015-01-23 15:33 ` [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform Oleksandr Tyshchenko
@ 2015-01-28 13:26 ` Ian Campbell
2015-01-28 13:48 ` Oleksandr Tyshchenko
0 siblings, 1 reply; 18+ messages in thread
From: Ian Campbell @ 2015-01-28 13:26 UTC (permalink / raw)
To: Oleksandr Tyshchenko; +Cc: julien.grall, tim, stefano.stabellini, xen-devel
On Fri, 2015-01-23 at 17:33 +0200, Oleksandr Tyshchenko wrote:
> From: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
>
> Signed-off-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
> Reviewed-by: Julien Grall <julien.grall@linaro.org>
> ---
> xen/arch/arm/platforms/Makefile | 1 +
> xen/arch/arm/platforms/shmobile.c | 71 +++++++++++++++++++++++++++++++++++++++
> 2 files changed, 72 insertions(+)
> create mode 100644 xen/arch/arm/platforms/shmobile.c
>
> diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
> index 8f47c16..29e931a 100644
> --- a/xen/arch/arm/platforms/Makefile
> +++ b/xen/arch/arm/platforms/Makefile
> @@ -4,5 +4,6 @@ obj-$(CONFIG_ARM_32) += exynos5.o
> obj-$(CONFIG_ARM_32) += midway.o
> obj-$(CONFIG_ARM_32) += omap5.o
> obj-$(CONFIG_ARM_32) += sunxi.o
> +obj-$(CONFIG_ARM_32) += shmobile.o
Everything else calls the platform rcar. How does shmobile relate to
that?
(I must confess I thought sh-mobile was a process architecture of its
own, not an ARM thing)
Ian.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform
2015-01-28 13:26 ` Ian Campbell
@ 2015-01-28 13:48 ` Oleksandr Tyshchenko
2015-01-28 14:16 ` Ian Campbell
0 siblings, 1 reply; 18+ messages in thread
From: Oleksandr Tyshchenko @ 2015-01-28 13:48 UTC (permalink / raw)
To: Ian Campbell
Cc: Julien Grall, Tim Deegan, Stefano Stabellini,
xen-devel@lists.xen.org
Hi Ian
On Wed, Jan 28, 2015 at 3:26 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Fri, 2015-01-23 at 17:33 +0200, Oleksandr Tyshchenko wrote:
>> From: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
>>
>> Signed-off-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
>> Reviewed-by: Julien Grall <julien.grall@linaro.org>
>> ---
>> xen/arch/arm/platforms/Makefile | 1 +
>> xen/arch/arm/platforms/shmobile.c | 71 +++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 72 insertions(+)
>> create mode 100644 xen/arch/arm/platforms/shmobile.c
>>
>> diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
>> index 8f47c16..29e931a 100644
>> --- a/xen/arch/arm/platforms/Makefile
>> +++ b/xen/arch/arm/platforms/Makefile
>> @@ -4,5 +4,6 @@ obj-$(CONFIG_ARM_32) += exynos5.o
>> obj-$(CONFIG_ARM_32) += midway.o
>> obj-$(CONFIG_ARM_32) += omap5.o
>> obj-$(CONFIG_ARM_32) += sunxi.o
>> +obj-$(CONFIG_ARM_32) += shmobile.o
>
> Everything else calls the platform rcar. How does shmobile relate to
> that?
Unfortunately, the author of this patch in vacation now.
Perhaps Iurii took this name from kernel part (Linux/arch/arm/mach-shmobile/...)
where the arch specific things for this platform is located,
especially the SMP and timer support.
I would rename shmobile to rcar2.
>
> (I must confess I thought sh-mobile was a process architecture of its
> own, not an ARM thing)
>
> Ian.
>
--
Oleksandr Tyshchenko | Embedded Dev
GlobalLogic
www.globallogic.com
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform
2015-01-28 13:48 ` Oleksandr Tyshchenko
@ 2015-01-28 14:16 ` Ian Campbell
2015-01-28 16:16 ` Andrii Anisov
0 siblings, 1 reply; 18+ messages in thread
From: Ian Campbell @ 2015-01-28 14:16 UTC (permalink / raw)
To: Oleksandr Tyshchenko
Cc: xen-devel@lists.xen.org, Julien Grall, Tim Deegan,
Stefano Stabellini
On Wed, 2015-01-28 at 15:48 +0200, Oleksandr Tyshchenko wrote:
> Hi Ian
>
> On Wed, Jan 28, 2015 at 3:26 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Fri, 2015-01-23 at 17:33 +0200, Oleksandr Tyshchenko wrote:
> >> From: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
> >>
> >> Signed-off-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
> >> Reviewed-by: Julien Grall <julien.grall@linaro.org>
> >> ---
> >> xen/arch/arm/platforms/Makefile | 1 +
> >> xen/arch/arm/platforms/shmobile.c | 71 +++++++++++++++++++++++++++++++++++++++
> >> 2 files changed, 72 insertions(+)
> >> create mode 100644 xen/arch/arm/platforms/shmobile.c
> >>
> >> diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
> >> index 8f47c16..29e931a 100644
> >> --- a/xen/arch/arm/platforms/Makefile
> >> +++ b/xen/arch/arm/platforms/Makefile
> >> @@ -4,5 +4,6 @@ obj-$(CONFIG_ARM_32) += exynos5.o
> >> obj-$(CONFIG_ARM_32) += midway.o
> >> obj-$(CONFIG_ARM_32) += omap5.o
> >> obj-$(CONFIG_ARM_32) += sunxi.o
> >> +obj-$(CONFIG_ARM_32) += shmobile.o
> >
> > Everything else calls the platform rcar. How does shmobile relate to
> > that?
> Unfortunately, the author of this patch in vacation now.
>
> Perhaps Iurii took this name from kernel part (Linux/arch/arm/mach-shmobile/...)
> where the arch specific things for this platform is located,
> especially the SMP and timer support.
>
> I would rename shmobile to rcar2.
I'd prefer us to be consistent one way or another.
Is RCAR2 a subset of shmobile or the other way around?
http://am.renesas.com/applications/automotive/cis/cis_highend/rcar_h2/index.jsp doesn't mention shmobile at all.
Having determined which is the "parent"/superset my next question would
be how similar are the various "children" -- similar enough to be a
single platform in Xen, or different enough that we will need multiple
platforms, since that would have an impact on which name I think we
should pick.
(To some extent we can fidge this since we can always git mv stuff, but
we should at least give it our best guess up front)
Ian.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform
2015-01-28 14:16 ` Ian Campbell
@ 2015-01-28 16:16 ` Andrii Anisov
2015-01-30 15:38 ` Oleksandr Tyshchenko
0 siblings, 1 reply; 18+ messages in thread
From: Andrii Anisov @ 2015-01-28 16:16 UTC (permalink / raw)
To: Ian Campbell
Cc: Oleksandr Tyshchenko, Julien Grall, Tim Deegan,
Stefano Stabellini, xen-devel@lists.xen.org
Hello Ian,
When I discussed with Iurii Konovalenko about this naming during
review I mentioned following the Linux kernel way.
Shmobile within kernel is arm specific, not the same as arch/sh. In
the kernel you would find arch/arm/mach-shmobile folder where
Renesas'es R-CarX SoCs support reside. F.e. R8A7790 what is R-Car H2
we have on our table. Browsing the kernel configs you will find
shmobile not rcar as well.
>From other hand I do not like rcar2 naming for uart. I would prefer
the IP block naming - scif.
Andrii Anisov | Team Lead
GlobalLogic
Kyiv, 03038, Protasov Business Park, M.Grinchenka, 2/1
P +38.044.492.9695x3664 M +380505738852 S andriyanisov
www.globallogic.com
http://www.globallogic.com/email_disclaimer.txt
On Wed, Jan 28, 2015 at 4:16 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>
> On Wed, 2015-01-28 at 15:48 +0200, Oleksandr Tyshchenko wrote:
> > Hi Ian
> >
> > On Wed, Jan 28, 2015 at 3:26 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > > On Fri, 2015-01-23 at 17:33 +0200, Oleksandr Tyshchenko wrote:
> > >> From: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
> > >>
> > >> Signed-off-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
> > >> Reviewed-by: Julien Grall <julien.grall@linaro.org>
> > >> ---
> > >> xen/arch/arm/platforms/Makefile | 1 +
> > >> xen/arch/arm/platforms/shmobile.c | 71 +++++++++++++++++++++++++++++++++++++++
> > >> 2 files changed, 72 insertions(+)
> > >> create mode 100644 xen/arch/arm/platforms/shmobile.c
> > >>
> > >> diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
> > >> index 8f47c16..29e931a 100644
> > >> --- a/xen/arch/arm/platforms/Makefile
> > >> +++ b/xen/arch/arm/platforms/Makefile
> > >> @@ -4,5 +4,6 @@ obj-$(CONFIG_ARM_32) += exynos5.o
> > >> obj-$(CONFIG_ARM_32) += midway.o
> > >> obj-$(CONFIG_ARM_32) += omap5.o
> > >> obj-$(CONFIG_ARM_32) += sunxi.o
> > >> +obj-$(CONFIG_ARM_32) += shmobile.o
> > >
> > > Everything else calls the platform rcar. How does shmobile relate to
> > > that?
> > Unfortunately, the author of this patch in vacation now.
> >
> > Perhaps Iurii took this name from kernel part (Linux/arch/arm/mach-shmobile/...)
> > where the arch specific things for this platform is located,
> > especially the SMP and timer support.
> >
> > I would rename shmobile to rcar2.
>
> I'd prefer us to be consistent one way or another.
>
> Is RCAR2 a subset of shmobile or the other way around?
>
> http://am.renesas.com/applications/automotive/cis/cis_highend/rcar_h2/index.jsp doesn't mention shmobile at all.
>
> Having determined which is the "parent"/superset my next question would
> be how similar are the various "children" -- similar enough to be a
> single platform in Xen, or different enough that we will need multiple
> platforms, since that would have an impact on which name I think we
> should pick.
>
> (To some extent we can fidge this since we can always git mv stuff, but
> we should at least give it our best guess up front)
>
>
> Ian.
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform
2015-01-28 16:16 ` Andrii Anisov
@ 2015-01-30 15:38 ` Oleksandr Tyshchenko
2015-01-30 15:52 ` Julien Grall
0 siblings, 1 reply; 18+ messages in thread
From: Oleksandr Tyshchenko @ 2015-01-30 15:38 UTC (permalink / raw)
To: Ian Campbell
Cc: Julien Grall, Tim Deegan, Andrii Anisov, Stefano Stabellini,
xen-devel@lists.xen.org
Hi, Ian.
Sorry for late response.
As I understood from
http://am.renesas.com/products/soc/assp/soc_pf/index.jsp
The "R-Mobile" and "R-Car" are the different platforms designed for
different areas.
The "R-Mobile" is a new integrated platform for mobile applications.
Integrated SH-Mobile, EMMA Mobile.
http://am.renesas.com/products/soc/assp/mobile/index.jsp
The "R-Car" is a new integrated platform for car information systems.
http://am.renesas.com/products/soc/assp/automotive/index.jsp
So, It seems that RCAR2 it is not a subset of shmobile.
Sure, they might have a lot in common, the same IP blocks, etc.
But I didn't investigate carefully how similar they are. And I can't
guarantee that they are similar enough to be a single platform in Xen.
Unfortunately, I have no glue why they all reside in
arch/arm/mach-shmobile in kernel.
Maybe for historical reasons.
I can only guarantee that uart stuff from this patch series should
works on all SoCs in R-Car Gen2 family.
At the same time the Iurii can guarantee that the board file he
introduced should be
suitable for R-Car Gen2 family.
For example, such a simple thing as a formula for calculating divider
value for uart baudrate can differs from one family to
another despite the fact that these families use the same UART IP
block named SCIF (clock may be differs - ext/int, another freq).
Or FIFO size, etc.
For second example, the R-Car Gen1, R-Mobile A1 based on ARM Cortex-A9
which is ARMv6, so it doesn't support
virt extensions at all. Also, there are many other SoCs for mobile
applications in R-Mobile/SH-Mobile series
based on non-ARM SoC. I think it would be worse to assign for the
platform in Xen another name than "RCAR2".
So, I would rename "SHMOBILE" for "RCAR2".
On Wed, Jan 28, 2015 at 6:16 PM, Andrii Anisov
<andrii.anisov@globallogic.com> wrote:
> Hello Ian,
>
> When I discussed with Iurii Konovalenko about this naming during
> review I mentioned following the Linux kernel way.
>
> Shmobile within kernel is arm specific, not the same as arch/sh. In
> the kernel you would find arch/arm/mach-shmobile folder where
> Renesas'es R-CarX SoCs support reside. F.e. R8A7790 what is R-Car H2
> we have on our table. Browsing the kernel configs you will find
> shmobile not rcar as well.
>
> From other hand I do not like rcar2 naming for uart. I would prefer
> the IP block naming - scif.
>
> Andrii Anisov | Team Lead
> GlobalLogic
> Kyiv, 03038, Protasov Business Park, M.Grinchenka, 2/1
> P +38.044.492.9695x3664 M +380505738852 S andriyanisov
> www.globallogic.com
>
> http://www.globallogic.com/email_disclaimer.txt
>
> On Wed, Jan 28, 2015 at 4:16 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>>
>> On Wed, 2015-01-28 at 15:48 +0200, Oleksandr Tyshchenko wrote:
>> > Hi Ian
>> >
>> > On Wed, Jan 28, 2015 at 3:26 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> > > On Fri, 2015-01-23 at 17:33 +0200, Oleksandr Tyshchenko wrote:
>> > >> From: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
>> > >>
>> > >> Signed-off-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
>> > >> Reviewed-by: Julien Grall <julien.grall@linaro.org>
>> > >> ---
>> > >> xen/arch/arm/platforms/Makefile | 1 +
>> > >> xen/arch/arm/platforms/shmobile.c | 71 +++++++++++++++++++++++++++++++++++++++
>> > >> 2 files changed, 72 insertions(+)
>> > >> create mode 100644 xen/arch/arm/platforms/shmobile.c
>> > >>
>> > >> diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
>> > >> index 8f47c16..29e931a 100644
>> > >> --- a/xen/arch/arm/platforms/Makefile
>> > >> +++ b/xen/arch/arm/platforms/Makefile
>> > >> @@ -4,5 +4,6 @@ obj-$(CONFIG_ARM_32) += exynos5.o
>> > >> obj-$(CONFIG_ARM_32) += midway.o
>> > >> obj-$(CONFIG_ARM_32) += omap5.o
>> > >> obj-$(CONFIG_ARM_32) += sunxi.o
>> > >> +obj-$(CONFIG_ARM_32) += shmobile.o
>> > >
>> > > Everything else calls the platform rcar. How does shmobile relate to
>> > > that?
>> > Unfortunately, the author of this patch in vacation now.
>> >
>> > Perhaps Iurii took this name from kernel part (Linux/arch/arm/mach-shmobile/...)
>> > where the arch specific things for this platform is located,
>> > especially the SMP and timer support.
>> >
>> > I would rename shmobile to rcar2.
>>
>> I'd prefer us to be consistent one way or another.
>>
>> Is RCAR2 a subset of shmobile or the other way around?
>>
>> http://am.renesas.com/applications/automotive/cis/cis_highend/rcar_h2/index.jsp doesn't mention shmobile at all.
>>
>> Having determined which is the "parent"/superset my next question would
>> be how similar are the various "children" -- similar enough to be a
>> single platform in Xen, or different enough that we will need multiple
>> platforms, since that would have an impact on which name I think we
>> should pick.
>>
>> (To some extent we can fidge this since we can always git mv stuff, but
>> we should at least give it our best guess up front)
>>
>>
>> Ian.
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
--
Oleksandr Tyshchenko | Embedded Dev
GlobalLogic
www.globallogic.com
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform
2015-01-30 15:38 ` Oleksandr Tyshchenko
@ 2015-01-30 15:52 ` Julien Grall
2015-01-30 16:44 ` Oleksandr Tyshchenko
0 siblings, 1 reply; 18+ messages in thread
From: Julien Grall @ 2015-01-30 15:52 UTC (permalink / raw)
To: Oleksandr Tyshchenko, Ian Campbell
Cc: Stefano Stabellini, Tim Deegan, Andrii Anisov,
xen-devel@lists.xen.org
Hi Oleksandr,
On 30/01/15 15:38, Oleksandr Tyshchenko wrote:
> For example, such a simple thing as a formula for calculating divider
> value for uart baudrate can differs from one family to
> another despite the fact that these families use the same UART IP
> block named SCIF (clock may be differs - ext/int, another freq).
> Or FIFO size, etc.
IHMO this look more configuration than logic change in the UART driver.
We don't ask you to support all the configuration of the UART right now
;). However, if someone comes with a new platform using the SCIF, I
expect him to reuse and fix this driver rather than creating a new one.
FWIW, the compatible string is "renesas,scif" not rcar smth. So, SCIF
sounds a better name for this UART.
Regards,
--
Julien Grall
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform
2015-01-30 15:52 ` Julien Grall
@ 2015-01-30 16:44 ` Oleksandr Tyshchenko
2015-01-30 16:52 ` Julien Grall
0 siblings, 1 reply; 18+ messages in thread
From: Oleksandr Tyshchenko @ 2015-01-30 16:44 UTC (permalink / raw)
To: Julien Grall
Cc: Stefano Stabellini, Tim Deegan, Ian Campbell, Andrii Anisov,
xen-devel@lists.xen.org
On Fri, Jan 30, 2015 at 5:52 PM, Julien Grall <julien.grall@linaro.org> wrote:
> Hi Oleksandr,
Hi Julien
>
> On 30/01/15 15:38, Oleksandr Tyshchenko wrote:
>> For example, such a simple thing as a formula for calculating divider
>> value for uart baudrate can differs from one family to
>> another despite the fact that these families use the same UART IP
>> block named SCIF (clock may be differs - ext/int, another freq).
>> Or FIFO size, etc.
>
> IHMO this look more configuration than logic change in the UART driver.
> We don't ask you to support all the configuration of the UART right now
> ;). However, if someone comes with a new platform using the SCIF, I
> expect him to reuse and fix this driver rather than creating a new one.
>
> FWIW, the compatible string is "renesas,scif" not rcar smth. So, SCIF
> sounds a better name for this UART.
ok
Just to clarify:
- Should I remove all references to "R-Car Gen2" from UART stuff?
- Can I keep your "Reviewed-by" after there mechanical changes.
It would be nice to hear your and Ian's opinions about board file.
>
> Regards,
>
> --
> Julien Grall
--
Oleksandr Tyshchenko | Embedded Dev
GlobalLogic
www.globallogic.com
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform
2015-01-30 16:44 ` Oleksandr Tyshchenko
@ 2015-01-30 16:52 ` Julien Grall
2015-02-02 17:10 ` Ian Campbell
0 siblings, 1 reply; 18+ messages in thread
From: Julien Grall @ 2015-01-30 16:52 UTC (permalink / raw)
To: Oleksandr Tyshchenko
Cc: Stefano Stabellini, Tim Deegan, Ian Campbell, Andrii Anisov,
xen-devel@lists.xen.org
On 30/01/15 16:44, Oleksandr Tyshchenko wrote:
> On Fri, Jan 30, 2015 at 5:52 PM, Julien Grall <julien.grall@linaro.org> wrote:
>> Hi Oleksandr,
> Hi Julien
>
>>
>> On 30/01/15 15:38, Oleksandr Tyshchenko wrote:
>>> For example, such a simple thing as a formula for calculating divider
>>> value for uart baudrate can differs from one family to
>>> another despite the fact that these families use the same UART IP
>>> block named SCIF (clock may be differs - ext/int, another freq).
>>> Or FIFO size, etc.
>>
>> IHMO this look more configuration than logic change in the UART driver.
>> We don't ask you to support all the configuration of the UART right now
>> ;). However, if someone comes with a new platform using the SCIF, I
>> expect him to reuse and fix this driver rather than creating a new one.
>>
>> FWIW, the compatible string is "renesas,scif" not rcar smth. So, SCIF
>> sounds a better name for this UART.
> ok
>
> Just to clarify:
> - Should I remove all references to "R-Car Gen2" from UART stuff?
Yes please.
> - Can I keep your "Reviewed-by" after there mechanical changes.
Sure.
> It would be nice to hear your and Ian's opinions about board file.
I'm not sure about this one. I will let Ian decides.
Regards,
--
Julien Grall
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform
2015-01-30 16:52 ` Julien Grall
@ 2015-02-02 17:10 ` Ian Campbell
2015-02-02 17:19 ` Oleksandr Tyshchenko
0 siblings, 1 reply; 18+ messages in thread
From: Ian Campbell @ 2015-02-02 17:10 UTC (permalink / raw)
To: Julien Grall
Cc: Oleksandr Tyshchenko, Stefano Stabellini, Tim Deegan,
Andrii Anisov, xen-devel@lists.xen.org
On Fri, 2015-01-30 at 16:52 +0000, Julien Grall wrote:
> > It would be nice to hear your and Ian's opinions about board file.
>
> I'm not sure about this one. I will let Ian decides.
shmobile.c doesn't seem appropriate to me, rcar.c seems better.
Ian.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform
2015-02-02 17:10 ` Ian Campbell
@ 2015-02-02 17:19 ` Oleksandr Tyshchenko
2015-02-02 17:46 ` Ian Campbell
0 siblings, 1 reply; 18+ messages in thread
From: Oleksandr Tyshchenko @ 2015-02-02 17:19 UTC (permalink / raw)
To: Ian Campbell
Cc: Julien Grall, Tim Deegan, Andrii Anisov, Stefano Stabellini,
xen-devel@lists.xen.org
Hi, Ian.
On Mon, Feb 2, 2015 at 7:10 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Fri, 2015-01-30 at 16:52 +0000, Julien Grall wrote:
>
>> > It would be nice to hear your and Ian's opinions about board file.
>>
>> I'm not sure about this one. I will let Ian decides.
>
> shmobile.c doesn't seem appropriate to me, rcar.c seems better.
ok.
Just to clarify -> Do you mean rcar2.c?
>
> Ian.
>
--
Oleksandr Tyshchenko | Embedded Dev
GlobalLogic
www.globallogic.com
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform
2015-02-02 17:19 ` Oleksandr Tyshchenko
@ 2015-02-02 17:46 ` Ian Campbell
0 siblings, 0 replies; 18+ messages in thread
From: Ian Campbell @ 2015-02-02 17:46 UTC (permalink / raw)
To: Oleksandr Tyshchenko
Cc: Julien Grall, Tim Deegan, Andrii Anisov, Stefano Stabellini,
xen-devel@lists.xen.org
On Mon, 2015-02-02 at 19:19 +0200, Oleksandr Tyshchenko wrote:
> Hi, Ian.
>
> On Mon, Feb 2, 2015 at 7:10 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Fri, 2015-01-30 at 16:52 +0000, Julien Grall wrote:
> >
> >> > It would be nice to hear your and Ian's opinions about board file.
> >>
> >> I'm not sure about this one. I will let Ian decides.
> >
> > shmobile.c doesn't seem appropriate to me, rcar.c seems better.
> ok.
> Just to clarify -> Do you mean rcar2.c?
I'm not sure what I meant. rcar2.c sounds fine ;-)
Ian.
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2015-02-02 17:46 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-23 15:33 [PATCH v3 0/3] arm: introduce basic Renesas R-Car Gen2 platform support Oleksandr Tyshchenko
2015-01-23 15:33 ` [PATCH v3 1/3] xen/arm: Add R-Car Gen2 support for early printk Oleksandr Tyshchenko
2015-01-23 15:33 ` [PATCH v3 2/3] xen/arm: Add new driver for R-Car Gen2 UART Oleksandr Tyshchenko
2015-01-23 22:40 ` Julien Grall
2015-01-23 15:33 ` [PATCH v3 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform Oleksandr Tyshchenko
2015-01-28 13:26 ` Ian Campbell
2015-01-28 13:48 ` Oleksandr Tyshchenko
2015-01-28 14:16 ` Ian Campbell
2015-01-28 16:16 ` Andrii Anisov
2015-01-30 15:38 ` Oleksandr Tyshchenko
2015-01-30 15:52 ` Julien Grall
2015-01-30 16:44 ` Oleksandr Tyshchenko
2015-01-30 16:52 ` Julien Grall
2015-02-02 17:10 ` Ian Campbell
2015-02-02 17:19 ` Oleksandr Tyshchenko
2015-02-02 17:46 ` Ian Campbell
2015-01-23 22:36 ` [PATCH v3 0/3] arm: introduce basic Renesas R-Car Gen2 platform support Julien Grall
2015-01-23 23:08 ` Oleksandr Tyshchenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.