mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-06 13:09:50 +00:00
Implement support for early printf. You need to define SOCDEV_{PA,VA}
as described in the comments for the eputc function in your config file.
This commit is contained in:
parent
88b842d215
commit
52e996ac52
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=261040
@ -276,6 +276,24 @@ at91_usart_putc(struct uart_bas *bas, int c)
|
||||
WR4(bas, USART_THR, c);
|
||||
}
|
||||
|
||||
#ifdef EARLY_PRINTF
|
||||
/*
|
||||
* Early printf support. This assumes that we have the SoC "system" devices
|
||||
* mapped into AT91_BASE. To use this before we adjust the boostrap tables,
|
||||
* You'll need to define SOCDEV_VA to be 0xdc000000 and SOCDEV_PA to be
|
||||
* 0xfc000000 in your config file where you define EARLY_PRINTF
|
||||
*/
|
||||
volatile uint32_t *at91_dbgu = (volatile uint32_t *)(AT91_BASE + AT91_DBGU0);
|
||||
|
||||
void
|
||||
eputc(int c)
|
||||
{
|
||||
while (!(at91_dbgu[USART_CSR / 4] & USART_CSR_TXRDY))
|
||||
continue;
|
||||
at91_dbgu[USART_THR / 4] = c;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check for a character available.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user