2019-05-30 07:57:35 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2006-12-07 09:59:39 +08:00
|
|
|
/*
|
|
|
|
* iq81340sc board support
|
|
|
|
* Copyright (c) 2005-2006, Intel Corporation.
|
|
|
|
*/
|
|
|
|
#include <linux/pci.h>
|
|
|
|
|
2008-08-05 23:14:15 +08:00
|
|
|
#include <mach/hardware.h>
|
2006-12-07 09:59:39 +08:00
|
|
|
#include <asm/irq.h>
|
|
|
|
#include <asm/mach/pci.h>
|
|
|
|
#include <asm/mach-types.h>
|
|
|
|
#include <asm/mach/arch.h>
|
2015-01-30 17:45:33 +08:00
|
|
|
#include "pci.h"
|
2006-12-07 09:59:39 +08:00
|
|
|
#include <asm/mach/time.h>
|
2008-08-05 23:14:15 +08:00
|
|
|
#include <mach/time.h>
|
2006-12-07 09:59:39 +08:00
|
|
|
|
|
|
|
extern int init_atu;
|
|
|
|
|
|
|
|
static int __init
|
2012-04-30 22:58:45 +08:00
|
|
|
iq81340sc_atux_map_irq(const struct pci_dev *dev, u8 idsel, u8 pin)
|
2006-12-07 09:59:39 +08:00
|
|
|
{
|
|
|
|
WARN_ON(idsel < 1 || idsel > 2);
|
|
|
|
|
|
|
|
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_INTC;
|
|
|
|
case 3: return ATUX_INTC;
|
|
|
|
case 4: return ATUX_INTC;
|
|
|
|
default: return -1;
|
|
|
|
}
|
|
|
|
default: return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct hw_pci iq81340sc_pci __initdata = {
|
|
|
|
.nr_controllers = 0,
|
|
|
|
.setup = iop13xx_pci_setup,
|
|
|
|
.scan = iop13xx_scan_bus,
|
|
|
|
.map_irq = iq81340sc_atux_map_irq,
|
|
|
|
.preinit = iop13xx_pci_init
|
|
|
|
};
|
|
|
|
|
|
|
|
static int __init iq81340sc_pci_init(void)
|
|
|
|
{
|
|
|
|
iop13xx_atu_select(&iq81340sc_pci);
|
|
|
|
pci_common_init(&iq81340sc_pci);
|
|
|
|
iop13xx_map_pci_memory();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void __init iq81340sc_init(void)
|
|
|
|
{
|
|
|
|
iop13xx_platform_init();
|
|
|
|
iq81340sc_pci_init();
|
2007-05-03 00:47:47 +08:00
|
|
|
iop13xx_add_tpmi_devices();
|
2006-12-07 09:59:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void __init iq81340sc_timer_init(void)
|
|
|
|
{
|
2007-04-29 16:32:51 +08:00
|
|
|
unsigned long bus_freq = iop13xx_core_freq() / iop13xx_xsi_bus_ratio();
|
2008-03-05 07:08:02 +08:00
|
|
|
printk(KERN_DEBUG "%s: bus frequency: %lu\n", __func__, bus_freq);
|
2007-04-29 16:32:51 +08:00
|
|
|
iop_init_time(bus_freq);
|
2006-12-07 09:59:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
MACHINE_START(IQ81340SC, "Intel IQ81340SC")
|
|
|
|
/* Maintainer: Dan Williams <dan.j.williams@intel.com> */
|
2011-07-06 10:38:12 +08:00
|
|
|
.atag_offset = 0x100,
|
2012-03-01 00:56:15 +08:00
|
|
|
.init_early = iop13xx_init_early,
|
2006-12-07 09:59:39 +08:00
|
|
|
.map_io = iop13xx_map_io,
|
|
|
|
.init_irq = iop13xx_init_irq,
|
2012-11-09 03:40:59 +08:00
|
|
|
.init_time = iq81340sc_timer_init,
|
2006-12-07 09:59:39 +08:00
|
|
|
.init_machine = iq81340sc_init,
|
2011-11-06 18:49:50 +08:00
|
|
|
.restart = iop13xx_restart,
|
2014-05-07 23:44:04 +08:00
|
|
|
.nr_irqs = NR_IOP13XX_IRQS,
|
2006-12-07 09:59:39 +08:00
|
|
|
MACHINE_END
|