2 * arch/arm/mach-ixp2000/ixdp2800.c
4 * IXDP2800 platform support
6 * Original Author: Jeffrey Daly <jeffrey.daly@intel.com>
7 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
9 * Copyright (C) 2002 Intel Corp.
10 * Copyright (C) 2003-2004 MontaVista Software, Inc.
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
17 #include <linux/config.h>
18 #include <linux/kernel.h>
19 #include <linux/init.h>
21 #include <linux/sched.h>
22 #include <linux/interrupt.h>
23 #include <linux/device.h>
24 #include <linux/bitops.h>
25 #include <linux/pci.h>
26 #include <linux/interrupt.h>
28 #include <linux/init.h>
29 #include <linux/ioport.h>
30 #include <linux/slab.h>
31 #include <linux/delay.h>
35 #include <asm/pgtable.h>
37 #include <asm/system.h>
38 #include <asm/hardware.h>
39 #include <asm/mach-types.h>
41 #include <asm/mach/pci.h>
42 #include <asm/mach/map.h>
43 #include <asm/mach/irq.h>
44 #include <asm/mach/time.h>
45 #include <asm/mach/flash.h>
46 #include <asm/mach/arch.h>
49 void ixdp2400_init_irq(void)
51 ixdp2x00_init_irq(IXDP2800_CPLD_INT_STAT, IXDP2800_CPLD_INT_MASK, IXDP2400_NR_IRQS);
54 /*************************************************************************
56 *************************************************************************/
58 static void __init ixdp2800_init_time(void)
60 ixp2000_init_time(50000000);
63 /*************************************************************************
65 *************************************************************************/
66 void __init ixdp2800_pci_preinit(void)
68 printk("ixdp2x00_pci_preinit called\n");
70 *IXP2000_PCI_ADDR_EXT = 0x0000e000;
72 *IXP2000_PCI_DRAM_BASE_ADDR_MASK = (0x40000000 - 1) & ~0xfffff;
73 *IXP2000_PCI_SRAM_BASE_ADDR_MASK = (0x2000000 - 1) & ~0x3ffff;
75 ixp2000_pci_preinit();
78 int ixdp2800_pci_setup(int nr, struct pci_sys_data *sys)
80 sys->mem_offset = 0x00000000;
82 ixp2000_pci_setup(nr, sys);
87 static int __init ixdp2800_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
89 if (ixdp2x00_master_npu()) {
92 * Root bus devices. Slave NPU is only one with interrupt.
93 * Everything else, we just return -1 which is invalid.
96 if(dev->devfn == IXDP2X00_SLAVE_NPU_DEVFN )
97 return IRQ_IXDP2800_INGRESS_NPU;
103 * Bridge behind the PMC slot.
105 if(dev->bus->self->devfn == IXDP2X00_PMC_DEVFN &&
106 dev->bus->parent->self->devfn == IXDP2X00_P2P_DEVFN &&
107 !dev->bus->parent->self->bus->parent)
108 return IRQ_IXDP2800_PMC;
111 * Device behind the first bridge
113 if(dev->bus->self->devfn == IXDP2X00_P2P_DEVFN) {
114 switch(PCI_SLOT(dev->devfn)) {
115 case IXDP2X00_PMC_DEVFN:
116 return IRQ_IXDP2800_PMC;
118 case IXDP2800_MASTER_ENET_DEVFN:
119 return IRQ_IXDP2800_EGRESS_ENET;
121 case IXDP2800_SWITCH_FABRIC_DEVFN:
122 return IRQ_IXDP2800_FABRIC;
127 } else return IRQ_IXP2000_PCIB; /* Slave NIC interrupt */
130 static void ixdp2800_pci_postinit(void)
134 if (ixdp2x00_master_npu()) {
135 dev = pci_find_slot(1, IXDP2800_SLAVE_ENET_DEVFN);
136 pci_remove_bus_device(dev);
138 dev = pci_find_slot(1, IXDP2800_MASTER_ENET_DEVFN);
139 pci_remove_bus_device(dev);
141 ixdp2x00_slave_pci_postinit();
145 struct hw_pci ixdp2800_pci __initdata = {
147 .setup = ixdp2800_pci_setup,
148 .preinit = ixdp2800_pci_preinit,
149 .postinit = ixdp2800_pci_postinit,
150 .scan = ixp2000_pci_scan_bus,
151 .map_irq = ixdp2800_pci_map_irq,
154 int __init ixdp2800_pci_init(void)
156 if (machine_is_ixdp2800())
157 pci_common_init(&ixdp2800_pci);
162 subsys_initcall(ixdp2800_pci_init);
164 void ixdp2800_init_irq(void)
166 ixdp2x00_init_irq(IXDP2800_CPLD_INT_STAT, IXDP2800_CPLD_INT_MASK, IXDP2800_NR_IRQS);
169 MACHINE_START(IXDP2800, "Intel IXDP2800 Development Platform")
170 MAINTAINER("MontaVista Software, Inc.")
171 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE)
172 BOOT_PARAMS(0x00000100)
173 MAPIO(ixdp2x00_map_io)
174 INITIRQ(ixdp2800_init_irq)
175 INITTIME(ixdp2800_init_time)
176 INIT_MACHINE(ixdp2x00_init_machine)