2006-12-07 08:59:39 +07:00
|
|
|
/*
|
|
|
|
* iq81340mc board support
|
|
|
|
* Copyright (c) 2005-2006, Intel Corporation.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
|
|
|
* Place - Suite 330, Boston, MA 02111-1307 USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include <linux/pci.h>
|
|
|
|
|
2008-08-05 22:14:15 +07:00
|
|
|
#include <mach/hardware.h>
|
2006-12-07 08:59:39 +07:00
|
|
|
#include <asm/irq.h>
|
|
|
|
#include <asm/mach/pci.h>
|
|
|
|
#include <asm/mach-types.h>
|
|
|
|
#include <asm/mach/arch.h>
|
2008-08-05 22:14:15 +07:00
|
|
|
#include <mach/pci.h>
|
2006-12-07 08:59:39 +07:00
|
|
|
#include <asm/mach/time.h>
|
2008-08-05 22:14:15 +07:00
|
|
|
#include <mach/time.h>
|
2006-12-07 08:59:39 +07:00
|
|
|
|
|
|
|
extern int init_atu; /* Flag to select which ATU(s) to initialize / disable */
|
|
|
|
|
|
|
|
static int __init
|
2011-06-10 21:30:21 +07:00
|
|
|
iq81340mc_pcix_map_irq(const struct pci_dev *dev, u8 idsel, u8 pin)
|
2006-12-07 08:59:39 +07:00
|
|
|
{
|
|
|
|
switch (idsel) {
|
|
|
|
case 1:
|
|
|
|
switch (pin) {
|
|
|
|
case 1: return ATUX_INTB;
|
|
|
|
case 2: return ATUX_INTC;
|
|
|
|
case 3: return ATUX_INTD;
|
|
|
|
case 4: return ATUX_INTA;
|
|
|
|
default: return -1;
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
switch (pin) {
|
|
|
|
case 1: return ATUX_INTC;
|
|
|
|
case 2: return ATUX_INTD;
|
|
|
|
case 3: return ATUX_INTC;
|
|
|
|
case 4: return ATUX_INTD;
|
|
|
|
default: return -1;
|
|
|
|
}
|
|
|
|
default: return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct hw_pci iq81340mc_pci __initdata = {
|
|
|
|
.swizzle = pci_std_swizzle,
|
|
|
|
.nr_controllers = 0,
|
|
|
|
.setup = iop13xx_pci_setup,
|
|
|
|
.map_irq = iq81340mc_pcix_map_irq,
|
|
|
|
.scan = iop13xx_scan_bus,
|
|
|
|
.preinit = iop13xx_pci_init,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int __init iq81340mc_pci_init(void)
|
|
|
|
{
|
|
|
|
iop13xx_atu_select(&iq81340mc_pci);
|
|
|
|
pci_common_init(&iq81340mc_pci);
|
|
|
|
iop13xx_map_pci_memory();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void __init iq81340mc_init(void)
|
|
|
|
{
|
|
|
|
iop13xx_platform_init();
|
|
|
|
iq81340mc_pci_init();
|
2007-05-02 23:47:47 +07:00
|
|
|
iop13xx_add_tpmi_devices();
|
2006-12-07 08:59:39 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void __init iq81340mc_timer_init(void)
|
|
|
|
{
|
2007-04-29 15:32:51 +07:00
|
|
|
unsigned long bus_freq = iop13xx_core_freq() / iop13xx_xsi_bus_ratio();
|
2008-03-05 06:08:02 +07:00
|
|
|
printk(KERN_DEBUG "%s: bus frequency: %lu\n", __func__, bus_freq);
|
2007-04-29 15:32:51 +07:00
|
|
|
iop_init_time(bus_freq);
|
2006-12-07 08:59:39 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct sys_timer iq81340mc_timer = {
|
|
|
|
.init = iq81340mc_timer_init,
|
|
|
|
};
|
|
|
|
|
|
|
|
MACHINE_START(IQ81340MC, "Intel IQ81340MC")
|
|
|
|
/* Maintainer: Dan Williams <dan.j.williams@intel.com> */
|
2011-07-06 09:38:12 +07:00
|
|
|
.atag_offset = 0x100,
|
2012-02-29 23:56:15 +07:00
|
|
|
.init_early = iop13xx_init_early,
|
2006-12-07 08:59:39 +07:00
|
|
|
.map_io = iop13xx_map_io,
|
|
|
|
.init_irq = iop13xx_init_irq,
|
|
|
|
.timer = &iq81340mc_timer,
|
|
|
|
.init_machine = iq81340mc_init,
|
2011-11-06 17:49:50 +07:00
|
|
|
.restart = iop13xx_restart,
|
2006-12-07 08:59:39 +07:00
|
|
|
MACHINE_END
|