blob: 060cddde2fd4ad4f52830f065b275cc3cf704bb5 [file] [log] [blame]
Dan Williams285f5fa2006-12-07 02:59:39 +01001/*
2 * iq81340sc board support
3 * Copyright (c) 2005-2006, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 *
18 */
19#include <linux/pci.h>
20
Russell Kinga09e64f2008-08-05 16:14:15 +010021#include <mach/hardware.h>
Dan Williams285f5fa2006-12-07 02:59:39 +010022#include <asm/irq.h>
23#include <asm/mach/pci.h>
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010026#include <mach/pci.h>
Dan Williams285f5fa2006-12-07 02:59:39 +010027#include <asm/mach/time.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010028#include <mach/time.h>
Dan Williams285f5fa2006-12-07 02:59:39 +010029
30extern int init_atu;
31
32static int __init
33iq81340sc_atux_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
34{
35 WARN_ON(idsel < 1 || idsel > 2);
36
37 switch (idsel) {
38 case 1:
39 switch (pin) {
40 case 1: return ATUX_INTB;
41 case 2: return ATUX_INTC;
42 case 3: return ATUX_INTD;
43 case 4: return ATUX_INTA;
44 default: return -1;
45 }
46 case 2:
47 switch (pin) {
48 case 1: return ATUX_INTC;
49 case 2: return ATUX_INTC;
50 case 3: return ATUX_INTC;
51 case 4: return ATUX_INTC;
52 default: return -1;
53 }
54 default: return -1;
55 }
56}
57
58static struct hw_pci iq81340sc_pci __initdata = {
Dan Williams285f5fa2006-12-07 02:59:39 +010059 .nr_controllers = 0,
60 .setup = iop13xx_pci_setup,
61 .scan = iop13xx_scan_bus,
62 .map_irq = iq81340sc_atux_map_irq,
63 .preinit = iop13xx_pci_init
64};
65
66static int __init iq81340sc_pci_init(void)
67{
68 iop13xx_atu_select(&iq81340sc_pci);
69 pci_common_init(&iq81340sc_pci);
70 iop13xx_map_pci_memory();
71
72 return 0;
73}
74
75static void __init iq81340sc_init(void)
76{
77 iop13xx_platform_init();
78 iq81340sc_pci_init();
Dan Williamsd2dd8b12007-05-02 17:47:47 +010079 iop13xx_add_tpmi_devices();
Dan Williams285f5fa2006-12-07 02:59:39 +010080}
81
82static void __init iq81340sc_timer_init(void)
83{
Dan Williams84c981f2007-04-29 09:32:51 +010084 unsigned long bus_freq = iop13xx_core_freq() / iop13xx_xsi_bus_ratio();
Harvey Harrison8e86f422008-03-04 15:08:02 -080085 printk(KERN_DEBUG "%s: bus frequency: %lu\n", __func__, bus_freq);
Dan Williams84c981f2007-04-29 09:32:51 +010086 iop_init_time(bus_freq);
Dan Williams285f5fa2006-12-07 02:59:39 +010087}
88
89static struct sys_timer iq81340sc_timer = {
90 .init = iq81340sc_timer_init,
Dan Williams285f5fa2006-12-07 02:59:39 +010091};
92
93MACHINE_START(IQ81340SC, "Intel IQ81340SC")
94 /* Maintainer: Dan Williams <dan.j.williams@intel.com> */
Nicolas Pitred304c542011-07-05 22:38:12 -040095 .atag_offset = 0x100,
Rob Herring1dfe34a2012-02-29 10:56:15 -060096 .init_early = iop13xx_init_early,
Dan Williams285f5fa2006-12-07 02:59:39 +010097 .map_io = iop13xx_map_io,
98 .init_irq = iop13xx_init_irq,
99 .timer = &iq81340sc_timer,
Dan Williams285f5fa2006-12-07 02:59:39 +0100100 .init_machine = iq81340sc_init,
Russell King00aa78e2011-11-06 10:49:50 +0000101 .restart = iop13xx_restart,
Dan Williams285f5fa2006-12-07 02:59:39 +0100102MACHINE_END