summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-09-08 08:51:07 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-09-12 10:00:13 +0200
commit458179f19e83dd8b57d8f7f0e87e85c385465e76 (patch)
tree8fb936b7149bce59788251aea9a955d820a53f96
parentSimplify and unify BSP_output_char (diff)
downloadrtems-458179f19e83dd8b57d8f7f0e87e85c385465e76.tar.bz2
bsp/qoriq: Remove console stuff from bsp_start()
Update #3085.
-rw-r--r--c/src/lib/libbsp/powerpc/qoriq/console/console-config.c13
-rw-r--r--c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c21
2 files changed, 11 insertions, 23 deletions
diff --git a/c/src/lib/libbsp/powerpc/qoriq/console/console-config.c b/c/src/lib/libbsp/powerpc/qoriq/console/console-config.c
index 53e8b5e7c7..c5b0e31596 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/console/console-config.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/console/console-config.c
@@ -45,6 +45,15 @@
#endif
#if QORIQ_UART_0_ENABLE || QORIQ_UART_1_ENABLE
+ static bool uart_probe(rtems_termios_device_context *base)
+ {
+ ns16550_context *ctx = (ns16550_context *) base;
+
+ ctx->clock = BSP_bus_frequency;
+
+ return ns16550_probe(base);
+ }
+
static uint8_t get_register(uintptr_t addr, uint8_t i)
{
volatile uint8_t *reg = (uint8_t *) addr;
@@ -138,7 +147,7 @@ const console_device console_device_table[] = {
#if QORIQ_UART_0_ENABLE
{
.device_file = "/dev/ttyS0",
- .probe = ns16550_probe,
+ .probe = uart_probe,
.handler = DEVICE_FNS,
.context = &qoriq_uart_context_0.base
},
@@ -146,7 +155,7 @@ const console_device console_device_table[] = {
#if QORIQ_UART_1_ENABLE
{
.device_file = "/dev/ttyS1",
- .probe = ns16550_probe,
+ .probe = uart_probe,
.handler = DEVICE_FNS,
.context = &qoriq_uart_context_1.base
},
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c b/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
index 6ad73c301a..67df72e8aa 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
@@ -26,8 +26,6 @@
#include <rtems/config.h>
#include <rtems/counter.h>
-#include <libchip/ns16550.h>
-
#include <libcpu/powerpc-utility.h>
#include <bsp.h>
@@ -175,8 +173,6 @@ void qoriq_initialize_exceptions(void *interrupt_stack_begin)
void bsp_start(void)
{
- unsigned long i = 0;
-
/*
* Get CPU identification dynamically. Note that the get_ppc_cpu_type() function
* store the result in global variables so that it can be used latter...
@@ -186,23 +182,6 @@ void bsp_start(void)
initialize_frequency_parameters();
- /* Initialize some console parameters */
- for (i = 0; i < console_device_count; ++i) {
- const console_device *dev = &console_device_table[i];
- const rtems_termios_device_handler *ns16550 =
- #ifdef BSP_USE_UART_INTERRUPTS
- &ns16550_handler_interrupt;
- #else
- &ns16550_handler_polled;
- #endif
-
- if (dev->handler == ns16550) {
- ns16550_context *ctx = (ns16550_context *) dev->context;
-
- ctx->clock = BSP_bus_frequency;
- }
- }
-
qoriq_initialize_exceptions(bsp_section_work_begin);
bsp_interrupt_initialize();