aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 13:02:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 13:02:38 -0400
commitd27050641e9bc056446deb0814e7ba1aa7911f5a (patch)
tree160f46d9a6df3d7234c71a9fbaa31ebcf89c04d0 /drivers/tty
parentb77279bc2e81545b20824da701b349272a78e4e7 (diff)
parent43cb43678705e39b175b325f17938295996aefc7 (diff)
Merge tag 'devicetree-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux into next
Pull DeviceTree updates from Rob Herring: - Another round of clean-up of FDT related code in architecture code. This removes knowledge of internal FDT details from most architectures except powerpc. - Conversion of kernel's custom FDT parsing code to use libfdt. - DT based initialization for generic serial earlycon. The introduction of generic serial earlycon support went in through the tty tree. - Improve the platform device naming for DT probed devices to ensure unique naming and use parent names instead of a global index. - Fix a race condition in of_update_property. - Unify the various linker section OF match tables and fix several function prototype errors. - Update platform_get_irq_byname to work in deferred probe cases. - 2 binding doc updates * tag 'devicetree-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (58 commits) of: handle NULL node in next_child iterators of/irq: provide more wrappers for !CONFIG_OF devicetree: bindings: Document micrel vendor prefix dt: bindings: dwc2: fix required value for the phy-names property of_pci_irq: kill useless variable in of_irq_parse_pci() of/irq: do irq resolution in platform_get_irq_byname() of: Add a testcase for of_find_node_by_path() of: Make of_find_node_by_path() handle /aliases of: Create unlocked version of for_each_child_of_node() lib: add glibc style strchrnul() variant of: Handle memory@0 node on PPC32 only pci/of: Remove dead code of: fix race between search and remove in of_update_property() of: Use NULL for pointers of: Stop naming platform_device using dcr address of: Ensure unique names without sacrificing determinism tty/serial: pl011: add DT based earlycon support of/fdt: add FDT serial scanning for earlycon of/fdt: add FDT address translation support serial: earlycon: add DT support ...
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/amba-pl011.c1
-rw-r--r--drivers/tty/serial/earlycon.c28
2 files changed, 29 insertions, 0 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index ee3d80346780..908a6e3142a2 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -2072,6 +2072,7 @@ static int __init pl011_early_console_setup(struct earlycon_device *device,
2072 return 0; 2072 return 0;
2073} 2073}
2074EARLYCON_DECLARE(pl011, pl011_early_console_setup); 2074EARLYCON_DECLARE(pl011, pl011_early_console_setup);
2075OF_EARLYCON_DECLARE(pl011, "arm,pl011", pl011_early_console_setup);
2075 2076
2076#else 2077#else
2077#define AMBA_CONSOLE NULL 2078#define AMBA_CONSOLE NULL
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index c92e83088adb..5131b5ee6164 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -15,6 +15,8 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/serial_core.h> 17#include <linux/serial_core.h>
18#include <linux/sizes.h>
19#include <linux/mod_devicetable.h>
18 20
19#ifdef CONFIG_FIX_EARLYCON_MEM 21#ifdef CONFIG_FIX_EARLYCON_MEM
20#include <asm/fixmap.h> 22#include <asm/fixmap.h>
@@ -32,6 +34,9 @@ static struct earlycon_device early_console_dev = {
32 .con = &early_con, 34 .con = &early_con,
33}; 35};
34 36
37static const struct of_device_id __earlycon_of_table_sentinel
38 __used __section(__earlycon_of_table_end);
39
35static void __iomem * __init earlycon_map(unsigned long paddr, size_t size) 40static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
36{ 41{
37 void __iomem *base; 42 void __iomem *base;
@@ -142,3 +147,26 @@ int __init setup_earlycon(char *buf, const char *match,
142 register_console(early_console_dev.con); 147 register_console(early_console_dev.con);
143 return 0; 148 return 0;
144} 149}
150
151int __init of_setup_earlycon(unsigned long addr,
152 int (*setup)(struct earlycon_device *, const char *))
153{
154 int err;
155 struct uart_port *port = &early_console_dev.port;
156
157 port->iotype = UPIO_MEM;
158 port->mapbase = addr;
159 port->uartclk = BASE_BAUD * 16;
160 port->membase = earlycon_map(addr, SZ_4K);
161
162 early_console_dev.con->data = &early_console_dev;
163 err = setup(&early_console_dev, NULL);
164 if (err < 0)
165 return err;
166 if (!early_console_dev.con->write)
167 return -ENODEV;
168
169
170 register_console(early_console_dev.con);
171 return 0;
172}