Thread (34 messages) read the whole thread 34 messages, 6 authors, 2014-04-23

[PATCH 4/8] tty/serial: add generic serial earlycon

From: catalin.marinas@arm.com (Catalin Marinas)
Date: 2014-03-24 11:22:26
Also in: linux-serial, lkml

On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
quoted hunk ↗ jump to hunk
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
new file mode 100644
index 0000000..241757a
--- /dev/null
+++ b/drivers/tty/serial/earlycon.c
[...]
+static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
+{
+	void __iomem *base;
+#ifdef CONFIG_FIX_EARLYCON_MEM
+	set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
+	base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
+	base += paddr & ~PAGE_MASK;
+#else
+	base = ioremap_nocache(paddr, size);
+#endif
Just curious why not set_fixmap_io (and plain ioremap)?
+static int __init parse_options(struct earlycon_device *device,
+				char *options)
+{
[...]
+	if (port->mapbase)
+		port->membase = earlycon_map(port->mapbase, 64);
I would move the earlycon_map() call in setup_earlycon() (personal
preference, parse_options() implies just parsing the options rather than
having additional side-effects).

-- 
Catalin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help