2 * linux/arch/arm/mach-iop3xx/iop321-setup.c
4 * Author: Nicolas Pitre <nico@cam.org>
5 * Copyright (C) 2001 MontaVista Software, Inc.
6 * Copyright (C) 2004 Intel Corporation.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
14 #include <linux/init.h>
15 #include <linux/config.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_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 IOP321_UART_XTAL 1843200
37 * Standard IO mapping for all IOP321 based systems
39 static struct map_desc iop321_std_desc
[] __initdata
= {
40 { /* mem mapped registers */
41 .virtual = IOP321_VIRT_MEM_BASE
,
42 .pfn
= __phys_to_pfn(IOP321_PHYS_MEM_BASE
),
45 }, { /* PCI IO space */
46 .virtual = IOP321_PCI_LOWER_IO_VA
,
47 .pfn
= __phys_to_pfn(IOP321_PCI_LOWER_IO_PA
),
48 .length
= IOP321_PCI_IO_WINDOW_SIZE
,
53 #ifdef CONFIG_ARCH_IQ80321
54 #define UARTBASE IQ80321_UART
55 #define IRQ_UART IRQ_IQ80321_UART
58 #ifdef CONFIG_ARCH_IQ31244
59 #define UARTBASE IQ31244_UART
60 #define IRQ_UART IRQ_IQ31244_UART
63 static struct uart_port iop321_serial_ports
[] = {
65 .membase
= (char*)(UARTBASE
),
66 .mapbase
= (UARTBASE
),
68 .flags
= UPF_SKIP_TEST
,
71 .uartclk
= IOP321_UART_XTAL
,
78 static struct resource iop32x_i2c_0_resources
[] = {
82 .flags
= IORESOURCE_MEM
,
85 .start
= IRQ_IOP321_I2C_0
,
86 .end
= IRQ_IOP321_I2C_0
,
87 .flags
= IORESOURCE_IRQ
91 static struct resource iop32x_i2c_1_resources
[] = {
95 .flags
= IORESOURCE_MEM
,
98 .start
= IRQ_IOP321_I2C_1
,
99 .end
= IRQ_IOP321_I2C_1
,
100 .flags
= IORESOURCE_IRQ
104 static struct platform_device iop32x_i2c_0_controller
= {
105 .name
= "IOP3xx-I2C",
108 .resource
= iop32x_i2c_0_resources
111 static struct platform_device iop32x_i2c_1_controller
= {
112 .name
= "IOP3xx-I2C",
115 .resource
= iop32x_i2c_1_resources
118 static struct platform_device
*iop32x_devices
[] __initdata
= {
119 &iop32x_i2c_0_controller
,
120 &iop32x_i2c_1_controller
123 void __init
iop32x_init(void)
127 platform_add_devices(iop32x_devices
,
128 ARRAY_SIZE(iop32x_devices
));
132 void __init
iop321_map_io(void)
134 iotable_init(iop321_std_desc
, ARRAY_SIZE(iop321_std_desc
));
135 early_serial_setup(&iop321_serial_ports
[0]);
138 #ifdef CONFIG_ARCH_IQ80321
139 extern void iq80321_map_io(void);
140 extern struct sys_timer iop321_timer
;
141 extern void iop321_init_time(void);
144 #ifdef CONFIG_ARCH_IQ31244
145 extern void iq31244_map_io(void);
146 extern struct sys_timer iop321_timer
;
147 extern void iop321_init_time(void);
150 #if defined(CONFIG_ARCH_IQ80321)
151 MACHINE_START(IQ80321
, "Intel IQ80321")
152 /* Maintainer: Intel Corporation */
153 .phys_io
= IQ80321_UART
,
154 .io_pg_offst
= ((IQ80321_UART
) >> 18) & 0xfffc,
155 .map_io
= iq80321_map_io
,
156 .init_irq
= iop321_init_irq
,
157 .timer
= &iop321_timer
,
158 .boot_params
= 0xa0000100,
159 .init_machine
= iop32x_init
,
161 #elif defined(CONFIG_ARCH_IQ31244)
162 MACHINE_START(IQ31244
, "Intel IQ31244")
163 /* Maintainer: Intel Corp. */
164 .phys_io
= IQ31244_UART
,
165 .io_pg_offst
= ((IQ31244_UART
) >> 18) & 0xfffc,
166 .map_io
= iq31244_map_io
,
167 .init_irq
= iop321_init_irq
,
168 .timer
= &iop321_timer
,
169 .boot_params
= 0xa0000100,
170 .init_machine
= iop32x_init
,
173 #error No machine descriptor defined for this IOP3XX implementation