Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 81373
b: refs/heads/master
c: 1a7507c
h: refs/heads/master
i:
  81371: 3164732
v: v3
  • Loading branch information
Paul Gortmaker authored and Kumar Gala committed Jan 28, 2008
1 parent 46aad95 commit 0227203
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ca956f0ea8baa6365b5e39d16373f430e12a030d
refs/heads/master: 1a7507c7da2df6856e085e0fbb0c9ea8c12ac4e2
45 changes: 17 additions & 28 deletions trunk/arch/powerpc/kernel/legacy_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <linux/serial_core.h>
#include <linux/console.h>
#include <linux/pci.h>
#include <linux/of_device.h>
#include <asm/io.h>
#include <asm/mmu.h>
#include <asm/prom.h>
Expand Down Expand Up @@ -31,6 +32,15 @@ static struct legacy_serial_info {
int irq_check_parent;
phys_addr_t taddr;
} legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS];

static struct __initdata of_device_id parents[] = {
{.type = "soc",},
{.type = "tsi-bridge",},
{.type = "opb", .compatible = "ibm,opb",},
{.compatible = "simple-bus",},
{.compatible = "wrs,epld-localbus",},
};

static unsigned int legacy_serial_count;
static int legacy_serial_console = -1;

Expand Down Expand Up @@ -306,18 +316,20 @@ void __init find_legacy_serial_ports(void)
DBG(" no linux,stdout-path !\n");
}

/* First fill our array with SOC ports */
/* Iterate over all the 16550 ports, looking for known parents */
for_each_compatible_node(np, "serial", "ns16550") {
struct device_node *soc = of_get_parent(np);
if (soc && !strcmp(soc->type, "soc")) {
struct device_node *parent = of_get_parent(np);
if (!parent)
continue;
if (of_match_node(parents, parent) != NULL) {
index = add_legacy_soc_port(np, np);
if (index >= 0 && np == stdout)
legacy_serial_console = index;
}
of_node_put(soc);
of_node_put(parent);
}

/* First fill our array with ISA ports */
/* Next, fill our array with ISA ports */
for_each_node_by_type(np, "serial") {
struct device_node *isa = of_get_parent(np);
if (isa && !strcmp(isa->name, "isa")) {
Expand All @@ -328,29 +340,6 @@ void __init find_legacy_serial_ports(void)
of_node_put(isa);
}

/* First fill our array with tsi-bridge ports */
for_each_compatible_node(np, "serial", "ns16550") {
struct device_node *tsi = of_get_parent(np);
if (tsi && !strcmp(tsi->type, "tsi-bridge")) {
index = add_legacy_soc_port(np, np);
if (index >= 0 && np == stdout)
legacy_serial_console = index;
}
of_node_put(tsi);
}

/* First fill our array with opb bus ports */
for_each_compatible_node(np, "serial", "ns16550") {
struct device_node *opb = of_get_parent(np);
if (opb && (!strcmp(opb->type, "opb") ||
of_device_is_compatible(opb, "ibm,opb"))) {
index = add_legacy_soc_port(np, np);
if (index >= 0 && np == stdout)
legacy_serial_console = index;
}
of_node_put(opb);
}

#ifdef CONFIG_PCI
/* Next, try to locate PCI ports */
for (np = NULL; (np = of_find_all_nodes(np));) {
Expand Down

0 comments on commit 0227203

Please sign in to comment.