[PATCH 2/2] serial: amba-pl011: abstract register accessors
Timur Tabi
timur at codeaurora.org
Tue Nov 3 08:43:24 PST 2015
Russell King - ARM Linux wrote:
> Thanks for pointing that out... that's a mistake in my patches. It's
> very difficult to see how we could ever support earlyconsole on ZTE
> without massively overhauling the earlycon stuff. I'll undo the
> changes there in my series.
How about a command-line option for earlycon? We do this on our kernel
for now:
earlycon=pl011,0x3blabla,sbsa32
And then in pl011_early_console_setup(), device->con->write is set to
either pl011_early_write or to pl011_early_write_sbsa32, which looks
like this:
static void pl011_putc_sbsa32(struct uart_port *port, int c)
{
while (readl(port->membase + UART01x_FR) & UART01x_FR_TXFF)
cpu_relax();
writel(c, port->membase + UART01x_DR);
while (!(readl(port->membase + UART01x_FR) & UART011_FR_TXFE))
cpu_relax();
}
static void pl011_early_write_sbsa32(struct console *con, const char *s,
unsigned n)
{
struct earlycon_device *dev = con->data;
uart_console_write(&dev->port, s, n, pl011_putc_sbsa32);
}
I would have added this to my patch, but I specifically didn't want to
add any new functionality.
> Now, as for this patch...
>
>> > unsigned int (*get_fifosize)(struct amba_device *dev);
>> >+ u16 (*regreadw)(const void __iomem *addr);
>> >+ void (*regwritew)(u16 val, void __iomem *addr);
>> >+ void (*regwriteb)(u8 val, void __iomem *addr);
> regwriteb() is used nowhere in this patch.
Sorry, I could have sworn I deleted that. Should I bother posting a
version 2, since your patch is better?
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, hosted by The Linux Foundation.
More information about the linux-arm-kernel
mailing list