[rtems commit] bsp/altera-cyclone-v: Add BSP_USE_UART_INTERRUPTS

Sebastian Huber sebh at rtems.org
Wed Sep 10 08:35:10 UTC 2014


Module:    rtems
Branch:    master
Commit:    0cd13bce676c4d3e7f03d8acdcddb033404c0929
Changeset: http://git.rtems.org/rtems/commit/?id=0cd13bce676c4d3e7f03d8acdcddb033404c0929

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Sep 10 10:42:47 2014 +0200

bsp/altera-cyclone-v: Add BSP_USE_UART_INTERRUPTS

---

 c/src/lib/libbsp/arm/altera-cyclone-v/configure.ac |    3 +++
 .../arm/altera-cyclone-v/console/console-config.c  |   12 +++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/c/src/lib/libbsp/arm/altera-cyclone-v/configure.ac b/c/src/lib/libbsp/arm/altera-cyclone-v/configure.ac
index bad9a2a..fc2b4b0 100644
--- a/c/src/lib/libbsp/arm/altera-cyclone-v/configure.ac
+++ b/c/src/lib/libbsp/arm/altera-cyclone-v/configure.ac
@@ -46,6 +46,9 @@ RTEMS_BSPOPTS_HELP([CYCLONE_V_CONFIG_UART_1],[configuration for UART 1])
 RTEMS_BSPOPTS_SET([CYCLONE_V_UART_BAUD],[*],[115200U])
 RTEMS_BSPOPTS_HELP([CYCLONE_V_UART_BAUD],[baud for UARTs])
 
+RTEMS_BSPOPTS_SET([BSP_USE_UART_INTERRUPTS],[*],[1])
+RTEMS_BSPOPTS_HELP([BSP_USE_UART_INTERRUPTS],[enable usage of interrupts for the UART modules])
+
 RTEMS_BSPOPTS_SET([CYCLONE_V_NO_I2C],[*],[1])
 RTEMS_BSPOPTS_HELP([CYCLONE_V_NO_I2C],
 [Number of configured I2C buses. Note that each bus has to be configured in an
diff --git a/c/src/lib/libbsp/arm/altera-cyclone-v/console/console-config.c b/c/src/lib/libbsp/arm/altera-cyclone-v/console/console-config.c
index d8d99c4..c2a287c 100644
--- a/c/src/lib/libbsp/arm/altera-cyclone-v/console/console-config.c
+++ b/c/src/lib/libbsp/arm/altera-cyclone-v/console/console-config.c
@@ -26,7 +26,13 @@
 #include "socal/alt_uart.h"
 #include "socal/hps.h"
 
-bool altera_cyclone_v_uart_probe( int minor );
+#ifdef BSP_USE_UART_INTERRUPTS
+  #define DEVICE_FNS &ns16550_fns
+#else
+  #define DEVICE_FNS &ns16550_fns_polled
+#endif
+
+static bool altera_cyclone_v_uart_probe( int minor );
 
 static uint8_t altera_cyclone_v_uart_get_register(uintptr_t addr, uint8_t i)
 {
@@ -47,7 +53,7 @@ console_tbl Console_Configuration_Ports[] = {
   {
     .sDeviceName   = "/dev/ttyS0",
     .deviceType    = SERIAL_NS16550,
-    .pDeviceFns    = &ns16550_fns,
+    .pDeviceFns    = DEVICE_FNS,
     .deviceProbe   = altera_cyclone_v_uart_probe,
     .pDeviceFlow   = NULL,
     .ulMargin      = 16,
@@ -68,7 +74,7 @@ console_tbl Console_Configuration_Ports[] = {
   {
     .sDeviceName   = "/dev/ttyS1",
     .deviceType    = SERIAL_NS16550,
-    .pDeviceFns    = &ns16550_fns,
+    .pDeviceFns    = DEVICE_FNS,
     .deviceProbe   = altera_cyclone_v_uart_probe,
     .pDeviceFlow   = NULL,
     .ulMargin      = 16,



More information about the vc mailing list