forked from Imagelibrary/rtems
@@ -59,6 +59,19 @@ static void imx_uart_write_polled(rtems_termios_device_context *base, char c)
|
||||
regs->utxd = IMX_UART_UTXD_TX_DATA(c);
|
||||
}
|
||||
|
||||
void imx_uart_console_drain(void)
|
||||
{
|
||||
volatile imx_uart *regs;
|
||||
|
||||
regs = imx_uart_get_regs(&imx_uart_console->base);
|
||||
|
||||
if (regs != NULL) {
|
||||
while ((regs->usr2 & IMX_UART_USR2_TXFE) == 0) {
|
||||
/* Wait */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void imx_output_char(char c)
|
||||
{
|
||||
imx_uart_write_polled(&imx_uart_console->base, c);
|
||||
|
||||
@@ -51,6 +51,8 @@ rtems_vector_number imx_get_irq_of_node(
|
||||
size_t index
|
||||
);
|
||||
|
||||
void imx_uart_console_drain(void);
|
||||
|
||||
/**
|
||||
* @brief Registers an IMX I2C bus driver.
|
||||
*
|
||||
|
||||
@@ -13,13 +13,15 @@
|
||||
*/
|
||||
|
||||
#include <bsp/bootcard.h>
|
||||
|
||||
#include <bsp.h>
|
||||
#include <arm/freescale/imx/imx_wdogreg.h>
|
||||
|
||||
void bsp_reset(void)
|
||||
{
|
||||
volatile uint16_t *pcr;
|
||||
|
||||
imx_uart_console_drain();
|
||||
|
||||
pcr = (volatile uint16_t *) 0x30280000;
|
||||
*pcr &= ~WDOG_CR_SRS;
|
||||
*pcr &= ~WDOG_CR_SRS;
|
||||
|
||||
Reference in New Issue
Block a user