2 * linux/arch/arm/mach-iop32x/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/major.h>
17 #include <linux/platform_device.h>
18 #include <linux/serial.h>
19 #include <linux/tty.h>
20 #include <linux/serial_core.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 IOP321_UART_XTAL 1843200
35 #ifdef CONFIG_ARCH_IQ80321
36 #define UARTBASE IQ80321_UART
37 #define IRQ_UART IRQ_IQ80321_UART
40 #ifdef CONFIG_ARCH_IQ31244
41 #define UARTBASE IQ31244_UART
42 #define IRQ_UART IRQ_IQ31244_UART
45 static struct uart_port iop321_serial_ports[] = {
47 .membase = (char*)(UARTBASE),
48 .mapbase = (UARTBASE),
50 .flags = UPF_SKIP_TEST,
53 .uartclk = IOP321_UART_XTAL,
60 static struct resource iop32x_i2c_0_resources[] = {
64 .flags = IORESOURCE_MEM,
67 .start = IRQ_IOP321_I2C_0,
68 .end = IRQ_IOP321_I2C_0,
69 .flags = IORESOURCE_IRQ
73 static struct resource iop32x_i2c_1_resources[] = {
77 .flags = IORESOURCE_MEM,
80 .start = IRQ_IOP321_I2C_1,
81 .end = IRQ_IOP321_I2C_1,
82 .flags = IORESOURCE_IRQ
86 static struct platform_device iop32x_i2c_0_controller = {
90 .resource = iop32x_i2c_0_resources
93 static struct platform_device iop32x_i2c_1_controller = {
97 .resource = iop32x_i2c_1_resources
100 static struct platform_device *iop32x_devices[] __initdata = {
101 &iop32x_i2c_0_controller,
102 &iop32x_i2c_1_controller
105 void __init iop32x_init(void)
109 platform_add_devices(iop32x_devices,
110 ARRAY_SIZE(iop32x_devices));
112 early_serial_setup(&iop321_serial_ports[0]);
115 #ifdef CONFIG_ARCH_IQ80321
116 extern void iq80321_map_io(void);
117 extern struct sys_timer iop321_timer;
118 extern void iop321_init_time(void);
121 #ifdef CONFIG_ARCH_IQ31244
122 extern void iq31244_map_io(void);
123 extern struct sys_timer iop321_timer;
124 extern void iop321_init_time(void);
127 #if defined(CONFIG_ARCH_IQ80321)
128 MACHINE_START(IQ80321, "Intel IQ80321")
129 /* Maintainer: Intel Corporation */
130 .phys_io = IQ80321_UART,
131 .io_pg_offst = ((IQ80321_UART) >> 18) & 0xfffc,
132 .map_io = iq80321_map_io,
133 .init_irq = iop321_init_irq,
134 .timer = &iop321_timer,
135 .boot_params = 0xa0000100,
136 .init_machine = iop32x_init,
138 #elif defined(CONFIG_ARCH_IQ31244)
139 MACHINE_START(IQ31244, "Intel IQ31244")
140 /* Maintainer: Intel Corp. */
141 .phys_io = IQ31244_UART,
142 .io_pg_offst = ((IQ31244_UART) >> 18) & 0xfffc,
143 .map_io = iq31244_map_io,
144 .init_irq = iop321_init_irq,
145 .timer = &iop321_timer,
146 .boot_params = 0xa0000100,
147 .init_machine = iop32x_init,
150 #error No machine descriptor defined for this IOP3XX implementation