forked from Imagelibrary/rtems
bsp/altera-caclone-v: Early printk support
Make sure printk can work early during BSP startup.
This commit is contained in:
committed by
Sebastian Huber
parent
390e73c4ee
commit
c8b7b32329
@@ -87,7 +87,6 @@ console_tbl Console_Configuration_Ports[] = {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
unsigned long Console_Configuration_Count =
|
unsigned long Console_Configuration_Count =
|
||||||
RTEMS_ARRAY_SIZE(Console_Configuration_Ports);
|
RTEMS_ARRAY_SIZE(Console_Configuration_Ports);
|
||||||
|
|
||||||
@@ -161,35 +160,16 @@ bool altera_cyclone_v_uart_probe(int minor)
|
|||||||
static void output_char(char c)
|
static void output_char(char c)
|
||||||
{
|
{
|
||||||
int minor = (int) Console_Port_Minor;
|
int minor = (int) Console_Port_Minor;
|
||||||
const console_tbl *ct = Console_Port_Tbl != NULL ?
|
console_tbl *ct = Console_Port_Tbl != NULL ?
|
||||||
Console_Port_Tbl[minor] : &Console_Configuration_Ports[minor];
|
Console_Port_Tbl[minor] : &Console_Configuration_Ports[minor];
|
||||||
const console_fns *cf = ct->pDeviceFns;
|
|
||||||
|
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
(*cf->deviceWritePolled)(minor, '\r');
|
ns16550_outch_polled( ct, '\r' );
|
||||||
}
|
}
|
||||||
|
|
||||||
(*cf->deviceWritePolled)(minor, c);
|
ns16550_outch_polled( ct, c );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void output_char_init(char c)
|
BSP_output_char_function_type BSP_output_char = output_char;
|
||||||
{
|
|
||||||
if (Console_Port_Tbl == NULL) {
|
|
||||||
int minor;
|
|
||||||
const console_fns *cf;
|
|
||||||
|
|
||||||
bsp_console_select();
|
|
||||||
|
|
||||||
minor = (int) Console_Port_Minor;
|
|
||||||
cf = Console_Configuration_Ports[minor].pDeviceFns;
|
|
||||||
|
|
||||||
(*cf->deviceInitialize)(minor);
|
|
||||||
}
|
|
||||||
|
|
||||||
BSP_output_char = output_char;
|
|
||||||
output_char(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
BSP_output_char_function_type BSP_output_char = output_char_init;
|
|
||||||
|
|
||||||
BSP_polling_getchar_function_type BSP_poll_char = NULL;
|
BSP_polling_getchar_function_type BSP_poll_char = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user