2 * arch/arm/mach-iop33x/iq80331.c
4 * Board support code for the Intel IQ80331 platform.
6 * Author: Dave Jiang <dave.jiang@intel.com>
7 * Copyright (C) 2003 Intel Corp.
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
16 #include <linux/init.h>
17 #include <linux/kernel.h>
18 #include <linux/pci.h>
19 #include <linux/string.h>
20 #include <linux/serial_core.h>
21 #include <linux/serial_8250.h>
22 #include <linux/mtd/physmap.h>
23 #include <linux/platform_device.h>
25 #include <mach/hardware.h>
27 #include <asm/mach/arch.h>
28 #include <asm/mach/map.h>
29 #include <asm/mach/pci.h>
30 #include <asm/mach/time.h>
31 #include <asm/mach-types.h>
33 #include <asm/pgtable.h>
34 #include <mach/time.h>
37 * IQ80331 timer tick configuration.
39 static void __init
iq80331_timer_init(void)
41 /* D-Step parts run at a higher internal bus frequency */
42 if (*IOP3XX_ATURID
>= 0xa)
43 iop_init_time(333000000);
45 iop_init_time(266000000);
53 iq80331_pci_map_irq(const struct pci_dev
*dev
, u8 slot
, u8 pin
)
57 if (slot
== 1 && pin
== 1) {
59 irq
= IRQ_IOP33X_XINT1
;
60 } else if (slot
== 1 && pin
== 2) {
62 irq
= IRQ_IOP33X_XINT2
;
63 } else if (slot
== 1 && pin
== 3) {
65 irq
= IRQ_IOP33X_XINT3
;
66 } else if (slot
== 1 && pin
== 4) {
68 irq
= IRQ_IOP33X_XINT0
;
69 } else if (slot
== 2) {
71 irq
= IRQ_IOP33X_XINT2
;
73 printk(KERN_ERR
"iq80331_pci_map_irq() called for unknown "
74 "device PCI:%d:%d:%d\n", dev
->bus
->number
,
75 PCI_SLOT(dev
->devfn
), PCI_FUNC(dev
->devfn
));
82 static struct hw_pci iq80331_pci __initdata
= {
85 .setup
= iop3xx_pci_setup
,
86 .preinit
= iop3xx_pci_preinit_cond
,
87 .map_irq
= iq80331_pci_map_irq
,
90 static int __init
iq80331_pci_init(void)
92 if ((iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE
) &&
94 pci_common_init(&iq80331_pci
);
99 subsys_initcall(iq80331_pci_init
);
103 * IQ80331 machine initialisation.
105 static struct physmap_flash_data iq80331_flash_data
= {
109 static struct resource iq80331_flash_resource
= {
112 .flags
= IORESOURCE_MEM
,
115 static struct platform_device iq80331_flash_device
= {
116 .name
= "physmap-flash",
119 .platform_data
= &iq80331_flash_data
,
122 .resource
= &iq80331_flash_resource
,
125 static struct resource iq80331_gpio_res
[] = {
126 DEFINE_RES_MEM((IOP3XX_PERIPHERAL_PHYS_BASE
+ 0x1780), 0x10),
129 static void __init
iq80331_init_machine(void)
131 platform_device_register_simple("gpio-iop", 0,
133 ARRAY_SIZE(iq80331_gpio_res
));
134 platform_device_register(&iop3xx_i2c0_device
);
135 platform_device_register(&iop3xx_i2c1_device
);
136 platform_device_register(&iop33x_uart0_device
);
137 platform_device_register(&iop33x_uart1_device
);
138 platform_device_register(&iq80331_flash_device
);
139 platform_device_register(&iop3xx_dma_0_channel
);
140 platform_device_register(&iop3xx_dma_1_channel
);
141 platform_device_register(&iop3xx_aau_channel
);
144 MACHINE_START(IQ80331
, "Intel IQ80331")
145 /* Maintainer: Intel Corp. */
146 .atag_offset
= 0x100,
147 .map_io
= iop3xx_map_io
,
148 .init_irq
= iop33x_init_irq
,
149 .init_time
= iq80331_timer_init
,
150 .init_machine
= iq80331_init_machine
,
151 .restart
= iop3xx_restart
,