Add support for Xilinx ZynqMP SoC
v2 cover Add support for Xilinx ZynqMP SoC
From: "Edgar E. Iglesias" <[email protected]>
Adds support for the Cadence UART in Xilinx ZynqMP. The rest of the ZynqMP platform is discovered via device-tree.
Cheers,
Edgar
Changelog:
v1 -> v2:
* Rebase with upstream/staging to fix the device-tree device matching. (Ian review)
Edgar E. Iglesias (2):
xen/arm: Add Cadence UART driver
xen/arm: Add Xilinx ZynqMP early printk support
config/arm64.mk | 1 + docs/misc/arm/early-printk.txt | 1 + xen/arch/arm/Rules.mk | 6 + xen/arch/arm/arm64/debug-cadence.inc | 45 +++++++ xen/drivers/char/Makefile | 1 + xen/drivers/char/cadence-uart.c | 222 +++++++++++++++++++++++++++++++++++ xen/include/asm-arm/cadence-uart.h | 55 +++++++++ 7 files changed, 331 insertions(+) create mode 100644 xen/arch/arm/arm64/debug-cadence.inc create mode 100644 xen/drivers/char/cadence-uart.c create mode 100644 xen/include/asm-arm/cadence-uart.h
Signature · 1 line
1.9.1
PATCH v2 1/2 xen/arm: Add Cadence UART driver
--- config/arm64.mk | 1 + xen/drivers/char/Makefile | 1 + xen/drivers/char/cadence-uart.c | 222 +++++++++++++++++++++++++++++++++++++ xen/include/asm-arm/cadence-uart.h | 55 +++++++++ 4 files changed, 279 insertions(+) create mode 100644 xen/drivers/char/cadence-uart.c create mode 100644 xen/include/asm-arm/cadence-uart.h
config/arm64.mk +1 -0
@@ -7,6 +7,7 @@ CONFIG_XEN_INSTALL_SUFFIX := CFLAGS += #-marm -march= -mcpu= etc HAS_PL011 := y +HAS_CADENCE_UART := y HAS_NS16550 := y # Use only if calling $(LD) directly.
xen/drivers/char/Makefile +1 -0
@@ -1,5 +1,6 @@ obj-y += console.o obj-$(HAS_NS16550) += ns16550.o +obj-$(HAS_CADENCE_UART) += cadence-uart.o obj-$(HAS_PL011) += pl011.o obj-$(HAS_EXYNOS4210) += exynos4210-uart.o obj-$(HAS_OMAP) += omap-uart.o
xen/drivers/char/cadence-uart.c new file +222 -0
222 lines not on this page · raw message
xen/include/asm-arm/cadence-uart.h new file +55 -0
55 lines not on this page · raw message
Signature · 1 line
1.9.1
Re: [PATCH v2 1/2] xen/arm: Add Cadence UART driver
Hi Edgar,
Quoted 13 lines · Edgar E. Iglesias
xen/drivers/char/cadence-uart.c new file +13
-0+#define cuart_read (uart, off) readl((uart)->regs + (off)) +#define cuart_write (uart, off,val) writel((val), (uart)->regs + (off)) + +static void cuart_interrupt (int irq,void *data,struct cpu_user_regs *regs) +{ +struct serial_port *port = data; +struct cuart *uart = port->uart; +unsigned int status; + + do { + status = cuart_read(uart, R_UART_SR); + /* ACK. */ + if (status & UART_SR_INTR_RTRIG) {
[..]
xen/drivers/char/cadence-uart.c line 75
Quoted 6 lines
xen/drivers/char/cadence-uart.c new file +6
-0+static void __init cuart_init_postirq (struct serial_port *port) +{ +struct cuart *uart = port->uart; +int rc; + +if ( uart->irq >0 ) {
Can you be consistent with the coding style? Either use Linux or Xen one but not a mix of them.
Regards,
Signature · 1 line
Julien Grall
Re: [PATCH v2 1/2] xen/arm: Add Cadence UART driver
Quoted 1 line · Julien Grall
Hi Edgar,
Hi Julien,
Quoted 19 lines · Edgar E. Iglesias
Quoted 13 lines
xen/drivers/char/cadence-uart.c new file +13
-0+#define cuart_read (uart, off) readl((uart)->regs + (off)) +#define cuart_write (uart, off,val) writel((val), (uart)->regs + (off)) + +static void cuart_interrupt (int irq,void *data,struct cpu_user_regs *regs) +{ +struct serial_port *port = data; +struct cuart *uart = port->uart; +unsigned int status; + + do { + status = cuart_read(uart, R_UART_SR); + /* ACK. */ + if (status & UART_SR_INTR_RTRIG) {[..]
Quoted 9 lines
xen/drivers/char/cadence-uart.c line 75
Quoted 6 lines
xen/drivers/char/cadence-uart.c new file +6
-0+static void __init cuart_init_postirq (struct serial_port *port) +{ +struct cuart *uart = port->uart; +int rc; + +if ( uart->irq >0 ) {Can you be consistent with the coding style? Either use Linux or Xen one but not a mix of them.
Yes, I'll fix it up and send a v3.
Thanks,
Edgar
PATCH v2 2/2 xen/arm: Add Xilinx ZynqMP early printk support
In reply to Edgar E. IglesiasFrom: "Edgar E. Iglesias" <[email protected]>
--- docs/misc/arm/early-printk.txt | 1 + xen/arch/arm/Rules.mk | 6 +++++ xen/arch/arm/arm64/debug-cadence.inc | 45 ++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 xen/arch/arm/arm64/debug-cadence.inc
docs/misc/arm/early-printk.txt +1 -0
@@ -21,6 +21,7 @@ where mach is the name of the machine: - seattle: printk with pl011 for AMD Seattle processor - lager: printk with SCIF0 on Renesas R-Car H2 processors - thunderx: printk with pl011 for Cavium ThunderX processor + - zynqmp: printk with Cadence UART for Xilinx ZynqMP SoCs The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk, see there when adding support for new machines.
xen/arch/arm/Rules.mk +6 -0
@@ -118,6 +118,12 @@ EARLY_PRINTK_INC := pl011 EARLY_UART_BASE_ADDRESS := 0x87e024000000 endif +ifeq ($(CONFIG_EARLY_PRINTK), zynqmp) +EARLY_PRINTK_INC := cadence +EARLY_PRINTK_BAUD := 115200 +EARLY_UART_BASE_ADDRESS := 0xff000000 +endif + ifneq ($(EARLY_PRINTK_INC),) EARLY_PRINTK := y endif
xen/arch/arm/arm64/debug-cadence.inc new file +45 -0
45 lines not on this page · raw message
Signature · 1 line
1.9.1
Re: [PATCH v2 2/2] xen/arm: Add Xilinx ZynqMP early printk support
Hi Edgar,
Quoted 3 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Signed-off-by Edgar E. Iglesias <[email protected]>
Regards,
Signature · 1 line
Julien Grall