June 16, 2024

the Zynq FSBL - inbyte (and outbyte)

These are routines that came from the "zed" directory. They are wrapper routines around UART input and output.

Actually inbyte is not even required or used, but it seemed somehow just "right" to include it along with outbyte. So the FSBL will talk to the uart, but never reads from it.

The routines are trivial one line wrappers like this:

char inbyte(void) {
         return XUartPs_RecvByte(STDIN_BASEADDRESS);
}
void outbyte(char c) {
	 XUartPs_SendByte(STDOUT_BASEADDRESS, c);
}
The following definitions are found in xparameter.h, which is also Zedboard specific:
#define STDIN_BASEADDRESS 0xE0001000
#define STDOUT_BASEADDRESS 0xE0001000
Remember that the Zynq has two uarts. Different boards may use a different uart for a console. For example, my EBAZ boards use UART-0 for the console. My Antminer boards use UART-1 (as does the secret bootloader uart protocol). The Zedboard also uses UART-1.

The following definitions are from the uart driver in my bare-metal code:

#define UART0_BASE      ((struct zynq_uart *) 0xe0000000)
#define UART1_BASE      ((struct zynq_uart *) 0xe0001000)

Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org