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/major.h>
17 #include <linux/platform_device.h>
18 #include <linux/serial.h>
19 #include <linux/tty.h>
20 #include <linux/serial_8250.h>
23 #include <asm/pgtable.h>
25 #include <asm/mach/map.h>
26 #include <asm/setup.h>
27 #include <asm/system.h>
28 #include <asm/memory.h>
29 #include <asm/hardware.h>
30 #include <asm/mach-types.h>
31 #include <asm/mach/arch.h>
33 #define IOP331_UART_XTAL 33334000
36 * Standard IO mapping for all IOP331 based systems
38 static struct map_desc iop331_std_desc
[] __initdata
= {
39 { /* mem mapped registers */
40 .virtual = IOP331_VIRT_MEM_BASE
,
41 .pfn
= __phys_to_pfn(IOP331_PHYS_MEM_BASE
),
44 }, { /* PCI IO space */
45 .virtual = IOP331_PCI_LOWER_IO_VA
,
46 .pfn
= __phys_to_pfn(IOP331_PCI_LOWER_IO_PA
),
47 .length
= IOP331_PCI_IO_WINDOW_SIZE
,
52 static struct resource iop33x_uart0_resources
[] = {
54 .start
= IOP331_UART0_PHYS
,
55 .end
= IOP331_UART0_PHYS
+ 0x3f,
56 .flags
= IORESOURCE_MEM
,
59 .start
= IRQ_IOP331_UART0
,
60 .end
= IRQ_IOP331_UART0
,
61 .flags
= IORESOURCE_IRQ
65 static struct resource iop33x_uart1_resources
[] = {
67 .start
= IOP331_UART1_PHYS
,
68 .end
= IOP331_UART1_PHYS
+ 0x3f,
69 .flags
= IORESOURCE_MEM
,
72 .start
= IRQ_IOP331_UART1
,
73 .end
= IRQ_IOP331_UART1
,
74 .flags
= IORESOURCE_IRQ
78 static struct plat_serial8250_port iop33x_uart0_data
[] = {
80 .membase
= (char*)(IOP331_UART0_VIRT
),
81 .mapbase
= (IOP331_UART0_PHYS
),
82 .irq
= IRQ_IOP331_UART0
,
83 .uartclk
= IOP331_UART_XTAL
,
86 .flags
= UPF_SKIP_TEST
,
91 static struct plat_serial8250_port iop33x_uart1_data
[] = {
93 .membase
= (char*)(IOP331_UART1_VIRT
),
94 .mapbase
= (IOP331_UART1_PHYS
),
95 .irq
= IRQ_IOP331_UART1
,
96 .uartclk
= IOP331_UART_XTAL
,
99 .flags
= UPF_SKIP_TEST
,
104 static struct platform_device iop33x_uart0
= {
105 .name
= "serial8250",
107 .dev
.platform_data
= iop33x_uart0_data
,
109 .resource
= iop33x_uart0_resources
,
112 static struct platform_device iop33x_uart1
= {
113 .name
= "serial8250",
115 .dev
.platform_data
= iop33x_uart1_data
,
117 .resource
= iop33x_uart1_resources
,
120 static struct resource iop33x_i2c_0_resources
[] = {
124 .flags
= IORESOURCE_MEM
,
127 .start
= IRQ_IOP331_I2C_0
,
128 .end
= IRQ_IOP331_I2C_0
,
129 .flags
= IORESOURCE_IRQ
133 static struct resource iop33x_i2c_1_resources
[] = {
137 .flags
= IORESOURCE_MEM
,
140 .start
= IRQ_IOP331_I2C_1
,
141 .end
= IRQ_IOP331_I2C_1
,
142 .flags
= IORESOURCE_IRQ
146 static struct platform_device iop33x_i2c_0_controller
= {
147 .name
= "IOP3xx-I2C",
150 .resource
= iop33x_i2c_0_resources
153 static struct platform_device iop33x_i2c_1_controller
= {
154 .name
= "IOP3xx-I2C",
157 .resource
= iop33x_i2c_1_resources
160 static struct platform_device
*iop33x_devices
[] __initdata
= {
163 &iop33x_i2c_0_controller
,
164 &iop33x_i2c_1_controller
167 void __init
iop33x_init(void)
171 platform_add_devices(iop33x_devices
,
172 ARRAY_SIZE(iop33x_devices
));
176 void __init
iop331_map_io(void)
178 iotable_init(iop331_std_desc
, ARRAY_SIZE(iop331_std_desc
));
181 #ifdef CONFIG_ARCH_IOP331
182 extern void iop331_init_irq(void);
183 extern struct sys_timer iop331_timer
;
186 #ifdef CONFIG_ARCH_IQ80331
187 extern void iq80331_map_io(void);
190 #ifdef CONFIG_MACH_IQ80332
191 extern void iq80332_map_io(void);
194 #if defined(CONFIG_ARCH_IQ80331)
195 MACHINE_START(IQ80331
, "Intel IQ80331")
196 /* Maintainer: Intel Corp. */
197 .phys_io
= 0xfefff000,
198 .io_pg_offst
= ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
199 .map_io
= iq80331_map_io
,
200 .init_irq
= iop331_init_irq
,
201 .timer
= &iop331_timer
,
202 .boot_params
= 0x0100,
203 .init_machine
= iop33x_init
,
206 #elif defined(CONFIG_MACH_IQ80332)
207 MACHINE_START(IQ80332
, "Intel IQ80332")
208 /* Maintainer: Intel Corp. */
209 .phys_io
= 0xfefff000,
210 .io_pg_offst
= ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
211 .map_io
= iq80332_map_io
,
212 .init_irq
= iop331_init_irq
,
213 .timer
= &iop331_timer
,
214 .boot_params
= 0x0100,
215 .init_machine
= iop33x_init
,
219 #error No machine descriptor defined for this IOP3XX implementation