diff options
Diffstat (limited to 'arch/powerpc/kernel/legacy_serial.c')
-rw-r--r-- | arch/powerpc/kernel/legacy_serial.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index c7a799a09516..6e67b5b49ba1 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c | |||
@@ -37,7 +37,7 @@ static int legacy_serial_console = -1; | |||
37 | static int __init add_legacy_port(struct device_node *np, int want_index, | 37 | static int __init add_legacy_port(struct device_node *np, int want_index, |
38 | int iotype, phys_addr_t base, | 38 | int iotype, phys_addr_t base, |
39 | phys_addr_t taddr, unsigned long irq, | 39 | phys_addr_t taddr, unsigned long irq, |
40 | unsigned int flags) | 40 | upf_t flags) |
41 | { | 41 | { |
42 | u32 *clk, *spd, clock = BASE_BAUD * 16; | 42 | u32 *clk, *spd, clock = BASE_BAUD * 16; |
43 | int index; | 43 | int index; |
@@ -113,7 +113,7 @@ static int __init add_legacy_soc_port(struct device_node *np, | |||
113 | { | 113 | { |
114 | phys_addr_t addr; | 114 | phys_addr_t addr; |
115 | u32 *addrp; | 115 | u32 *addrp; |
116 | unsigned int flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ; | 116 | upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ; |
117 | 117 | ||
118 | /* We only support ports that have a clock frequency properly | 118 | /* We only support ports that have a clock frequency properly |
119 | * encoded in the device-tree. | 119 | * encoded in the device-tree. |
@@ -236,6 +236,23 @@ static int __init add_legacy_pci_port(struct device_node *np, | |||
236 | } | 236 | } |
237 | #endif | 237 | #endif |
238 | 238 | ||
239 | static void __init setup_legacy_serial_console(int console) | ||
240 | { | ||
241 | struct legacy_serial_info *info = | ||
242 | &legacy_serial_infos[console]; | ||
243 | void __iomem *addr; | ||
244 | |||
245 | if (info->taddr == 0) | ||
246 | return; | ||
247 | addr = ioremap(info->taddr, 0x1000); | ||
248 | if (addr == NULL) | ||
249 | return; | ||
250 | if (info->speed == 0) | ||
251 | info->speed = udbg_probe_uart_speed(addr, info->clock); | ||
252 | DBG("default console speed = %d\n", info->speed); | ||
253 | udbg_init_uart(addr, info->speed, info->clock); | ||
254 | } | ||
255 | |||
239 | /* | 256 | /* |
240 | * This is called very early, as part of setup_system() or eventually | 257 | * This is called very early, as part of setup_system() or eventually |
241 | * setup_arch(), basically before anything else in this file. This function | 258 | * setup_arch(), basically before anything else in this file. This function |
@@ -318,25 +335,8 @@ void __init find_legacy_serial_ports(void) | |||
318 | #endif | 335 | #endif |
319 | 336 | ||
320 | DBG("legacy_serial_console = %d\n", legacy_serial_console); | 337 | DBG("legacy_serial_console = %d\n", legacy_serial_console); |
321 | 338 | if (legacy_serial_console >= 0) | |
322 | /* udbg is 64 bits only for now, that will change soon though ... */ | 339 | setup_legacy_serial_console(legacy_serial_console); |
323 | while (legacy_serial_console >= 0) { | ||
324 | struct legacy_serial_info *info = | ||
325 | &legacy_serial_infos[legacy_serial_console]; | ||
326 | void __iomem *addr; | ||
327 | |||
328 | if (info->taddr == 0) | ||
329 | break; | ||
330 | addr = ioremap(info->taddr, 0x1000); | ||
331 | if (addr == NULL) | ||
332 | break; | ||
333 | if (info->speed == 0) | ||
334 | info->speed = udbg_probe_uart_speed(addr, info->clock); | ||
335 | DBG("default console speed = %d\n", info->speed); | ||
336 | udbg_init_uart(addr, info->speed, info->clock); | ||
337 | break; | ||
338 | } | ||
339 | |||
340 | DBG(" <- find_legacy_serial_port()\n"); | 340 | DBG(" <- find_legacy_serial_port()\n"); |
341 | } | 341 | } |
342 | 342 | ||