forked from Imagelibrary/rtems
@@ -45,6 +45,15 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if QORIQ_UART_0_ENABLE || QORIQ_UART_1_ENABLE
|
#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)
|
static uint8_t get_register(uintptr_t addr, uint8_t i)
|
||||||
{
|
{
|
||||||
volatile uint8_t *reg = (uint8_t *) addr;
|
volatile uint8_t *reg = (uint8_t *) addr;
|
||||||
@@ -138,7 +147,7 @@ const console_device console_device_table[] = {
|
|||||||
#if QORIQ_UART_0_ENABLE
|
#if QORIQ_UART_0_ENABLE
|
||||||
{
|
{
|
||||||
.device_file = "/dev/ttyS0",
|
.device_file = "/dev/ttyS0",
|
||||||
.probe = ns16550_probe,
|
.probe = uart_probe,
|
||||||
.handler = DEVICE_FNS,
|
.handler = DEVICE_FNS,
|
||||||
.context = &qoriq_uart_context_0.base
|
.context = &qoriq_uart_context_0.base
|
||||||
},
|
},
|
||||||
@@ -146,7 +155,7 @@ const console_device console_device_table[] = {
|
|||||||
#if QORIQ_UART_1_ENABLE
|
#if QORIQ_UART_1_ENABLE
|
||||||
{
|
{
|
||||||
.device_file = "/dev/ttyS1",
|
.device_file = "/dev/ttyS1",
|
||||||
.probe = ns16550_probe,
|
.probe = uart_probe,
|
||||||
.handler = DEVICE_FNS,
|
.handler = DEVICE_FNS,
|
||||||
.context = &qoriq_uart_context_1.base
|
.context = &qoriq_uart_context_1.base
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -26,8 +26,6 @@
|
|||||||
#include <rtems/config.h>
|
#include <rtems/config.h>
|
||||||
#include <rtems/counter.h>
|
#include <rtems/counter.h>
|
||||||
|
|
||||||
#include <libchip/ns16550.h>
|
|
||||||
|
|
||||||
#include <libcpu/powerpc-utility.h>
|
#include <libcpu/powerpc-utility.h>
|
||||||
|
|
||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
@@ -175,8 +173,6 @@ void qoriq_initialize_exceptions(void *interrupt_stack_begin)
|
|||||||
|
|
||||||
void bsp_start(void)
|
void bsp_start(void)
|
||||||
{
|
{
|
||||||
unsigned long i = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get CPU identification dynamically. Note that the get_ppc_cpu_type() function
|
* 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...
|
* 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_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);
|
qoriq_initialize_exceptions(bsp_section_work_begin);
|
||||||
bsp_interrupt_initialize();
|
bsp_interrupt_initialize();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user