mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00:00
Merge branch 'master' of git://git.denx.de/u-boot-sh
This commit is contained in:
commit
b04eb342af
2 changed files with 14 additions and 8 deletions
|
@ -274,8 +274,8 @@ void enable_hlt(void);
|
|||
|
||||
static inline void trigger_address_error(void)
|
||||
{
|
||||
set_bl_bit();
|
||||
__asm__ __volatile__ (
|
||||
"ldc %0, sr\n\t"
|
||||
"mov.l @%1, %0"
|
||||
:
|
||||
: "r" (0x10000000), "r" (0x80000001)
|
||||
|
|
|
@ -117,6 +117,14 @@ static int serial_rx_fifo_level(void)
|
|||
return scif_rxfill(&sh_sci);
|
||||
}
|
||||
|
||||
static void handle_error(void)
|
||||
{
|
||||
sci_in(&sh_sci, SCxSR);
|
||||
sci_out(&sh_sci, SCxSR, SCxSR_ERROR_CLEAR(&sh_sci));
|
||||
sci_in(&sh_sci, SCLSR);
|
||||
sci_out(&sh_sci, SCLSR, 0x00);
|
||||
}
|
||||
|
||||
void serial_raw_putc(const char c)
|
||||
{
|
||||
while (1) {
|
||||
|
@ -138,16 +146,14 @@ static void sh_serial_putc(const char c)
|
|||
|
||||
static int sh_serial_tstc(void)
|
||||
{
|
||||
if (sci_in(&sh_sci, SCxSR) & SCIF_ERRORS) {
|
||||
handle_error();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return serial_rx_fifo_level() ? 1 : 0;
|
||||
}
|
||||
|
||||
void handle_error(void)
|
||||
{
|
||||
sci_in(&sh_sci, SCxSR);
|
||||
sci_out(&sh_sci, SCxSR, SCxSR_ERROR_CLEAR(&sh_sci));
|
||||
sci_in(&sh_sci, SCLSR);
|
||||
sci_out(&sh_sci, SCLSR, 0x00);
|
||||
}
|
||||
|
||||
int serial_getc_check(void)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue