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/major.h>
16 #include <linux/platform_device.h>
17 #include <linux/serial.h>
18 #include <linux/tty.h>
19 #include <linux/serial_8250.h>
22 #include <asm/pgtable.h>
24 #include <asm/mach/map.h>
25 #include <asm/setup.h>
26 #include <asm/system.h>
27 #include <asm/memory.h>
28 #include <asm/hardware.h>
29 #include <asm/mach-types.h>
30 #include <asm/mach/arch.h>
32 #define IOP331_UART_XTAL 33334000
35 * Standard IO mapping for all IOP331 based systems
37 static struct map_desc iop331_std_desc[] __initdata = {
38 { /* mem mapped registers */
39 .virtual = IOP331_VIRT_MEM_BASE,
40 .pfn = __phys_to_pfn(IOP331_PHYS_MEM_BASE),
43 }, { /* PCI IO space */
44 .virtual = IOP331_PCI_LOWER_IO_VA,
45 .pfn = __phys_to_pfn(IOP331_PCI_LOWER_IO_PA),
46 .length = IOP331_PCI_IO_WINDOW_SIZE,
51 static struct resource iop33x_uart0_resources[] = {
53 .start = IOP331_UART0_PHYS,
54 .end = IOP331_UART0_PHYS + 0x3f,
55 .flags = IORESOURCE_MEM,
58 .start = IRQ_IOP331_UART0,
59 .end = IRQ_IOP331_UART0,
60 .flags = IORESOURCE_IRQ
64 static struct resource iop33x_uart1_resources[] = {
66 .start = IOP331_UART1_PHYS,
67 .end = IOP331_UART1_PHYS + 0x3f,
68 .flags = IORESOURCE_MEM,
71 .start = IRQ_IOP331_UART1,
72 .end = IRQ_IOP331_UART1,
73 .flags = IORESOURCE_IRQ
77 static struct plat_serial8250_port iop33x_uart0_data[] = {
79 .membase = (char*)(IOP331_UART0_VIRT),
80 .mapbase = (IOP331_UART0_PHYS),
81 .irq = IRQ_IOP331_UART0,
82 .uartclk = IOP331_UART_XTAL,
85 .flags = UPF_SKIP_TEST,
90 static struct plat_serial8250_port iop33x_uart1_data[] = {
92 .membase = (char*)(IOP331_UART1_VIRT),
93 .mapbase = (IOP331_UART1_PHYS),
94 .irq = IRQ_IOP331_UART1,
95 .uartclk = IOP331_UART_XTAL,
98 .flags = UPF_SKIP_TEST,
103 static struct platform_device iop33x_uart0 = {
104 .name = "serial8250",
105 .id = PLAT8250_DEV_PLATFORM,
106 .dev.platform_data = iop33x_uart0_data,
108 .resource = iop33x_uart0_resources,
111 static struct platform_device iop33x_uart1 = {
112 .name = "serial8250",
113 .id = PLAT8250_DEV_PLATFORM1,
114 .dev.platform_data = iop33x_uart1_data,
116 .resource = iop33x_uart1_resources,
119 static struct resource iop33x_i2c_0_resources[] = {
123 .flags = IORESOURCE_MEM,
126 .start = IRQ_IOP331_I2C_0,
127 .end = IRQ_IOP331_I2C_0,
128 .flags = IORESOURCE_IRQ
132 static struct resource iop33x_i2c_1_resources[] = {
136 .flags = IORESOURCE_MEM,
139 .start = IRQ_IOP331_I2C_1,
140 .end = IRQ_IOP331_I2C_1,
141 .flags = IORESOURCE_IRQ
145 static struct platform_device iop33x_i2c_0_controller = {
146 .name = "IOP3xx-I2C",
149 .resource = iop33x_i2c_0_resources
152 static struct platform_device iop33x_i2c_1_controller = {
153 .name = "IOP3xx-I2C",
156 .resource = iop33x_i2c_1_resources
159 static struct platform_device *iop33x_devices[] __initdata = {
162 &iop33x_i2c_0_controller,
163 &iop33x_i2c_1_controller
166 void __init iop33x_init(void)
170 platform_add_devices(iop33x_devices,
171 ARRAY_SIZE(iop33x_devices));
175 void __init iop331_map_io(void)
177 iotable_init(iop331_std_desc, ARRAY_SIZE(iop331_std_desc));
180 #ifdef CONFIG_ARCH_IOP331
181 extern void iop331_init_irq(void);
182 extern struct sys_timer iop331_timer;
185 #ifdef CONFIG_ARCH_IQ80331
186 extern void iq80331_map_io(void);
189 #ifdef CONFIG_MACH_IQ80332
190 extern void iq80332_map_io(void);
193 #if defined(CONFIG_ARCH_IQ80331)
194 MACHINE_START(IQ80331, "Intel IQ80331")
195 /* Maintainer: Intel Corp. */
196 .phys_io = 0xfefff000,
197 .io_pg_offst = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
198 .map_io = iq80331_map_io,
199 .init_irq = iop331_init_irq,
200 .timer = &iop331_timer,
201 .boot_params = 0x0100,
202 .init_machine = iop33x_init,
205 #elif defined(CONFIG_MACH_IQ80332)
206 MACHINE_START(IQ80332, "Intel IQ80332")
207 /* Maintainer: Intel Corp. */
208 .phys_io = 0xfefff000,
209 .io_pg_offst = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
210 .map_io = iq80332_map_io,
211 .init_irq = iop331_init_irq,
212 .timer = &iop331_timer,
213 .boot_params = 0x0100,
214 .init_machine = iop33x_init,
218 #error No machine descriptor defined for this IOP3XX implementation