AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
earlycon.c File Reference

aarch64's early console: the PL011 UART, written to a character at a time by polling, until the terminals are up. More...

#include <core/system.h>
#include <console/earlycon.h>
#include <cpu/io.h>
#include <platform/virt.h>

Go to the source code of this file.

Macros

#define UART_DR   0x00
#define UART_FR   0x18
#define UART_FR_TXFF   (1 << 5)

Functions

int earlycon_putc (char c)
 Writes a character on the early console.
int earlycon_puts (char *s)
 Writes a string on the early console.
int earlycon_on_screen (void)
 Says whether the early console writes on the screen, rather than on a serial port.
void earlycon_init (void)
 Sets up the early console at boot, before anything else.
void earlycon_reinit (void)
 Sets up the early console again, once the kernel's command line has been read, since it may choose another console (earlycon=).

Variables

static uintptr_t uart = VIRT_REG(VIRT_UART)

Detailed Description

aarch64's early console: the PL011 UART, written to a character at a time by polling, until the terminals are up.

Definition in file earlycon.c.

Macro Definition Documentation

◆ UART_DR

#define UART_DR   0x00

Definition at line 12 of file earlycon.c.

Referenced by earlycon_putc(), pl011_receive(), and pl011_transmit().

◆ UART_FR

#define UART_FR   0x18

Definition at line 13 of file earlycon.c.

Referenced by earlycon_putc(), pl011_irq(), and pl011_transmit().

◆ UART_FR_TXFF

#define UART_FR_TXFF   (1 << 5)

Definition at line 14 of file earlycon.c.

Referenced by earlycon_putc().

Function Documentation

◆ earlycon_init()

void earlycon_init ( void )

Sets up the early console at boot, before anything else.

Definition at line 59 of file earlycon.c.

References earlycon_init().

Referenced by aarch64_init(), earlycon_init(), earlycon_init(), and x86_cpu_init().

◆ earlycon_on_screen()

int earlycon_on_screen ( void )

Says whether the early console writes on the screen, rather than on a serial port.

Returns
1 if it writes on the screen, 0 if not

Definition at line 52 of file earlycon.c.

References earlycon_on_screen().

Referenced by earlycon_on_screen(), and vt_probe().

◆ earlycon_putc()

int earlycon_putc ( char c)

Writes a character on the early console.

Parameters
cthe character
Returns
1 if it was written, 0 if not

Definition at line 23 of file earlycon.c.

References earlycon_putc(), UART_DR, UART_FR, and UART_FR_TXFF.

Referenced by earlycon_putc(), earlycon_puts(), and putc().

◆ earlycon_puts()

int earlycon_puts ( char * s)

Writes a string on the early console.

Parameters
sthe string
Returns
how many characters were written

Definition at line 38 of file earlycon.c.

References earlycon_putc(), and earlycon_puts().

Referenced by earlycon_puts(), and puts().

◆ earlycon_reinit()

void earlycon_reinit ( void )

Sets up the early console again, once the kernel's command line has been read, since it may choose another console (earlycon=).

Definition at line 65 of file earlycon.c.

References earlycon_reinit().

Referenced by aarch64_init(), earlycon_reinit(), earlycon_reinit(), and x86_cpu_init().

Variable Documentation

◆ uart

uintptr_t uart = VIRT_REG(VIRT_UART)
static

Definition at line 16 of file earlycon.c.