Skip to content

Commit

Permalink
serial: 8250_early: Add earlycon for BCM2835 aux uart
Browse files Browse the repository at this point in the history
Define the OF early console for BCM2835 aux UART, which can be enabled
by passing "earlycon" on the boot command line. This UART is found on
BCM283x and BCM27xx SoCs, a.k.a. Raspberry Pi in its variants.

Signed-off-by: Matthias Brugger <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
mbgg authored and gregkh committed Feb 10, 2020
1 parent c6825c6 commit 57b76fa
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions drivers/tty/serial/8250/8250_bcm2835aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,24 @@ static struct platform_driver bcm2835aux_serial_driver = {
};
module_platform_driver(bcm2835aux_serial_driver);

#ifdef CONFIG_SERIAL_8250_CONSOLE

static int __init early_bcm2835aux_setup(struct earlycon_device *device,
const char *options)
{
if (!device->port.membase)
return -ENODEV;

device->port.iotype = UPIO_MEM32;
device->port.regshift = 2;

return early_serial8250_setup(device, NULL);
}

OF_EARLYCON_DECLARE(bcm2835aux, "brcm,bcm2835-aux-uart",
early_bcm2835aux_setup);
#endif

MODULE_DESCRIPTION("BCM2835 auxiliar UART driver");
MODULE_AUTHOR("Martin Sperl <[email protected]>");
MODULE_LICENSE("GPL v2");

0 comments on commit 57b76fa

Please sign in to comment.