Path: blob/master/arch/arm/mach-iop13xx/iq81340mc.c
10817 views
/*1* iq81340mc 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; /* Flag to select which ATU(s) to initialize / disable */3031static int __init32iq81340mc_pcix_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)33{34switch (idsel) {35case 1:36switch (pin) {37case 1: return ATUX_INTB;38case 2: return ATUX_INTC;39case 3: return ATUX_INTD;40case 4: return ATUX_INTA;41default: return -1;42}43case 2:44switch (pin) {45case 1: return ATUX_INTC;46case 2: return ATUX_INTD;47case 3: return ATUX_INTC;48case 4: return ATUX_INTD;49default: return -1;50}51default: return -1;52}53}5455static struct hw_pci iq81340mc_pci __initdata = {56.swizzle = pci_std_swizzle,57.nr_controllers = 0,58.setup = iop13xx_pci_setup,59.map_irq = iq81340mc_pcix_map_irq,60.scan = iop13xx_scan_bus,61.preinit = iop13xx_pci_init,62};6364static int __init iq81340mc_pci_init(void)65{66iop13xx_atu_select(&iq81340mc_pci);67pci_common_init(&iq81340mc_pci);68iop13xx_map_pci_memory();6970return 0;71}7273static void __init iq81340mc_init(void)74{75iop13xx_platform_init();76iq81340mc_pci_init();77iop13xx_add_tpmi_devices();78}7980static void __init iq81340mc_timer_init(void)81{82unsigned long bus_freq = iop13xx_core_freq() / iop13xx_xsi_bus_ratio();83printk(KERN_DEBUG "%s: bus frequency: %lu\n", __func__, bus_freq);84iop_init_time(bus_freq);85}8687static struct sys_timer iq81340mc_timer = {88.init = iq81340mc_timer_init,89};9091MACHINE_START(IQ81340MC, "Intel IQ81340MC")92/* Maintainer: Dan Williams <[email protected]> */93.boot_params = 0x00000100,94.map_io = iop13xx_map_io,95.init_irq = iop13xx_init_irq,96.timer = &iq81340mc_timer,97.init_machine = iq81340mc_init,98MACHINE_END99100101