summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2019-09-12 14:48:29 +0200
committerDaniel Hellstrom <daniel@gaisler.com>2021-03-11 17:35:27 +0100
commitb57436c8fcfc7747a35856e69d362d33802f0421 (patch)
tree315404e64422a01f0ed15d7ef85e420532f40a19
parent053b17ce8e3f710167e9ec3f44b37756cbdcbec0 (diff)
downloadrtems-b57436c8fcfc7747a35856e69d362d33802f0421.tar.bz2
leon3: avoid dependency on apbuart/timer driver
Moves drvmgr_drivers[] from amba.c to a separate file in order to avoid the dependecy on APBUART/GPTIMER drivers. This has an effect when user configured not to use timer or uart in their project.
-rw-r--r--bsps/sparc/leon3/start/amba.c12
-rw-r--r--bsps/sparc/leon3/start/drvmgr_def_drivers.c28
-rw-r--r--c/src/lib/libbsp/sparc/leon3/Makefile.am1
-rw-r--r--spec/build/bsps/sparc/leon3/obj.yml1
4 files changed, 30 insertions, 12 deletions
diff --git a/bsps/sparc/leon3/start/amba.c b/bsps/sparc/leon3/start/amba.c
index e7ff29808c..1de206139f 100644
--- a/bsps/sparc/leon3/start/amba.c
+++ b/bsps/sparc/leon3/start/amba.c
@@ -34,18 +34,6 @@ struct ambapp_bus ambapp_plb;
#include <drvmgr/drvmgr.h>
#include <grlib/ambapp_bus_grlib.h>
-extern void gptimer_register_drv (void);
-extern void apbuart_cons_register_drv(void);
-/* All drivers included by BSP, this is overridden by the user by including
- * the drvmgr_confdefs.h. By default the Timer and UART driver are included.
- */
-drvmgr_drv_reg_func drvmgr_drivers[] __attribute__((weak)) =
-{
- gptimer_register_drv,
- apbuart_cons_register_drv,
- NULL /* End array with NULL */
-};
-
/* Driver resources configuration for AMBA root bus. It is declared weak
* so that the user may override it, if the defualt settings are not
* enough.
diff --git a/bsps/sparc/leon3/start/drvmgr_def_drivers.c b/bsps/sparc/leon3/start/drvmgr_def_drivers.c
new file mode 100644
index 0000000000..688b37bab9
--- /dev/null
+++ b/bsps/sparc/leon3/start/drvmgr_def_drivers.c
@@ -0,0 +1,28 @@
+/*
+ * Default BSP drivers when Driver Manager enabled
+ *
+ * COPYRIGHT (c) 2019.
+ * Cobham Gaisler
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+#include <bsp.h>
+
+#ifdef RTEMS_DRVMGR_STARTUP
+#include <drvmgr/drvmgr.h>
+
+extern void gptimer_register_drv (void);
+extern void apbuart_cons_register_drv(void);
+/* All drivers included by BSP, this is overridden by the user by including
+ * the drvmgr_confdefs.h. By default the Timer and UART driver are included.
+ */
+drvmgr_drv_reg_func drvmgr_drivers[] __attribute__((weak)) =
+{
+ gptimer_register_drv,
+ apbuart_cons_register_drv,
+ NULL /* End array with NULL */
+};
+
+#endif
diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
index 7bc0b3ef47..97b80759ca 100644
--- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
@@ -39,6 +39,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/leon3/start/cpucounter.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/shared/start/bsp_fatal_exit.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/leon3/start/bsp_fatal_halt.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/leon3/start/drvmgr_def_drivers.c
# gnatsupp
librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/leon3/gnatsupp/gnatsupp.c
diff --git a/spec/build/bsps/sparc/leon3/obj.yml b/spec/build/bsps/sparc/leon3/obj.yml
index efed717aad..3b58835ec0 100644
--- a/spec/build/bsps/sparc/leon3/obj.yml
+++ b/spec/build/bsps/sparc/leon3/obj.yml
@@ -48,6 +48,7 @@ source:
- bsps/sparc/leon3/start/bspstart.c
- bsps/sparc/leon3/start/cache.c
- bsps/sparc/leon3/start/cpucounter.c
+- bsps/sparc/leon3/start/drvmgr_def_drivers.c
- bsps/sparc/leon3/start/eirq.c
- bsps/sparc/leon3/start/setvec.c
- bsps/sparc/leon3/start/spurious.c