[rtems commit] bsp/mpc55xx: PR2077: Add BSP_DEFAULT_BAUD_RATE

Sebastian Huber sebh at rtems.org
Tue Oct 2 13:24:03 UTC 2012


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

Author:    Peter Dufault <dufault at hda.com>
Date:      Mon Oct  1 15:43:22 2012 +0200

bsp/mpc55xx: PR2077: Add BSP_DEFAULT_BAUD_RATE

---

 c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac   |    4 ++++
 .../powerpc/mpc55xxevb/console/console-esci.c      |    2 +-
 .../powerpc/mpc55xxevb/console/console-generic.c   |    5 ++++-
 .../powerpc/mpc55xxevb/console/console-linflex.c   |    2 +-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac b/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
index a7b3f94..7cb99ff 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
@@ -44,6 +44,10 @@ RTEMS_BSPOPTS_SET([MPC55XX_CONSOLE_MINOR],[*],[0])
 RTEMS_BSPOPTS_HELP([MPC55XX_CONSOLE_MINOR],
 [determines which serial device will be registered as /dev/console])
 
+RTEMS_BSPOPTS_SET([BSP_DEFAULT_BAUD_RATE],[*],[115200])
+RTEMS_BSPOPTS_HELP([BSP_DEFAULT_BAUD_RATE],
+[default console baud])
+
 RTEMS_BSPOPTS_SET([MPC55XX_ESCI_USE_INTERRUPTS],[*],[1])
 RTEMS_BSPOPTS_HELP([MPC55XX_ESCI_USE_INTERRUPTS],
 [define to zero or one to disable or enable interrupts for the eSCI devices])
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-esci.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-esci.c
index 9aa19ac..83a4fa9 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-esci.c
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-esci.c
@@ -266,7 +266,7 @@ static int mpc55xx_esci_first_open(int major, int minor, void *arg)
 
   self->tty = tty;
 
-  rv = rtems_termios_set_initial_baud(tty, 115200);
+  rv = rtems_termios_set_initial_baud(tty, BSP_DEFAULT_BAUD_RATE);
   if (rv != 0) {
     rtems_fatal_error_occurred(0xdeadbeef);
   }
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-generic.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-generic.c
index e6c2c58..ad3b548 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-generic.c
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-generic.c
@@ -18,12 +18,15 @@
  * http://www.rtems.com/license/LICENSE.
  */
 
+#include <sys/cdefs.h>
+
+#include <bsp.h>
 #include <bsp/console-generic.h>
 
 #include <rtems/console.h>
 
 static const struct termios console_generic_termios = {
-  .c_cflag = CS8 | CREAD | CLOCAL | B115200
+  .c_cflag = CS8 | CREAD | CLOCAL | __CONCAT(B, BSP_DEFAULT_BAUD_RATE)
 };
 
 static void console_generic_char_out(char c)
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-linflex.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-linflex.c
index 54ac08e..e4039f3 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-linflex.c
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-linflex.c
@@ -259,7 +259,7 @@ static int mpc55xx_linflex_first_open(int major, int minor, void *arg)
   pcr.B.PA = self->tx_pa_value;
   self->tx_pcr_register->R = pcr.R;
 
-  rv = rtems_termios_set_initial_baud(tty, 115200);
+  rv = rtems_termios_set_initial_baud(tty, BSP_DEFAULT_BAUD_RATE);
   if (rv != 0) {
     rtems_fatal_error_occurred(0xdeadbeef);
   }




More information about the vc mailing list