12e4a787b836844c2c2a30d4f77753429d7ab6bb
[linux-2.6.git] / arch / arm / mach-iop3xx / iop321-setup.c
1 /*
2  * linux/arch/arm/mach-iop3xx/iop321-setup.c
3  *
4  * Author: Nicolas Pitre <nico@cam.org>
5  * Copyright (C) 2001 MontaVista Software, Inc.
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  */
12 #include <linux/mm.h>
13 #include <linux/init.h>
14 #include <linux/config.h>
15 #include <linux/init.h>
16 #include <linux/major.h>
17 #include <linux/fs.h>
18 #include <linux/device.h>
19 #include <linux/serial.h>
20 #include <linux/tty.h>
21 #include <linux/serial_core.h>
22
23 #include <asm/io.h>
24 #include <asm/pgtable.h>
25 #include <asm/page.h>
26 #include <asm/mach/map.h>
27 #include <asm/setup.h>
28 #include <asm/system.h>
29 #include <asm/memory.h>
30 #include <asm/hardware.h>
31 #include <asm/mach-types.h>
32 #include <asm/mach/arch.h>
33
34 #define IOP321_UART_XTAL 1843200
35
36 /*
37  * Standard IO mapping for all IOP321 based systems
38  */
39 static struct map_desc iop321_std_desc[] __initdata = {
40  /* virtual     physical      length      type */
41
42  /* mem mapped registers */
43  { IOP321_VIRT_MEM_BASE,  IOP321_PHY_MEM_BASE,   0x00002000,  MT_DEVICE },
44
45  /* PCI IO space */
46  { 0xfe000000,  0x90000000,   0x00020000,  MT_DEVICE }
47 };
48
49 #ifdef CONFIG_ARCH_IQ80321
50 #define UARTBASE IQ80321_UART
51 #define IRQ_UART IRQ_IQ80321_UART
52 #endif
53
54 #ifdef CONFIG_ARCH_IQ31244
55 #define UARTBASE IQ31244_UART
56 #define IRQ_UART IRQ_IQ31244_UART
57 #endif
58
59 static struct uart_port iop321_serial_ports[] = {
60         {
61                 .membase        = (char*)(UARTBASE),
62                 .mapbase        = (UARTBASE),
63                 .irq            = IRQ_UART,
64                 .flags          = UPF_SKIP_TEST,
65                 .iotype         = UPIO_MEM,
66                 .regshift       = 0,
67                 .uartclk        = IOP321_UART_XTAL,
68                 .line           = 0,
69                 .type           = PORT_16550A,
70                 .fifosize       = 16
71         }
72 };
73
74 void __init iop321_map_io(void)
75 {
76         iotable_init(iop321_std_desc, ARRAY_SIZE(iop321_std_desc));
77         early_serial_setup(&iop321_serial_ports[0]);
78 }
79
80 #ifdef CONFIG_ARCH_IQ80321
81 extern void iq80321_map_io(void);
82 extern struct sys_timer iop321_timer;
83 extern void iop321_init_time(void);
84 #endif
85
86 #ifdef CONFIG_ARCH_IQ31244
87 extern void iq31244_map_io(void);
88 extern struct sys_timer iop321_timer;
89 extern void iop321_init_time(void);
90 #endif
91
92 #if defined(CONFIG_ARCH_IQ80321)
93 MACHINE_START(IQ80321, "Intel IQ80321")
94         MAINTAINER("Intel Corporation")
95         BOOT_MEM(PHYS_OFFSET, IQ80321_UART, IQ80321_UART)
96         MAPIO(iq80321_map_io)
97         INITIRQ(iop321_init_irq)
98         .timer          = &iop321_timer,
99     BOOT_PARAMS(0xa0000100)
100 MACHINE_END
101 #elif defined(CONFIG_ARCH_IQ31244)
102 MACHINE_START(IQ31244, "Intel IQ31244")
103     MAINTAINER("Intel Corp.")
104     BOOT_MEM(PHYS_OFFSET, IQ31244_UART, IQ31244_UART)
105     MAPIO(iq31244_map_io)
106     INITIRQ(iop321_init_irq)
107         .timer          = &iop321_timer,
108     BOOT_PARAMS(0xa0000100)
109 MACHINE_END
110 #else
111 #error No machine descriptor defined for this IOP3XX implementation
112 #endif