Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iq80331.c
Go to the documentation of this file.
1 /*
2  * arch/arm/mach-iop33x/iq80331.c
3  *
4  * Board support code for the Intel IQ80331 platform.
5  *
6  * Author: Dave Jiang <[email protected]>
7  * Copyright (C) 2003 Intel Corp.
8  *
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.
13  */
14 
15 #include <linux/mm.h>
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>
24 #include <linux/io.h>
25 #include <mach/hardware.h>
26 #include <asm/irq.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>
32 #include <asm/page.h>
33 #include <asm/pgtable.h>
34 #include <mach/time.h>
35 
36 /*
37  * IQ80331 timer tick configuration.
38  */
39 static void __init iq80331_timer_init(void)
40 {
41  /* D-Step parts run at a higher internal bus frequency */
42  if (*IOP3XX_ATURID >= 0xa)
43  iop_init_time(333000000);
44  else
45  iop_init_time(266000000);
46 }
47 
48 static struct sys_timer iq80331_timer = {
49  .init = iq80331_timer_init,
50 };
51 
52 
53 /*
54  * IQ80331 PCI.
55  */
56 static int __init
57 iq80331_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
58 {
59  int irq;
60 
61  if (slot == 1 && pin == 1) {
62  /* PCI-X Slot INTA */
63  irq = IRQ_IOP33X_XINT1;
64  } else if (slot == 1 && pin == 2) {
65  /* PCI-X Slot INTB */
66  irq = IRQ_IOP33X_XINT2;
67  } else if (slot == 1 && pin == 3) {
68  /* PCI-X Slot INTC */
69  irq = IRQ_IOP33X_XINT3;
70  } else if (slot == 1 && pin == 4) {
71  /* PCI-X Slot INTD */
72  irq = IRQ_IOP33X_XINT0;
73  } else if (slot == 2) {
74  /* GigE */
75  irq = IRQ_IOP33X_XINT2;
76  } else {
77  printk(KERN_ERR "iq80331_pci_map_irq() called for unknown "
78  "device PCI:%d:%d:%d\n", dev->bus->number,
79  PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
80  irq = -1;
81  }
82 
83  return irq;
84 }
85 
86 static struct hw_pci iq80331_pci __initdata = {
87  .nr_controllers = 1,
88  .ops = &iop3xx_ops,
89  .setup = iop3xx_pci_setup,
90  .preinit = iop3xx_pci_preinit_cond,
91  .map_irq = iq80331_pci_map_irq,
92 };
93 
94 static int __init iq80331_pci_init(void)
95 {
97  machine_is_iq80331())
98  pci_common_init(&iq80331_pci);
99 
100  return 0;
101 }
102 
103 subsys_initcall(iq80331_pci_init);
104 
105 
106 /*
107  * IQ80331 machine initialisation.
108  */
109 static struct physmap_flash_data iq80331_flash_data = {
110  .width = 1,
111 };
112 
113 static struct resource iq80331_flash_resource = {
114  .start = 0xc0000000,
115  .end = 0xc07fffff,
116  .flags = IORESOURCE_MEM,
117 };
118 
119 static struct platform_device iq80331_flash_device = {
120  .name = "physmap-flash",
121  .id = 0,
122  .dev = {
123  .platform_data = &iq80331_flash_data,
124  },
125  .num_resources = 1,
126  .resource = &iq80331_flash_resource,
127 };
128 
129 static void __init iq80331_init_machine(void)
130 {
135  platform_device_register(&iq80331_flash_device);
139 }
140 
141 MACHINE_START(IQ80331, "Intel IQ80331")
142  /* Maintainer: Intel Corp. */
143  .atag_offset = 0x100,
144  .map_io = iop3xx_map_io,
145  .init_irq = iop33x_init_irq,
146  .timer = &iq80331_timer,
147  .init_machine = iq80331_init_machine,
148  .restart = iop3xx_restart,