From 458179f19e83dd8b57d8f7f0e87e85c385465e76 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 8 Sep 2017 08:51:07 +0200 Subject: bsp/qoriq: Remove console stuff from bsp_start() Update #3085. --- .../libbsp/powerpc/qoriq/console/console-config.c | 13 +++++++++++-- c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c | 21 --------------------- 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 #include -#include - #include #include @@ -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(); -- cgit v1.2.3