[PATCH v1 1/3] bsps: Move zynq-uart to bsps/shared

Kinsey Moore kinsey.moore at oarcorp.com
Tue Dec 1 20:57:53 UTC 2020


This moves the zynq-uart driver from bsps/arm/shared to bsps/shared to
accomodate use by AArch64 BSPs.
---
 bsps/arm/headers.am                                        | 2 --
 bsps/arm/xilinx-zynq/console/console-config.c              | 2 +-
 bsps/arm/xilinx-zynq/console/console-init.c                | 2 +-
 bsps/arm/xilinx-zynq/console/debug-console.c               | 2 +-
 bsps/arm/xilinx-zynq/include/bsp.h                         | 2 +-
 bsps/arm/xilinx-zynq/start/bspreset.c                      | 2 +-
 bsps/arm/xilinx-zynqmp/console/console-config.c            | 2 +-
 bsps/headers.am                                            | 2 ++
 .../include/bsp => include/dev/serial}/zynq-uart-regs.h    | 0
 bsps/{arm/include/bsp => include/dev/serial}/zynq-uart.h   | 7 +++++++
 bsps/{arm/shared => shared/dev}/serial/zynq-uart-polled.c  | 4 ++--
 bsps/{arm/shared => shared/dev}/serial/zynq-uart.c         | 4 ++--
 c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am               | 4 ++--
 c/src/lib/libbsp/arm/xilinx-zynqmp/Makefile.am             | 4 ++--
 spec/build/bsps/arm/grp.yml                                | 2 --
 spec/build/bsps/arm/xilinx-zynq/obj.yml                    | 2 --
 spec/build/bsps/arm/xilinx-zynqmp/bspxilinxzynqmp.yml      | 2 --
 spec/build/bsps/obj.yml                                    | 4 ++++
 18 files changed, 27 insertions(+), 22 deletions(-)
 rename bsps/{arm/include/bsp => include/dev/serial}/zynq-uart-regs.h (100%)
 rename bsps/{arm/include/bsp => include/dev/serial}/zynq-uart.h (93%)
 rename bsps/{arm/shared => shared/dev}/serial/zynq-uart-polled.c (98%)
 rename bsps/{arm/shared => shared/dev}/serial/zynq-uart.c (98%)

diff --git a/bsps/arm/headers.am b/bsps/arm/headers.am
index bff9a16fc8..a4d6dfa09e 100644
--- a/bsps/arm/headers.am
+++ b/bsps/arm/headers.am
@@ -31,8 +31,6 @@ include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/lpc-i2s.h
 include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/lpc-lcd.h
 include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/lpc-timer.h
 include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/start.h
-include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/zynq-uart-regs.h
-include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/zynq-uart.h
 
 include_libcpudir = $(includedir)/libcpu
 include_libcpu_HEADERS =
diff --git a/bsps/arm/xilinx-zynq/console/console-config.c b/bsps/arm/xilinx-zynq/console/console-config.c
index 7e28716bbe..0581247a2d 100644
--- a/bsps/arm/xilinx-zynq/console/console-config.c
+++ b/bsps/arm/xilinx-zynq/console/console-config.c
@@ -26,7 +26,7 @@
  */
 
 #include <bsp/irq.h>
-#include <bsp/zynq-uart.h>
+#include <dev/serial/zynq-uart.h>
 
 zynq_uart_context zynq_uart_instances[2] = {
   {
diff --git a/bsps/arm/xilinx-zynq/console/console-init.c b/bsps/arm/xilinx-zynq/console/console-init.c
index 72ba27006c..a3659e3906 100644
--- a/bsps/arm/xilinx-zynq/console/console-init.c
+++ b/bsps/arm/xilinx-zynq/console/console-init.c
@@ -28,7 +28,7 @@
 #include <rtems/console.h>
 
 #include <bsp.h>
-#include <bsp/zynq-uart.h>
+#include <dev/serial/zynq-uart.h>
 
 rtems_status_code console_initialize(
   rtems_device_major_number major,
diff --git a/bsps/arm/xilinx-zynq/console/debug-console.c b/bsps/arm/xilinx-zynq/console/debug-console.c
index 809fd6830d..0e9b756f30 100644
--- a/bsps/arm/xilinx-zynq/console/debug-console.c
+++ b/bsps/arm/xilinx-zynq/console/debug-console.c
@@ -29,7 +29,7 @@
 #include <rtems/sysinit.h>
 
 #include <bsp.h>
-#include <bsp/zynq-uart.h>
+#include <dev/serial/zynq-uart.h>
 
 #include <bspopts.h>
 
diff --git a/bsps/arm/xilinx-zynq/include/bsp.h b/bsps/arm/xilinx-zynq/include/bsp.h
index 6c2759ce50..fde8d03130 100644
--- a/bsps/arm/xilinx-zynq/include/bsp.h
+++ b/bsps/arm/xilinx-zynq/include/bsp.h
@@ -54,7 +54,7 @@
 
 #include <bsp/default-initial-extension.h>
 #include <bsp/start.h>
-#include <bsp/zynq-uart.h>
+#include <dev/serial/zynq-uart.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/bsps/arm/xilinx-zynq/start/bspreset.c b/bsps/arm/xilinx-zynq/start/bspreset.c
index e0c81ca2ef..3e797a137e 100644
--- a/bsps/arm/xilinx-zynq/start/bspreset.c
+++ b/bsps/arm/xilinx-zynq/start/bspreset.c
@@ -27,7 +27,7 @@
 
 #include <bsp.h>
 #include <bsp/bootcard.h>
-#include <bsp/zynq-uart.h>
+#include <dev/serial/zynq-uart.h>
 
 void bsp_reset(void)
 {
diff --git a/bsps/arm/xilinx-zynqmp/console/console-config.c b/bsps/arm/xilinx-zynqmp/console/console-config.c
index a525f9c565..fb0b003c83 100644
--- a/bsps/arm/xilinx-zynqmp/console/console-config.c
+++ b/bsps/arm/xilinx-zynqmp/console/console-config.c
@@ -35,7 +35,7 @@
 #include <rtems/sysinit.h>
 
 #include <bsp/irq.h>
-#include <bsp/zynq-uart.h>
+#include <dev/serial/zynq-uart.h>
 
 #include <bspopts.h>
 
diff --git a/bsps/headers.am b/bsps/headers.am
index b433c2d8d4..8147745711 100644
--- a/bsps/headers.am
+++ b/bsps/headers.am
@@ -32,6 +32,8 @@ include_dev_serialdir = $(includedir)/dev/serial
 include_dev_serial_HEADERS =
 include_dev_serial_HEADERS += ../../bsps/include/dev/serial/arm-pl011-regs.h
 include_dev_serial_HEADERS += ../../bsps/include/dev/serial/arm-pl011.h
+include_dev_serial_HEADERS += ../../bsps/include/dev/serial/zynq-uart-regs.h
+include_dev_serial_HEADERS += ../../bsps/include/dev/serial/zynq-uart.h
 
 include_grlibdir = $(includedir)/grlib
 include_grlib_HEADERS =
diff --git a/bsps/arm/include/bsp/zynq-uart-regs.h b/bsps/include/dev/serial/zynq-uart-regs.h
similarity index 100%
rename from bsps/arm/include/bsp/zynq-uart-regs.h
rename to bsps/include/dev/serial/zynq-uart-regs.h
diff --git a/bsps/arm/include/bsp/zynq-uart.h b/bsps/include/dev/serial/zynq-uart.h
similarity index 93%
rename from bsps/arm/include/bsp/zynq-uart.h
rename to bsps/include/dev/serial/zynq-uart.h
index 20c3c9b653..2c0f250a3a 100644
--- a/bsps/arm/include/bsp/zynq-uart.h
+++ b/bsps/include/dev/serial/zynq-uart.h
@@ -44,6 +44,9 @@ extern "C" {
  * @defgroup zynq_uart UART Support
  * @ingroup RTEMSBSPsARMZynq
  * @brief UART Support
+ *
+ * This driver operates an instance of the Cadence UART present in the
+ * family of Xilinx Zynq SoCs.
  */
 
 typedef struct {
@@ -57,6 +60,10 @@ extern const rtems_termios_device_handler zynq_uart_handler;
 
 #define ZYNQ_UART_DEFAULT_BAUD 115200
 
+#ifndef ZYNQ_CLOCK_UART
+#define ZYNQ_CLOCK_UART 100000000
+#endif
+
 void zynq_uart_initialize(rtems_termios_device_context *base);
 
 int zynq_uart_read_polled(rtems_termios_device_context *base);
diff --git a/bsps/arm/shared/serial/zynq-uart-polled.c b/bsps/shared/dev/serial/zynq-uart-polled.c
similarity index 98%
rename from bsps/arm/shared/serial/zynq-uart-polled.c
rename to bsps/shared/dev/serial/zynq-uart-polled.c
index e6f478ee07..a1b51ea521 100644
--- a/bsps/arm/shared/serial/zynq-uart-polled.c
+++ b/bsps/shared/dev/serial/zynq-uart-polled.c
@@ -25,8 +25,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <bsp/zynq-uart.h>
-#include <bsp/zynq-uart-regs.h>
+#include <dev/serial/zynq-uart.h>
+#include <dev/serial/zynq-uart-regs.h>
 
 #include <bspopts.h>
 
diff --git a/bsps/arm/shared/serial/zynq-uart.c b/bsps/shared/dev/serial/zynq-uart.c
similarity index 98%
rename from bsps/arm/shared/serial/zynq-uart.c
rename to bsps/shared/dev/serial/zynq-uart.c
index fc670441b8..41adb196ab 100644
--- a/bsps/arm/shared/serial/zynq-uart.c
+++ b/bsps/shared/dev/serial/zynq-uart.c
@@ -25,8 +25,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <bsp/zynq-uart.h>
-#include <bsp/zynq-uart-regs.h>
+#include <dev/serial/zynq-uart.h>
+#include <dev/serial/zynq-uart-regs.h>
 #include <bsp/irq.h>
 
 #include <bspopts.h>
diff --git a/c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am b/c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am
index cfd59475c2..299e69c128 100644
--- a/c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am
+++ b/c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am
@@ -62,8 +62,8 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/console-termio
 librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/xilinx-zynq/console/console-config.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/xilinx-zynq/console/console-init.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/xilinx-zynq/console/debug-console.c
-librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/serial/zynq-uart.c
-librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/serial/zynq-uart-polled.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/zynq-uart.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/zynq-uart-polled.c
 
 # Clock
 librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/clock/clock-a9mpcore.c
diff --git a/c/src/lib/libbsp/arm/xilinx-zynqmp/Makefile.am b/c/src/lib/libbsp/arm/xilinx-zynqmp/Makefile.am
index ac67c60e93..f689c2e294 100644
--- a/c/src/lib/libbsp/arm/xilinx-zynqmp/Makefile.am
+++ b/c/src/lib/libbsp/arm/xilinx-zynqmp/Makefile.am
@@ -60,8 +60,8 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/irq/irq-gic.c
 # Console
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/console-termios.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/xilinx-zynqmp/console/console-config.c
-librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/serial/zynq-uart.c
-librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/serial/zynq-uart-polled.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/zynq-uart.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/zynq-uart-polled.c
 
 # Clock
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/clock/arm-generic-timer.c
diff --git a/spec/build/bsps/arm/grp.yml b/spec/build/bsps/arm/grp.yml
index dd7694be83..8d2aba12ca 100644
--- a/spec/build/bsps/arm/grp.yml
+++ b/spec/build/bsps/arm/grp.yml
@@ -36,8 +36,6 @@ install:
   - bsps/arm/include/bsp/lpc-lcd.h
   - bsps/arm/include/bsp/lpc-timer.h
   - bsps/arm/include/bsp/start.h
-  - bsps/arm/include/bsp/zynq-uart-regs.h
-  - bsps/arm/include/bsp/zynq-uart.h
 - destination: ${BSP_INCLUDEDIR}/dev/irq
   source:
   - bsps/include/dev/irq/arm-gic-irq.h
diff --git a/spec/build/bsps/arm/xilinx-zynq/obj.yml b/spec/build/bsps/arm/xilinx-zynq/obj.yml
index 6f7f8ab39a..06e13e4ea1 100644
--- a/spec/build/bsps/arm/xilinx-zynq/obj.yml
+++ b/spec/build/bsps/arm/xilinx-zynq/obj.yml
@@ -25,8 +25,6 @@ source:
 - bsps/arm/shared/cp15/arm-cp15-set-exception-handler.c
 - bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c
 - bsps/arm/shared/irq/irq-gic.c
-- bsps/arm/shared/serial/zynq-uart.c
-- bsps/arm/shared/serial/zynq-uart-polled.c
 - bsps/arm/shared/start/bsp-start-memcpy.S
 - bsps/arm/xilinx-zynq/console/console-config.c
 - bsps/arm/xilinx-zynq/console/console-init.c
diff --git a/spec/build/bsps/arm/xilinx-zynqmp/bspxilinxzynqmp.yml b/spec/build/bsps/arm/xilinx-zynqmp/bspxilinxzynqmp.yml
index ea3895ab99..8c8013db24 100644
--- a/spec/build/bsps/arm/xilinx-zynqmp/bspxilinxzynqmp.yml
+++ b/spec/build/bsps/arm/xilinx-zynqmp/bspxilinxzynqmp.yml
@@ -80,8 +80,6 @@ source:
 - bsps/arm/shared/cp15/arm-cp15-set-exception-handler.c
 - bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c
 - bsps/arm/shared/irq/irq-gic.c
-- bsps/arm/shared/serial/zynq-uart.c
-- bsps/arm/shared/serial/zynq-uart-polled.c
 - bsps/arm/shared/start/bsp-start-memcpy.S
 - bsps/arm/xilinx-zynqmp/console/console-config.c
 - bsps/arm/xilinx-zynqmp/start/bspreset.c
diff --git a/spec/build/bsps/obj.yml b/spec/build/bsps/obj.yml
index a454783d51..7ea560b47d 100644
--- a/spec/build/bsps/obj.yml
+++ b/spec/build/bsps/obj.yml
@@ -52,6 +52,8 @@ install:
   source:
   - bsps/include/dev/serial/arm-pl011-regs.h
   - bsps/include/dev/serial/arm-pl011.h
+  - bsps/include/dev/serial/zynq-uart-regs.h
+  - bsps/include/dev/serial/zynq-uart.h
 - destination: ${BSP_INCLUDEDIR}/rtems/zilog
   source:
   - bsps/include/rtems/zilog/z8036.h
@@ -94,6 +96,8 @@ source:
 - bsps/shared/dev/serial/ns16550.c
 - bsps/shared/dev/serial/ns16550-context.c
 - bsps/shared/dev/serial/serprobe.c
+- bsps/shared/dev/serial/zynq-uart.c
+- bsps/shared/dev/serial/zynq-uart-polled.c
 - bsps/shared/start/bootcard.c
 - bsps/shared/rtems-version.c
 type: build
-- 
2.20.1



More information about the devel mailing list