blob: 68de247a4cca7e33e6dc9fa30d44174a99dd010b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Lennert Buytenhek3f7e5812006-09-18 23:10:26 +01002 * linux/arch/arm/mach-iop32x/setup.c
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
4 * Author: Nicolas Pitre <nico@cam.org>
5 * Copyright (C) 2001 MontaVista Software, Inc.
6 * Copyright (C) 2004 Intel Corporation.
7 *
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.
11 *
12 */
13#include <linux/mm.h>
14#include <linux/init.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <linux/major.h>
16#include <linux/fs.h>
Russell Kingd052d1b2005-10-29 19:07:23 +010017#include <linux/platform_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#include <linux/serial.h>
19#include <linux/tty.h>
20#include <linux/serial_core.h>
21
22#include <asm/io.h>
23#include <asm/pgtable.h>
24#include <asm/page.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>
Lennert Buytenhek863753a2006-09-18 23:19:02 +010032#include <asm/mach/time.h>
Lennert Buytenheke25d64f2006-09-18 23:15:21 +010033#include <asm/hardware/iop3xx.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
35#define IOP321_UART_XTAL 1843200
36
Linus Torvalds1da177e2005-04-16 15:20:36 -070037#ifdef CONFIG_ARCH_IQ80321
38#define UARTBASE IQ80321_UART
39#define IRQ_UART IRQ_IQ80321_UART
40#endif
41
42#ifdef CONFIG_ARCH_IQ31244
43#define UARTBASE IQ31244_UART
44#define IRQ_UART IRQ_IQ31244_UART
45#endif
46
47static struct uart_port iop321_serial_ports[] = {
48 {
49 .membase = (char*)(UARTBASE),
50 .mapbase = (UARTBASE),
51 .irq = IRQ_UART,
52 .flags = UPF_SKIP_TEST,
53 .iotype = UPIO_MEM,
54 .regshift = 0,
55 .uartclk = IOP321_UART_XTAL,
56 .line = 0,
57 .type = PORT_16550A,
58 .fifosize = 16
59 }
60};
61
Linus Torvalds1da177e2005-04-16 15:20:36 -070062void __init iop32x_init(void)
63{
Lennert Buytenheke25d64f2006-09-18 23:15:21 +010064 platform_device_register(&iop3xx_i2c0_device);
65 platform_device_register(&iop3xx_i2c1_device);
Linus Torvalds1da177e2005-04-16 15:20:36 -070066 early_serial_setup(&iop321_serial_ports[0]);
67}
68
69#ifdef CONFIG_ARCH_IQ80321
70extern void iq80321_map_io(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070071#endif
72
73#ifdef CONFIG_ARCH_IQ31244
74extern void iq31244_map_io(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070075#endif
76
Lennert Buytenhek863753a2006-09-18 23:19:02 +010077static void __init iop3xx_timer_init(void)
78{
79 iop3xx_init_time(IOP321_TICK_RATE);
80}
81
82struct sys_timer iop321_timer = {
83 .init = iop3xx_timer_init,
84 .offset = iop3xx_gettimeoffset,
85};
86
Linus Torvalds1da177e2005-04-16 15:20:36 -070087#if defined(CONFIG_ARCH_IQ80321)
88MACHINE_START(IQ80321, "Intel IQ80321")
Russell Kinge9dea0c2005-07-03 17:38:58 +010089 /* Maintainer: Intel Corporation */
Russell Kinge9dea0c2005-07-03 17:38:58 +010090 .phys_io = IQ80321_UART,
91 .io_pg_offst = ((IQ80321_UART) >> 18) & 0xfffc,
92 .map_io = iq80321_map_io,
93 .init_irq = iop321_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -070094 .timer = &iop321_timer,
Russell Kinge9dea0c2005-07-03 17:38:58 +010095 .boot_params = 0xa0000100,
96 .init_machine = iop32x_init,
Linus Torvalds1da177e2005-04-16 15:20:36 -070097MACHINE_END
98#elif defined(CONFIG_ARCH_IQ31244)
99MACHINE_START(IQ31244, "Intel IQ31244")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100100 /* Maintainer: Intel Corp. */
Russell Kinge9dea0c2005-07-03 17:38:58 +0100101 .phys_io = IQ31244_UART,
102 .io_pg_offst = ((IQ31244_UART) >> 18) & 0xfffc,
103 .map_io = iq31244_map_io,
104 .init_irq = iop321_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105 .timer = &iop321_timer,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100106 .boot_params = 0xa0000100,
107 .init_machine = iop32x_init,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108MACHINE_END
109#else
110#error No machine descriptor defined for this IOP3XX implementation
111#endif