Re: [PATCH v2 2/3] dev/serial: Add ZYNQ_UART_[01]_BASE_ADDR
On 4/4/2024 8:19 pm, Sebastian Huber wrote: > On 28.03.24 16:48, Kinsey Moore wrote: >> This patch set looks good to me. I'd suggest a different file for the versal >> unless there's a good name that can easily cover both. > > The versal BSP doesn't use this driver and seems to have a different hardware > UART interface. It uses a BSP-specific driver: > > ./bsps/aarch64/xilinx-versal/include/dev/serial/versal-uart-regs.h > ./bsps/aarch64/xilinx-versal/include/dev/serial/versal-uart.h > ./bsps/aarch64/xilinx-versal/dev/serial/versal-uart-polled.c > ./bsps/aarch64/xilinx-versal/dev/serial/versal-uart.c > > I don't think we should mix these two currently independent drivers. > Ah yes and thanks. I think the Versal UART is based on ARM IP that XIlinx has modified. It is even worse to handle as the TX FIFO trigger does not work as expected. It needs to have half the TX FIFO loaded before TX interrupts work. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH v2 2/3] dev/serial: Add ZYNQ_UART_[01]_BASE_ADDR
On 28.03.24 16:48, Kinsey Moore wrote: This patch set looks good to me. I'd suggest a different file for the versal unless there's a good name that can easily cover both. The versal BSP doesn't use this driver and seems to have a different hardware UART interface. It uses a BSP-specific driver: ./bsps/aarch64/xilinx-versal/include/dev/serial/versal-uart-regs.h ./bsps/aarch64/xilinx-versal/include/dev/serial/versal-uart.h ./bsps/aarch64/xilinx-versal/dev/serial/versal-uart-polled.c ./bsps/aarch64/xilinx-versal/dev/serial/versal-uart.c I don't think we should mix these two currently independent drivers. -- embedded brains GmbH & Co. KG Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.hu...@embedded-brains.de phone: +49-89-18 94 741 - 16 fax: +49-89-18 94 741 - 08 Registergericht: Amtsgericht München Registernummer: HRB 157899 Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler Unsere Datenschutzerklärung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/ ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH v2 2/3] dev/serial: Add ZYNQ_UART_[01]_BASE_ADDR
This patch set looks good to me. I'd suggest a different file for the versal unless there's a good name that can easily cover both. Kinsey On Wed, Mar 27, 2024 at 9:26 PM Chris Johns wrote: > On 28/3/2024 6:43 am, Sebastian Huber wrote: > > This helps to provide a shared implementation of the kernel I/O support. > > --- > > bsps/aarch64/xilinx-zynqmp/console/console.c | 4 +- > > bsps/aarch64/xilinx-zynqmp/include/bsp.h | 2 + > > bsps/arm/xilinx-zynq/console/console-config.c | 5 +- > > bsps/arm/xilinx-zynq/include/bsp.h| 1 + > > .../console/console-config.c | 4 +- > > bsps/arm/xilinx-zynqmp-rpu/include/bsp.h | 2 + > > .../xilinx-zynqmp/console/console-config.c| 4 +- > > bsps/arm/xilinx-zynqmp/include/bsp.h | 2 + > > bsps/include/dev/serial/zynq-uart-zynq.h | 66 +++ > > bsps/include/dev/serial/zynq-uart-zynqmp.h| 66 +++ > > 10 files changed, 148 insertions(+), 8 deletions(-) > > create mode 100644 bsps/include/dev/serial/zynq-uart-zynq.h > > create mode 100644 bsps/include/dev/serial/zynq-uart-zynqmp.h > > > > diff --git a/bsps/aarch64/xilinx-zynqmp/console/console.c > b/bsps/aarch64/xilinx-zynqmp/console/console.c > > index 1e5df997e8..ce031a914e 100644 > > --- a/bsps/aarch64/xilinx-zynqmp/console/console.c > > +++ b/bsps/aarch64/xilinx-zynqmp/console/console.c > > @@ -188,11 +188,11 @@ RTEMS_SYSINIT_ITEM( > > static zynq_uart_context zynqmp_uart_instances[2] = { > >{ > > .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 0" ), > > -.regs = (volatile struct zynq_uart *) 0xff00, > > +.regs = (volatile zynq_uart *) ZYNQ_UART_0_BASE_ADDR, > > .irq = ZYNQMP_IRQ_UART_0 > >}, { > > .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 1" ), > > -.regs = (volatile struct zynq_uart *) 0xff01, > > +.regs = (volatile zynq_uart *) ZYNQ_UART_1_BASE_ADDR, > > .irq = ZYNQMP_IRQ_UART_1 > >} > > }; > > diff --git a/bsps/aarch64/xilinx-zynqmp/include/bsp.h > b/bsps/aarch64/xilinx-zynqmp/include/bsp.h > > index 0ccca8b196..38a9fad768 100644 > > --- a/bsps/aarch64/xilinx-zynqmp/include/bsp.h > > +++ b/bsps/aarch64/xilinx-zynqmp/include/bsp.h > > @@ -55,6 +55,8 @@ > > #include > > #include > > > > +#include > > + > > #ifdef __cplusplus > > extern "C" { > > #endif /* __cplusplus */ > > diff --git a/bsps/arm/xilinx-zynq/console/console-config.c > b/bsps/arm/xilinx-zynq/console/console-config.c > > index d22ceb557d..42e64ee4dd 100644 > > --- a/bsps/arm/xilinx-zynq/console/console-config.c > > +++ b/bsps/arm/xilinx-zynq/console/console-config.c > > @@ -35,15 +35,16 @@ > > > > #include > > #include > > +#include > > > > zynq_uart_context zynq_uart_instances[2] = { > >{ > > .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 0" ), > > -.regs = (volatile struct zynq_uart *) 0xe000, > > +.regs = (volatile zynq_uart *) ZYNQ_UART_0_BASE_ADDR, > > .irq = ZYNQ_IRQ_UART_0 > >}, { > > .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 1" ), > > -.regs = (volatile struct zynq_uart *) 0xe0001000, > > +.regs = (volatile zynq_uart *) ZYNQ_UART_1_BASE_ADDR, > > .irq = ZYNQ_IRQ_UART_1 > >} > > }; > > diff --git a/bsps/arm/xilinx-zynq/include/bsp.h > b/bsps/arm/xilinx-zynq/include/bsp.h > > index 3311a99b50..5ffd5f573a 100644 > > --- a/bsps/arm/xilinx-zynq/include/bsp.h > > +++ b/bsps/arm/xilinx-zynq/include/bsp.h > > @@ -55,6 +55,7 @@ > > #include > > #include > > #include > > +#include > > > > #ifdef __cplusplus > > extern "C" { > > diff --git a/bsps/arm/xilinx-zynqmp-rpu/console/console-config.c > b/bsps/arm/xilinx-zynqmp-rpu/console/console-config.c > > index eacf6ddcce..13eaa269c5 100644 > > --- a/bsps/arm/xilinx-zynqmp-rpu/console/console-config.c > > +++ b/bsps/arm/xilinx-zynqmp-rpu/console/console-config.c > > @@ -44,11 +44,11 @@ > > static zynq_uart_context zynqmp_uart_instances[2] = { > >{ > > .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 0" ), > > -.regs = (volatile struct zynq_uart *) 0xff00, > > +.regs = (volatile zynq_uart *) ZYNQ_UART_0_BASE_ADDR, > > .irq = ZYNQMP_IRQ_UART_0 > >}, { > > .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 1" ), > > -.regs = (volatile struct zynq_uart *) 0xff01, > > +.regs = (volatile zynq_uart *) ZYNQ_UART_1_BASE_ADDR, > > .irq = ZYNQMP_IRQ_UART_1 > >} > > }; > > diff --git a/bsps/arm/xilinx-zynqmp-rpu/include/bsp.h > b/bsps/arm/xilinx-zynqmp-rpu/include/bsp.h > > index e386bd4b26..d80cedbd0d 100644 > > --- a/bsps/arm/xilinx-zynqmp-rpu/include/bsp.h > > +++ b/bsps/arm/xilinx-zynqmp-rpu/include/bsp.h > > @@ -61,6 +61,8 @@ > > #include > > #include > > > > +#include > > + > > #ifdef __cplusplus > > extern "C" { > > #endif /* __cplusplus */ > > diff --git a/bsps/arm/xilinx-zynqmp/console/console-config.c > b/bsps/arm/xilinx-zynqmp
Re: [PATCH v2 2/3] dev/serial: Add ZYNQ_UART_[01]_BASE_ADDR
On 28/3/2024 6:43 am, Sebastian Huber wrote: > This helps to provide a shared implementation of the kernel I/O support. > --- > bsps/aarch64/xilinx-zynqmp/console/console.c | 4 +- > bsps/aarch64/xilinx-zynqmp/include/bsp.h | 2 + > bsps/arm/xilinx-zynq/console/console-config.c | 5 +- > bsps/arm/xilinx-zynq/include/bsp.h| 1 + > .../console/console-config.c | 4 +- > bsps/arm/xilinx-zynqmp-rpu/include/bsp.h | 2 + > .../xilinx-zynqmp/console/console-config.c| 4 +- > bsps/arm/xilinx-zynqmp/include/bsp.h | 2 + > bsps/include/dev/serial/zynq-uart-zynq.h | 66 +++ > bsps/include/dev/serial/zynq-uart-zynqmp.h| 66 +++ > 10 files changed, 148 insertions(+), 8 deletions(-) > create mode 100644 bsps/include/dev/serial/zynq-uart-zynq.h > create mode 100644 bsps/include/dev/serial/zynq-uart-zynqmp.h > > diff --git a/bsps/aarch64/xilinx-zynqmp/console/console.c > b/bsps/aarch64/xilinx-zynqmp/console/console.c > index 1e5df997e8..ce031a914e 100644 > --- a/bsps/aarch64/xilinx-zynqmp/console/console.c > +++ b/bsps/aarch64/xilinx-zynqmp/console/console.c > @@ -188,11 +188,11 @@ RTEMS_SYSINIT_ITEM( > static zynq_uart_context zynqmp_uart_instances[2] = { >{ > .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 0" ), > -.regs = (volatile struct zynq_uart *) 0xff00, > +.regs = (volatile zynq_uart *) ZYNQ_UART_0_BASE_ADDR, > .irq = ZYNQMP_IRQ_UART_0 >}, { > .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 1" ), > -.regs = (volatile struct zynq_uart *) 0xff01, > +.regs = (volatile zynq_uart *) ZYNQ_UART_1_BASE_ADDR, > .irq = ZYNQMP_IRQ_UART_1 >} > }; > diff --git a/bsps/aarch64/xilinx-zynqmp/include/bsp.h > b/bsps/aarch64/xilinx-zynqmp/include/bsp.h > index 0ccca8b196..38a9fad768 100644 > --- a/bsps/aarch64/xilinx-zynqmp/include/bsp.h > +++ b/bsps/aarch64/xilinx-zynqmp/include/bsp.h > @@ -55,6 +55,8 @@ > #include > #include > > +#include > + > #ifdef __cplusplus > extern "C" { > #endif /* __cplusplus */ > diff --git a/bsps/arm/xilinx-zynq/console/console-config.c > b/bsps/arm/xilinx-zynq/console/console-config.c > index d22ceb557d..42e64ee4dd 100644 > --- a/bsps/arm/xilinx-zynq/console/console-config.c > +++ b/bsps/arm/xilinx-zynq/console/console-config.c > @@ -35,15 +35,16 @@ > > #include > #include > +#include > > zynq_uart_context zynq_uart_instances[2] = { >{ > .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 0" ), > -.regs = (volatile struct zynq_uart *) 0xe000, > +.regs = (volatile zynq_uart *) ZYNQ_UART_0_BASE_ADDR, > .irq = ZYNQ_IRQ_UART_0 >}, { > .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 1" ), > -.regs = (volatile struct zynq_uart *) 0xe0001000, > +.regs = (volatile zynq_uart *) ZYNQ_UART_1_BASE_ADDR, > .irq = ZYNQ_IRQ_UART_1 >} > }; > diff --git a/bsps/arm/xilinx-zynq/include/bsp.h > b/bsps/arm/xilinx-zynq/include/bsp.h > index 3311a99b50..5ffd5f573a 100644 > --- a/bsps/arm/xilinx-zynq/include/bsp.h > +++ b/bsps/arm/xilinx-zynq/include/bsp.h > @@ -55,6 +55,7 @@ > #include > #include > #include > +#include > > #ifdef __cplusplus > extern "C" { > diff --git a/bsps/arm/xilinx-zynqmp-rpu/console/console-config.c > b/bsps/arm/xilinx-zynqmp-rpu/console/console-config.c > index eacf6ddcce..13eaa269c5 100644 > --- a/bsps/arm/xilinx-zynqmp-rpu/console/console-config.c > +++ b/bsps/arm/xilinx-zynqmp-rpu/console/console-config.c > @@ -44,11 +44,11 @@ > static zynq_uart_context zynqmp_uart_instances[2] = { >{ > .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 0" ), > -.regs = (volatile struct zynq_uart *) 0xff00, > +.regs = (volatile zynq_uart *) ZYNQ_UART_0_BASE_ADDR, > .irq = ZYNQMP_IRQ_UART_0 >}, { > .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 1" ), > -.regs = (volatile struct zynq_uart *) 0xff01, > +.regs = (volatile zynq_uart *) ZYNQ_UART_1_BASE_ADDR, > .irq = ZYNQMP_IRQ_UART_1 >} > }; > diff --git a/bsps/arm/xilinx-zynqmp-rpu/include/bsp.h > b/bsps/arm/xilinx-zynqmp-rpu/include/bsp.h > index e386bd4b26..d80cedbd0d 100644 > --- a/bsps/arm/xilinx-zynqmp-rpu/include/bsp.h > +++ b/bsps/arm/xilinx-zynqmp-rpu/include/bsp.h > @@ -61,6 +61,8 @@ > #include > #include > > +#include > + > #ifdef __cplusplus > extern "C" { > #endif /* __cplusplus */ > diff --git a/bsps/arm/xilinx-zynqmp/console/console-config.c > b/bsps/arm/xilinx-zynqmp/console/console-config.c > index ea148836a5..787ee05dd6 100644 > --- a/bsps/arm/xilinx-zynqmp/console/console-config.c > +++ b/bsps/arm/xilinx-zynqmp/console/console-config.c > @@ -44,11 +44,11 @@ > static zynq_uart_context zynqmp_uart_instances[2] = { >{ > .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 0" ), > -.regs = (volatile struct zynq_uart *) 0xff00, > +.regs