aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/legacy_serial.c21
-rw-r--r--arch/powerpc/platforms/embedded6xx/Kconfig1
2 files changed, 16 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 40bd7bd4e19a..85fb16e64cef 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -71,8 +71,9 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
71 phys_addr_t taddr, unsigned long irq, 71 phys_addr_t taddr, unsigned long irq,
72 upf_t flags, int irq_check_parent) 72 upf_t flags, int irq_check_parent)
73{ 73{
74 const __be32 *clk, *spd; 74 const __be32 *clk, *spd, *rs;
75 u32 clock = BASE_BAUD * 16; 75 u32 clock = BASE_BAUD * 16;
76 u32 shift = 0;
76 int index; 77 int index;
77 78
78 /* get clock freq. if present */ 79 /* get clock freq. if present */
@@ -83,6 +84,11 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
83 /* get default speed if present */ 84 /* get default speed if present */
84 spd = of_get_property(np, "current-speed", NULL); 85 spd = of_get_property(np, "current-speed", NULL);
85 86
87 /* get register shift if present */
88 rs = of_get_property(np, "reg-shift", NULL);
89 if (rs && *rs)
90 shift = be32_to_cpup(rs);
91
86 /* If we have a location index, then try to use it */ 92 /* If we have a location index, then try to use it */
87 if (want_index >= 0 && want_index < MAX_LEGACY_SERIAL_PORTS) 93 if (want_index >= 0 && want_index < MAX_LEGACY_SERIAL_PORTS)
88 index = want_index; 94 index = want_index;
@@ -126,6 +132,7 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
126 legacy_serial_ports[index].uartclk = clock; 132 legacy_serial_ports[index].uartclk = clock;
127 legacy_serial_ports[index].irq = irq; 133 legacy_serial_ports[index].irq = irq;
128 legacy_serial_ports[index].flags = flags; 134 legacy_serial_ports[index].flags = flags;
135 legacy_serial_ports[index].regshift = shift;
129 legacy_serial_infos[index].taddr = taddr; 136 legacy_serial_infos[index].taddr = taddr;
130 legacy_serial_infos[index].np = of_node_get(np); 137 legacy_serial_infos[index].np = of_node_get(np);
131 legacy_serial_infos[index].clock = clock; 138 legacy_serial_infos[index].clock = clock;
@@ -163,9 +170,8 @@ static int __init add_legacy_soc_port(struct device_node *np,
163 if (of_get_property(np, "clock-frequency", NULL) == NULL) 170 if (of_get_property(np, "clock-frequency", NULL) == NULL)
164 return -1; 171 return -1;
165 172
166 /* if reg-shift or offset, don't try to use it */ 173 /* if reg-offset don't try to use it */
167 if ((of_get_property(np, "reg-shift", NULL) != NULL) || 174 if ((of_get_property(np, "reg-offset", NULL) != NULL))
168 (of_get_property(np, "reg-offset", NULL) != NULL))
169 return -1; 175 return -1;
170 176
171 /* if rtas uses this device, don't try to use it as well */ 177 /* if rtas uses this device, don't try to use it as well */
@@ -315,17 +321,20 @@ static void __init setup_legacy_serial_console(int console)
315 struct legacy_serial_info *info = &legacy_serial_infos[console]; 321 struct legacy_serial_info *info = &legacy_serial_infos[console];
316 struct plat_serial8250_port *port = &legacy_serial_ports[console]; 322 struct plat_serial8250_port *port = &legacy_serial_ports[console];
317 void __iomem *addr; 323 void __iomem *addr;
324 unsigned int stride;
325
326 stride = 1 << port->regshift;
318 327
319 /* Check if a translated MMIO address has been found */ 328 /* Check if a translated MMIO address has been found */
320 if (info->taddr) { 329 if (info->taddr) {
321 addr = ioremap(info->taddr, 0x1000); 330 addr = ioremap(info->taddr, 0x1000);
322 if (addr == NULL) 331 if (addr == NULL)
323 return; 332 return;
324 udbg_uart_init_mmio(addr, 1); 333 udbg_uart_init_mmio(addr, stride);
325 } else { 334 } else {
326 /* Check if it's PIO and we support untranslated PIO */ 335 /* Check if it's PIO and we support untranslated PIO */
327 if (port->iotype == UPIO_PORT && isa_io_special) 336 if (port->iotype == UPIO_PORT && isa_io_special)
328 udbg_uart_init_pio(port->iobase, 1); 337 udbg_uart_init_pio(port->iobase, stride);
329 else 338 else
330 return; 339 return;
331 } 340 }
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig
index 2a7024d8d8b1..a25f496c2ef9 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -65,6 +65,7 @@ config MVME5100
65 select PPC_INDIRECT_PCI 65 select PPC_INDIRECT_PCI
66 select PPC_I8259 66 select PPC_I8259
67 select PPC_NATIVE 67 select PPC_NATIVE
68 select PPC_UDBG_16550
68 help 69 help
69 This option enables support for the Motorola (now Emerson) MVME5100 70 This option enables support for the Motorola (now Emerson) MVME5100
70 board. 71 board.