2 * linux/arch/arm/mach-iop33x/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>
31 #include <asm/mach/time.h>
32 #include <asm/hardware/iop3xx.h>
34 #define IOP331_UART_XTAL 33334000
36 static struct resource iop33x_uart0_resources
[] = {
38 .start
= IOP331_UART0_PHYS
,
39 .end
= IOP331_UART0_PHYS
+ 0x3f,
40 .flags
= IORESOURCE_MEM
,
43 .start
= IRQ_IOP331_UART0
,
44 .end
= IRQ_IOP331_UART0
,
45 .flags
= IORESOURCE_IRQ
49 static struct resource iop33x_uart1_resources
[] = {
51 .start
= IOP331_UART1_PHYS
,
52 .end
= IOP331_UART1_PHYS
+ 0x3f,
53 .flags
= IORESOURCE_MEM
,
56 .start
= IRQ_IOP331_UART1
,
57 .end
= IRQ_IOP331_UART1
,
58 .flags
= IORESOURCE_IRQ
62 static struct plat_serial8250_port iop33x_uart0_data
[] = {
64 .membase
= (char*)(IOP331_UART0_VIRT
),
65 .mapbase
= (IOP331_UART0_PHYS
),
66 .irq
= IRQ_IOP331_UART0
,
67 .uartclk
= IOP331_UART_XTAL
,
70 .flags
= UPF_SKIP_TEST
,
75 static struct plat_serial8250_port iop33x_uart1_data
[] = {
77 .membase
= (char*)(IOP331_UART1_VIRT
),
78 .mapbase
= (IOP331_UART1_PHYS
),
79 .irq
= IRQ_IOP331_UART1
,
80 .uartclk
= IOP331_UART_XTAL
,
83 .flags
= UPF_SKIP_TEST
,
88 static struct platform_device iop33x_uart0
= {
90 .id
= PLAT8250_DEV_PLATFORM
,
91 .dev
.platform_data
= iop33x_uart0_data
,
93 .resource
= iop33x_uart0_resources
,
96 static struct platform_device iop33x_uart1
= {
98 .id
= PLAT8250_DEV_PLATFORM1
,
99 .dev
.platform_data
= iop33x_uart1_data
,
101 .resource
= iop33x_uart1_resources
,
104 static struct platform_device
*iop33x_devices
[] __initdata
= {
109 void __init
iop33x_init(void)
113 platform_add_devices(iop33x_devices
,
114 ARRAY_SIZE(iop33x_devices
));
116 platform_device_register(&iop3xx_i2c0_device
);
117 platform_device_register(&iop3xx_i2c1_device
);
120 #ifdef CONFIG_ARCH_IOP33X
121 extern void iop331_init_irq(void);
124 static void __init
iop3xx_timer_init(void)
126 iop3xx_init_time(IOP331_TICK_RATE
);
129 struct sys_timer iop331_timer
= {
130 .init
= iop3xx_timer_init
,
131 .offset
= iop3xx_gettimeoffset
,
134 #if defined(CONFIG_ARCH_IQ80331)
135 MACHINE_START(IQ80331
, "Intel IQ80331")
136 /* Maintainer: Intel Corp. */
137 .phys_io
= 0xfefff000,
138 .io_pg_offst
= ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
139 .map_io
= iop3xx_map_io
,
140 .init_irq
= iop331_init_irq
,
141 .timer
= &iop331_timer
,
142 .boot_params
= 0x0100,
143 .init_machine
= iop33x_init
,
146 #elif defined(CONFIG_MACH_IQ80332)
147 MACHINE_START(IQ80332
, "Intel IQ80332")
148 /* Maintainer: Intel Corp. */
149 .phys_io
= 0xfefff000,
150 .io_pg_offst
= ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
151 .map_io
= iop3xx_map_io
,
152 .init_irq
= iop331_init_irq
,
153 .timer
= &iop331_timer
,
154 .boot_params
= 0x0100,
155 .init_machine
= iop33x_init
,
159 #error No machine descriptor defined for this IOP3XX implementation