]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/legacy_serial.c
Merge branch 'upstream-fixes' into upstream
[karo-tx-linux.git] / arch / powerpc / kernel / legacy_serial.c
index 59164ba2eb1c72f00ffc169a18c9dca67f9ffd5c..6e67b5b49ba1aedaa44a818835e396a0701a1185 100644 (file)
@@ -37,7 +37,7 @@ static int legacy_serial_console = -1;
 static int __init add_legacy_port(struct device_node *np, int want_index,
                                  int iotype, phys_addr_t base,
                                  phys_addr_t taddr, unsigned long irq,
-                                 unsigned int flags)
+                                 upf_t flags)
 {
        u32 *clk, *spd, clock = BASE_BAUD * 16;
        int index;
@@ -113,7 +113,7 @@ static int __init add_legacy_soc_port(struct device_node *np,
 {
        phys_addr_t addr;
        u32 *addrp;
-       unsigned int flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
+       upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
 
        /* We only support ports that have a clock frequency properly
         * encoded in the device-tree.
@@ -135,7 +135,7 @@ static int __init add_legacy_soc_port(struct device_node *np,
 }
 
 static int __init add_legacy_isa_port(struct device_node *np,
-                                     struct device_node *isa_bridge)
+                                     struct device_node *isa_brg)
 {
        u32 *reg;
        char *typep;
@@ -168,6 +168,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
 
 }
 
+#ifdef CONFIG_PCI
 static int __init add_legacy_pci_port(struct device_node *np,
                                      struct device_node *pci_dev)
 {
@@ -233,6 +234,24 @@ static int __init add_legacy_pci_port(struct device_node *np,
         */
        return add_legacy_port(np, index, iotype, base, addr, NO_IRQ, UPF_BOOT_AUTOCONF);
 }
+#endif
+
+static void __init setup_legacy_serial_console(int console)
+{
+       struct legacy_serial_info *info =
+               &legacy_serial_infos[console];
+       void __iomem *addr;
+
+       if (info->taddr == 0)
+               return;
+       addr = ioremap(info->taddr, 0x1000);
+       if (addr == NULL)
+               return;
+       if (info->speed == 0)
+               info->speed = udbg_probe_uart_speed(addr, info->clock);
+       DBG("default console speed = %d\n", info->speed);
+       udbg_init_uart(addr, info->speed, info->clock);
+}
 
 /*
  * This is called very early, as part of setup_system() or eventually
@@ -283,6 +302,7 @@ void __init find_legacy_serial_ports(void)
                of_node_put(isa);
        }
 
+#ifdef CONFIG_PCI
        /* Next, try to locate PCI ports */
        for (np = NULL; (np = of_find_all_nodes(np));) {
                struct device_node *pci, *parent = of_get_parent(np);
@@ -312,27 +332,11 @@ void __init find_legacy_serial_ports(void)
                        legacy_serial_console = index;
                of_node_put(parent);
        }
+#endif
 
        DBG("legacy_serial_console = %d\n", legacy_serial_console);
-
-       /* udbg is 64 bits only for now, that will change soon though ... */
-       while (legacy_serial_console >= 0) {
-               struct legacy_serial_info *info =
-                       &legacy_serial_infos[legacy_serial_console];
-               void __iomem *addr;
-
-               if (info->taddr == 0)
-                       break;
-               addr = ioremap(info->taddr, 0x1000);
-               if (addr == NULL)
-                       break;
-               if (info->speed == 0)
-                       info->speed = udbg_probe_uart_speed(addr, info->clock);
-               DBG("default console speed = %d\n", info->speed);
-               udbg_init_uart(addr, info->speed, info->clock);
-               break;
-       }
-
+       if (legacy_serial_console >= 0)
+               setup_legacy_serial_console(legacy_serial_console);
        DBG(" <- find_legacy_serial_port()\n");
 }
 
@@ -375,6 +379,7 @@ static void __init fixup_port_pio(int index,
                                  struct device_node *np,
                                  struct plat_serial8250_port *port)
 {
+#ifdef CONFIG_PCI
        struct pci_controller *hose;
 
        DBG("fixup_port_pio(%d)\n", index);
@@ -391,6 +396,7 @@ static void __init fixup_port_pio(int index,
                    index, port->iobase, port->iobase + offset);
                port->iobase += offset;
        }
+#endif
 }
 
 static void __init fixup_port_mmio(int index,