2 * linux/arch/arm/mach-iop3xx/iop331-setup.c
4 * Author: Dave Jiang (dave.jiang@intel.com)
5 * Copyright (C) 2004 Intel Corporation.
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.
13 #include <linux/init.h>
14 #include <linux/config.h>
15 #include <linux/init.h>
16 #include <linux/major.h>
18 #include <linux/device.h>
19 #include <linux/serial.h>
20 #include <linux/tty.h>
21 #include <linux/serial_core.h>
24 #include <asm/pgtable.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>
34 #define IOP331_UART_XTAL 33334000
37 * Standard IO mapping for all IOP331 based systems
39 static struct map_desc iop331_std_desc
[] __initdata
= {
40 /* virtual physical length type */
42 /* mem mapped registers */
43 { IOP331_VIRT_MEM_BASE
, IOP331_PHYS_MEM_BASE
, 0x00002000, MT_DEVICE
},
46 { IOP331_PCI_LOWER_IO_VA
, IOP331_PCI_LOWER_IO_PA
, IOP331_PCI_IO_WINDOW_SIZE
, MT_DEVICE
}
49 static struct uart_port iop331_serial_ports
[] = {
51 .membase
= (char*)(IOP331_UART0_VIRT
),
52 .mapbase
= (IOP331_UART0_PHYS
),
53 .irq
= IRQ_IOP331_UART0
,
54 .flags
= UPF_SKIP_TEST
,
57 .uartclk
= IOP331_UART_XTAL
,
62 .membase
= (char*)(IOP331_UART1_VIRT
),
63 .mapbase
= (IOP331_UART1_PHYS
),
64 .irq
= IRQ_IOP331_UART1
,
65 .flags
= UPF_SKIP_TEST
,
68 .uartclk
= IOP331_UART_XTAL
,
75 static struct resource iop33x_i2c_0_resources
[] = {
79 .flags
= IORESOURCE_MEM
,
82 .start
= IRQ_IOP331_I2C_0
,
83 .end
= IRQ_IOP331_I2C_0
,
84 .flags
= IORESOURCE_IRQ
88 static struct resource iop33x_i2c_1_resources
[] = {
92 .flags
= IORESOURCE_MEM
,
95 .start
= IRQ_IOP331_I2C_1
,
96 .end
= IRQ_IOP331_I2C_1
,
97 .flags
= IORESOURCE_IRQ
101 static struct platform_device iop33x_i2c_0_controller
= {
102 .name
= "IOP3xx-I2C",
105 .resource
= iop33x_i2c_0_resources
108 static struct platform_device iop33x_i2c_1_controller
= {
109 .name
= "IOP3xx-I2C",
112 .resource
= iop33x_i2c_1_resources
115 static struct platform_device
*iop33x_devices
[] __initdata
= {
116 &iop33x_i2c_0_controller
,
117 &iop33x_i2c_1_controller
120 void __init
iop33x_init(void)
124 platform_add_devices(iop33x_devices
,
125 ARRAY_SIZE(iop33x_devices
));
129 void __init
iop331_map_io(void)
131 iotable_init(iop331_std_desc
, ARRAY_SIZE(iop331_std_desc
));
132 early_serial_setup(&iop331_serial_ports
[0]);
133 early_serial_setup(&iop331_serial_ports
[1]);
136 #ifdef CONFIG_ARCH_IOP331
137 extern void iop331_init_irq(void);
138 extern struct sys_timer iop331_timer
;
141 #ifdef CONFIG_ARCH_IQ80331
142 extern void iq80331_map_io(void);
145 #ifdef CONFIG_MACH_IQ80332
146 extern void iq80332_map_io(void);
149 #if defined(CONFIG_ARCH_IQ80331)
150 MACHINE_START(IQ80331
, "Intel IQ80331")
151 /* Maintainer: Intel Corp. */
152 .phys_ram
= PHYS_OFFSET
,
153 .phys_io
= 0xfefff000,
154 .io_pg_offst
= ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
155 .map_io
= iq80331_map_io
,
156 .init_irq
= iop331_init_irq
,
157 .timer
= &iop331_timer
,
158 .boot_params
= 0x0100,
159 .init_machine
= iop33x_init
,
162 #elif defined(CONFIG_MACH_IQ80332)
163 MACHINE_START(IQ80332
, "Intel IQ80332")
164 /* Maintainer: Intel Corp. */
165 .phys_ram
= PHYS_OFFSET
,
166 .phys_io
= 0xfefff000,
167 .io_pg_offst
= ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
168 .map_io
= iq80332_map_io
,
169 .init_irq
= iop331_init_irq
,
170 .timer
= &iop331_timer
,
171 .boot_params
= 0x0100,
172 .init_machine
= iop33x_init
,
176 #error No machine descriptor defined for this IOP3XX implementation