This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / arch / arm / mach-iop3xx / iop331-setup.c
1 /*
2  * linux/arch/arm/mach-iop3xx/iop331-setup.c
3  *
4  * Author: Dave Jiang (dave.jiang@intel.com)
5  * Copyright (C) 2004 Intel Corporation.
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 IOP331_UART_XTAL 33334000
35
36 /*
37  * Standard IO mapping for all IOP331 based systems
38  */
39 static struct map_desc iop331_std_desc[] __initdata = {
40  /* virtual     physical      length      type */
41
42  /* mem mapped registers */
43  { IOP331_VIRT_MEM_BASE,  IOP331_PHYS_MEM_BASE,   0x00002000,  MT_DEVICE },
44
45  /* PCI IO space */
46  { 0xfe000000,  0x90000000,   0x00020000,  MT_DEVICE }
47 };
48
49 static struct uart_port iop331_serial_ports[] = {
50         {
51                 .membase        = (char*)(IQ80331_UART0_VIRT),
52                 .mapbase        = (IQ80331_UART0_PHYS),
53                 .irq            = IRQ_IOP331_UART0,
54                 .flags          = UPF_SKIP_TEST,
55                 .iotype         = UPIO_MEM,
56                 .regshift       = 2,
57                 .uartclk        = IOP331_UART_XTAL,
58                 .line           = 0,
59                 .type           = PORT_XSCALE,
60                 .fifosize       = 32
61         } , {
62                 .membase        = (char*)(IQ80331_UART1_VIRT),
63                 .mapbase        = (IQ80331_UART1_PHYS),
64                 .irq            = IRQ_IOP331_UART1,
65                 .flags          = UPF_SKIP_TEST,
66                 .iotype         = UPIO_MEM,
67                 .regshift       = 2,
68                 .uartclk        = IOP331_UART_XTAL,
69                 .line           = 1,
70                 .type           = PORT_XSCALE,
71                 .fifosize       = 32
72         }
73 };
74
75 void __init iop331_map_io(void)
76 {
77         iotable_init(iop331_std_desc, ARRAY_SIZE(iop331_std_desc));
78         early_serial_setup(&iop331_serial_ports[0]);
79         early_serial_setup(&iop331_serial_ports[1]);
80 }
81
82 #ifdef CONFIG_ARCH_IQ80331
83 extern void iop331_init_irq(void);
84 extern void iop331_init_time(void);
85 extern void iq80331_map_io(void);
86 #endif
87
88 #if defined(CONFIG_ARCH_IQ80331)
89 MACHINE_START(IQ80331, "Intel IQ80331")
90     MAINTAINER("Intel Corp.")
91     BOOT_MEM(PHYS_OFFSET, 0xfefff000, 0xfffff000) // virtual, physical
92     //BOOT_MEM(PHYS_OFFSET, IQ80331_UART0_VIRT, IQ80331_UART0_PHYS)
93     MAPIO(iq80331_map_io)
94     INITIRQ(iop331_init_irq)
95     INITTIME(iop331_init_time)
96     BOOT_PARAMS(0x0100)
97 MACHINE_END
98 #else
99 #error No machine descriptor defined for this IOP3XX implementation
100 #endif
101
102