[PATCH v2 1/8] Move ARM PL011 UART driver

Kinsey Moore kinsey.moore at oarcorp.com
Mon Sep 28 15:24:50 UTC 2020


This UART driver is now needed for BSPs other than ARM.
---
 bsps/arm/headers.am                                        | 2 --
 bsps/arm/raspberrypi/console/console-config.c              | 2 +-
 bsps/arm/realview-pbx-a9/include/bsp/console.h             | 2 +-
 bsps/arm/xen/console/console.c                             | 2 +-
 bsps/headers.am                                            | 2 ++
 bsps/{arm/include/bsp => include/libchip}/arm-pl011-regs.h | 0
 bsps/{arm/include/bsp => include/libchip}/arm-pl011.h      | 2 +-
 bsps/{arm/shared => shared/dev}/serial/arm-pl011.c         | 2 +-
 c/src/lib/libbsp/arm/raspberrypi/Makefile.am               | 2 +-
 c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am           | 2 +-
 c/src/lib/libbsp/arm/xen/Makefile.am                       | 2 +-
 spec/build/bsps/arm/grp.yml                                | 2 --
 spec/build/bsps/arm/raspberrypi/obj.yml                    | 1 -
 spec/build/bsps/arm/realview-pbx-a9/bsprealviewpbxa9.yml   | 1 -
 spec/build/bsps/arm/xen/bspxen.yml                         | 1 -
 spec/build/bsps/obj.yml                                    | 3 +++
 16 files changed, 13 insertions(+), 15 deletions(-)
 rename bsps/{arm/include/bsp => include/libchip}/arm-pl011-regs.h (100%)
 rename bsps/{arm/include/bsp => include/libchip}/arm-pl011.h (96%)
 rename bsps/{arm/shared => shared/dev}/serial/arm-pl011.c (98%)

diff --git a/bsps/arm/headers.am b/bsps/arm/headers.am
index 3d2b09effa..f0d498c8f4 100644
--- a/bsps/arm/headers.am
+++ b/bsps/arm/headers.am
@@ -21,8 +21,6 @@ include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-gic-irq.h
 include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-gic-regs.h
 include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-gic-tm27.h
 include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-gic.h
-include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-pl011-regs.h
-include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-pl011.h
 include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-pl050-regs.h
 include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-pl050.h
 include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-pl111-fb.h
diff --git a/bsps/arm/raspberrypi/console/console-config.c b/bsps/arm/raspberrypi/console/console-config.c
index bb0b596019..27d02bbe39 100644
--- a/bsps/arm/raspberrypi/console/console-config.c
+++ b/bsps/arm/raspberrypi/console/console-config.c
@@ -25,13 +25,13 @@
 #include <libchip/serial.h>
 #include <libfdt.h>
 #include <libchip/ns16550.h>
+#include <libchip/arm-pl011.h>
 
 #include <bspopts.h>
 #include <bsp/usart.h>
 #include <bsp/raspberrypi.h>
 #include <bsp/fbcons.h>
 #include <bsp.h>
-#include <bsp/arm-pl011.h>
 #include <bsp/console-termios.h>
 #include <bsp/fdt.h>
 #include <bsp/fatal.h>
diff --git a/bsps/arm/realview-pbx-a9/include/bsp/console.h b/bsps/arm/realview-pbx-a9/include/bsp/console.h
index da2e4099e2..0ed99ec86e 100644
--- a/bsps/arm/realview-pbx-a9/include/bsp/console.h
+++ b/bsps/arm/realview-pbx-a9/include/bsp/console.h
@@ -15,7 +15,7 @@
 #ifndef LIBBSP_ARM_REALVIEW_PBX_A9_BSP_CONSOLE_H
 #define LIBBSP_ARM_REALVIEW_PBX_A9_BSP_CONSOLE_H
 
-#include <bsp/arm-pl011.h>
+#include <libchip/arm-pl011.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/bsps/arm/xen/console/console.c b/bsps/arm/xen/console/console.c
index 786b98f3ba..446bd2c3b8 100644
--- a/bsps/arm/xen/console/console.c
+++ b/bsps/arm/xen/console/console.c
@@ -29,7 +29,7 @@
 #include <rtems/bspIo.h>
 
 #include <bsp.h>
-#include <bsp/arm-pl011.h>
+#include <libchip/arm-pl011.h>
 #include <bsp/console-termios.h>
 #include <bsp/irq-generic.h>
 
diff --git a/bsps/headers.am b/bsps/headers.am
index 5af7e43b4a..825574a5a9 100644
--- a/bsps/headers.am
+++ b/bsps/headers.am
@@ -110,6 +110,8 @@ include_libchip_HEADERS += ../../bsps/include/libchip/mc68681.h
 include_libchip_HEADERS += ../../bsps/include/libchip/ns16550.h
 include_libchip_HEADERS += ../../bsps/include/libchip/ns16550_p.h
 include_libchip_HEADERS += ../../bsps/include/libchip/open_eth.h
+include_libchip_HEADERS += ../../bsps/include/libchip/arm-pl011-regs.h
+include_libchip_HEADERS += ../../bsps/include/libchip/arm-pl011.h
 include_libchip_HEADERS += ../../bsps/include/libchip/rtc.h
 include_libchip_HEADERS += ../../bsps/include/libchip/serial.h
 include_libchip_HEADERS += ../../bsps/include/libchip/sersupp.h
diff --git a/bsps/arm/include/bsp/arm-pl011-regs.h b/bsps/include/libchip/arm-pl011-regs.h
similarity index 100%
rename from bsps/arm/include/bsp/arm-pl011-regs.h
rename to bsps/include/libchip/arm-pl011-regs.h
diff --git a/bsps/arm/include/bsp/arm-pl011.h b/bsps/include/libchip/arm-pl011.h
similarity index 96%
rename from bsps/arm/include/bsp/arm-pl011.h
rename to bsps/include/libchip/arm-pl011.h
index 49ff413581..947c254bd8 100644
--- a/bsps/arm/include/bsp/arm-pl011.h
+++ b/bsps/include/libchip/arm-pl011.h
@@ -25,7 +25,7 @@
 
 #include <rtems/termiostypes.h>
 
-#include <bsp/arm-pl011-regs.h>
+#include <libchip/arm-pl011-regs.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/bsps/arm/shared/serial/arm-pl011.c b/bsps/shared/dev/serial/arm-pl011.c
similarity index 98%
rename from bsps/arm/shared/serial/arm-pl011.c
rename to bsps/shared/dev/serial/arm-pl011.c
index 44a409e551..39225e8349 100644
--- a/bsps/arm/shared/serial/arm-pl011.c
+++ b/bsps/shared/dev/serial/arm-pl011.c
@@ -12,7 +12,7 @@
  * http://www.rtems.org/license/LICENSE.
  */
 
-#include <bsp/arm-pl011.h>
+#include <libchip/arm-pl011.h>
 
 static volatile pl011 *pl011_get_regs(rtems_termios_device_context *base)
 {
diff --git a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
index 48c346d3a3..01f44a7636 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
+++ b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
@@ -64,7 +64,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/raspberrypi/irq/irq.c
 
 # Console
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/console-termios.c
-librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/serial/arm-pl011.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/arm-pl011.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/raspberrypi/console/console-config.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/raspberrypi/console/fb.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/raspberrypi/console/fbcons.c
diff --git a/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am b/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am
index d5549275be..77b7db4cca 100644
--- a/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am
+++ b/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am
@@ -62,7 +62,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/irq/irq-gic.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/console-termios-init.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/console-termios.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/getserialmouseps2.c
-librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/serial/arm-pl011.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/arm-pl011.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/serial/arm-pl050.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/realview-pbx-a9/console/console-config.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/realview-pbx-a9/console/console-polled.c
diff --git a/c/src/lib/libbsp/arm/xen/Makefile.am b/c/src/lib/libbsp/arm/xen/Makefile.am
index fecb665af4..18cce5ec29 100644
--- a/c/src/lib/libbsp/arm/xen/Makefile.am
+++ b/c/src/lib/libbsp/arm/xen/Makefile.am
@@ -39,7 +39,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/irq/irq-gic.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/xen/console/console.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/console-termios.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/console-termios-init.c
-librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/serial/arm-pl011.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/arm-pl011.c
 # timer
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/btimer/btimer-stub.c
 
diff --git a/spec/build/bsps/arm/grp.yml b/spec/build/bsps/arm/grp.yml
index 2bf0b82423..b6fcb56a25 100644
--- a/spec/build/bsps/arm/grp.yml
+++ b/spec/build/bsps/arm/grp.yml
@@ -26,8 +26,6 @@ install:
   - bsps/arm/include/bsp/arm-gic-regs.h
   - bsps/arm/include/bsp/arm-gic-tm27.h
   - bsps/arm/include/bsp/arm-gic.h
-  - bsps/arm/include/bsp/arm-pl011-regs.h
-  - bsps/arm/include/bsp/arm-pl011.h
   - bsps/arm/include/bsp/arm-pl050-regs.h
   - bsps/arm/include/bsp/arm-pl050.h
   - bsps/arm/include/bsp/arm-pl111-fb.h
diff --git a/spec/build/bsps/arm/raspberrypi/obj.yml b/spec/build/bsps/arm/raspberrypi/obj.yml
index 45180cdd5f..a120d8007b 100644
--- a/spec/build/bsps/arm/raspberrypi/obj.yml
+++ b/spec/build/bsps/arm/raspberrypi/obj.yml
@@ -47,7 +47,6 @@ source:
 - bsps/arm/shared/cache/cache-v7ar-disable-data.S
 - bsps/arm/shared/cp15/arm-cp15-set-exception-handler.c
 - bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c
-- bsps/arm/shared/serial/arm-pl011.c
 - bsps/arm/shared/start/bsp-start-memcpy.S
 - bsps/shared/dev/cpucounter/cpucounterfrequency.c
 - bsps/shared/dev/cpucounter/cpucounterread.c
diff --git a/spec/build/bsps/arm/realview-pbx-a9/bsprealviewpbxa9.yml b/spec/build/bsps/arm/realview-pbx-a9/bsprealviewpbxa9.yml
index 2721152b93..9b24f8eae2 100644
--- a/spec/build/bsps/arm/realview-pbx-a9/bsprealviewpbxa9.yml
+++ b/spec/build/bsps/arm/realview-pbx-a9/bsprealviewpbxa9.yml
@@ -68,7 +68,6 @@ source:
 - bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c
 - bsps/arm/shared/fb/arm-pl111.c
 - bsps/arm/shared/irq/irq-gic.c
-- bsps/arm/shared/serial/arm-pl011.c
 - bsps/arm/shared/serial/arm-pl050.c
 - bsps/arm/shared/start/bsp-start-memcpy.S
 - bsps/shared/dev/btimer/btimer-stub.c
diff --git a/spec/build/bsps/arm/xen/bspxen.yml b/spec/build/bsps/arm/xen/bspxen.yml
index e469170e34..df14fcce66 100644
--- a/spec/build/bsps/arm/xen/bspxen.yml
+++ b/spec/build/bsps/arm/xen/bspxen.yml
@@ -60,7 +60,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/arm-pl011.c
 - bsps/arm/shared/start/bsp-start-memcpy.S
 - bsps/arm/xen/console/console.c
 - bsps/arm/xen/start/bspstart.c
diff --git a/spec/build/bsps/obj.yml b/spec/build/bsps/obj.yml
index 8809238057..b456116226 100644
--- a/spec/build/bsps/obj.yml
+++ b/spec/build/bsps/obj.yml
@@ -27,6 +27,8 @@ install:
 - destination: ${BSP_INCLUDEDIR}/libchip
   source:
   - bsps/include/libchip/am29lv160.h
+  - bsps/include/libchip/arm-pl011-regs.h
+  - bsps/include/libchip/arm-pl011.h
   - bsps/include/libchip/ata.h
   - bsps/include/libchip/ata_internal.h
   - bsps/include/libchip/disp_hcms29xx.h
@@ -91,6 +93,7 @@ source:
 - bsps/shared/dev/rtc/mc146818a.c
 - bsps/shared/dev/rtc/mc146818a_ioreg.c
 - bsps/shared/dev/rtc/rtcprobe.c
+- bsps/shared/dev/serial/arm-pl011.c
 - bsps/shared/dev/serial/mc68681_baud.c
 - bsps/shared/dev/serial/mc68681.c
 - bsps/shared/dev/serial/mc68681_reg2.c
-- 
2.20.1



More information about the devel mailing list