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/platform_device.h>
19 #include <linux/serial.h>
20 #include <linux/tty.h>
21 #include <linux/serial_8250.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 { /* mem mapped registers */
41 .virtual = IOP331_VIRT_MEM_BASE,
42 .pfn = __phys_to_pfn(IOP331_PHYS_MEM_BASE),
45 }, { /* PCI IO space */
46 .virtual = IOP331_PCI_LOWER_IO_VA,
47 .pfn = __phys_to_pfn(IOP331_PCI_LOWER_IO_PA),
48 .length = IOP331_PCI_IO_WINDOW_SIZE,
53 static struct resource iop33x_uart0_resources[] = {
55 .start = IOP331_UART0_PHYS,
56 .end = IOP331_UART0_PHYS + 0x3f,
57 .flags = IORESOURCE_MEM,
60 .start = IRQ_IOP331_UART0,
61 .end = IRQ_IOP331_UART0,
62 .flags = IORESOURCE_IRQ
66 static struct resource iop33x_uart1_resources[] = {
68 .start = IOP331_UART1_PHYS,
69 .end = IOP331_UART1_PHYS + 0x3f,
70 .flags = IORESOURCE_MEM,
73 .start = IRQ_IOP331_UART1,
74 .end = IRQ_IOP331_UART1,
75 .flags = IORESOURCE_IRQ
79 static struct plat_serial8250_port iop33x_uart0_data[] = {
81 .membase = (char*)(IOP331_UART0_VIRT),
82 .mapbase = (IOP331_UART0_PHYS),
83 .irq = IRQ_IOP331_UART0,
84 .uartclk = IOP331_UART_XTAL,
87 .flags = UPF_SKIP_TEST,
92 static struct plat_serial8250_port iop33x_uart1_data[] = {
94 .membase = (char*)(IOP331_UART1_VIRT),
95 .mapbase = (IOP331_UART1_PHYS),
96 .irq = IRQ_IOP331_UART1,
97 .uartclk = IOP331_UART_XTAL,
100 .flags = UPF_SKIP_TEST,
105 static struct platform_device iop33x_uart0 = {
106 .name = "serial8250",
108 .dev.platform_data = iop33x_uart0_data,
110 .resource = iop33x_uart0_resources,
113 static struct platform_device iop33x_uart1 = {
114 .name = "serial8250",
116 .dev.platform_data = iop33x_uart1_data,
118 .resource = iop33x_uart1_resources,
121 static struct resource iop33x_i2c_0_resources[] = {
125 .flags = IORESOURCE_MEM,
128 .start = IRQ_IOP331_I2C_0,
129 .end = IRQ_IOP331_I2C_0,
130 .flags = IORESOURCE_IRQ
134 static struct resource iop33x_i2c_1_resources[] = {
138 .flags = IORESOURCE_MEM,
141 .start = IRQ_IOP331_I2C_1,
142 .end = IRQ_IOP331_I2C_1,
143 .flags = IORESOURCE_IRQ
147 static struct platform_device iop33x_i2c_0_controller = {
148 .name = "IOP3xx-I2C",
151 .resource = iop33x_i2c_0_resources
154 static struct platform_device iop33x_i2c_1_controller = {
155 .name = "IOP3xx-I2C",
158 .resource = iop33x_i2c_1_resources
161 static struct platform_device *iop33x_devices[] __initdata = {
164 &iop33x_i2c_0_controller,
165 &iop33x_i2c_1_controller
168 void __init iop33x_init(void)
172 platform_add_devices(iop33x_devices,
173 ARRAY_SIZE(iop33x_devices));
177 void __init iop331_map_io(void)
179 iotable_init(iop331_std_desc, ARRAY_SIZE(iop331_std_desc));
182 #ifdef CONFIG_ARCH_IOP331
183 extern void iop331_init_irq(void);
184 extern struct sys_timer iop331_timer;
187 #ifdef CONFIG_ARCH_IQ80331
188 extern void iq80331_map_io(void);
191 #ifdef CONFIG_MACH_IQ80332
192 extern void iq80332_map_io(void);
195 #if defined(CONFIG_ARCH_IQ80331)
196 MACHINE_START(IQ80331, "Intel IQ80331")
197 /* Maintainer: Intel Corp. */
198 .phys_ram = PHYS_OFFSET,
199 .phys_io = 0xfefff000,
200 .io_pg_offst = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
201 .map_io = iq80331_map_io,
202 .init_irq = iop331_init_irq,
203 .timer = &iop331_timer,
204 .boot_params = 0x0100,
205 .init_machine = iop33x_init,
208 #elif defined(CONFIG_MACH_IQ80332)
209 MACHINE_START(IQ80332, "Intel IQ80332")
210 /* Maintainer: Intel Corp. */
211 .phys_ram = PHYS_OFFSET,
212 .phys_io = 0xfefff000,
213 .io_pg_offst = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
214 .map_io = iq80332_map_io,
215 .init_irq = iop331_init_irq,
216 .timer = &iop331_timer,
217 .boot_params = 0x0100,
218 .init_machine = iop33x_init,
222 #error No machine descriptor defined for this IOP3XX implementation