Path: blob/master/arch/arm/mach-iop13xx/iq81340sc.c
10817 views
/*1* iq81340sc board support2* Copyright (c) 2005-2006, Intel Corporation.3*4* This program is free software; you can redistribute it and/or modify it5* under the terms and conditions of the GNU General Public License,6* version 2, as published by the Free Software Foundation.7*8* This program is distributed in the hope it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for11* more details.12*13* You should have received a copy of the GNU General Public License along with14* this program; if not, write to the Free Software Foundation, Inc., 59 Temple15* Place - Suite 330, Boston, MA 02111-1307 USA.16*17*/18#include <linux/pci.h>1920#include <mach/hardware.h>21#include <asm/irq.h>22#include <asm/mach/pci.h>23#include <asm/mach-types.h>24#include <asm/mach/arch.h>25#include <mach/pci.h>26#include <asm/mach/time.h>27#include <mach/time.h>2829extern int init_atu;3031static int __init32iq81340sc_atux_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)33{34WARN_ON(idsel < 1 || idsel > 2);3536switch (idsel) {37case 1:38switch (pin) {39case 1: return ATUX_INTB;40case 2: return ATUX_INTC;41case 3: return ATUX_INTD;42case 4: return ATUX_INTA;43default: return -1;44}45case 2:46switch (pin) {47case 1: return ATUX_INTC;48case 2: return ATUX_INTC;49case 3: return ATUX_INTC;50case 4: return ATUX_INTC;51default: return -1;52}53default: return -1;54}55}5657static struct hw_pci iq81340sc_pci __initdata = {58.swizzle = pci_std_swizzle,59.nr_controllers = 0,60.setup = iop13xx_pci_setup,61.scan = iop13xx_scan_bus,62.map_irq = iq81340sc_atux_map_irq,63.preinit = iop13xx_pci_init64};6566static int __init iq81340sc_pci_init(void)67{68iop13xx_atu_select(&iq81340sc_pci);69pci_common_init(&iq81340sc_pci);70iop13xx_map_pci_memory();7172return 0;73}7475static void __init iq81340sc_init(void)76{77iop13xx_platform_init();78iq81340sc_pci_init();79iop13xx_add_tpmi_devices();80}8182static void __init iq81340sc_timer_init(void)83{84unsigned long bus_freq = iop13xx_core_freq() / iop13xx_xsi_bus_ratio();85printk(KERN_DEBUG "%s: bus frequency: %lu\n", __func__, bus_freq);86iop_init_time(bus_freq);87}8889static struct sys_timer iq81340sc_timer = {90.init = iq81340sc_timer_init,91};9293MACHINE_START(IQ81340SC, "Intel IQ81340SC")94/* Maintainer: Dan Williams <[email protected]> */95.boot_params = 0x00000100,96.map_io = iop13xx_map_io,97.init_irq = iop13xx_init_irq,98.timer = &iq81340sc_timer,99.init_machine = iq81340sc_init,100MACHINE_END101102103