iq81340mc.c 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * iq81340mc board support
  3. * Copyright (c) 2005-2006, Intel Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms and conditions of the GNU General Public License,
  7. * version 2, as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  16. * Place - Suite 330, Boston, MA 02111-1307 USA.
  17. *
  18. */
  19. #include <linux/pci.h>
  20. #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 "pci.h"
  26. #include <asm/mach/time.h>
  27. #include <mach/time.h>
  28. extern int init_atu; /* Flag to select which ATU(s) to initialize / disable */
  29. static int __init
  30. iq81340mc_pcix_map_irq(const struct pci_dev *dev, u8 idsel, u8 pin)
  31. {
  32. switch (idsel) {
  33. case 1:
  34. switch (pin) {
  35. case 1: return ATUX_INTB;
  36. case 2: return ATUX_INTC;
  37. case 3: return ATUX_INTD;
  38. case 4: return ATUX_INTA;
  39. default: return -1;
  40. }
  41. case 2:
  42. switch (pin) {
  43. case 1: return ATUX_INTC;
  44. case 2: return ATUX_INTD;
  45. case 3: return ATUX_INTC;
  46. case 4: return ATUX_INTD;
  47. default: return -1;
  48. }
  49. default: return -1;
  50. }
  51. }
  52. static struct hw_pci iq81340mc_pci __initdata = {
  53. .nr_controllers = 0,
  54. .setup = iop13xx_pci_setup,
  55. .map_irq = iq81340mc_pcix_map_irq,
  56. .scan = iop13xx_scan_bus,
  57. .preinit = iop13xx_pci_init,
  58. };
  59. static int __init iq81340mc_pci_init(void)
  60. {
  61. iop13xx_atu_select(&iq81340mc_pci);
  62. pci_common_init(&iq81340mc_pci);
  63. iop13xx_map_pci_memory();
  64. return 0;
  65. }
  66. static void __init iq81340mc_init(void)
  67. {
  68. iop13xx_platform_init();
  69. iq81340mc_pci_init();
  70. iop13xx_add_tpmi_devices();
  71. }
  72. static void __init iq81340mc_timer_init(void)
  73. {
  74. unsigned long bus_freq = iop13xx_core_freq() / iop13xx_xsi_bus_ratio();
  75. printk(KERN_DEBUG "%s: bus frequency: %lu\n", __func__, bus_freq);
  76. iop_init_time(bus_freq);
  77. }
  78. MACHINE_START(IQ81340MC, "Intel IQ81340MC")
  79. /* Maintainer: Dan Williams <dan.j.williams@intel.com> */
  80. .atag_offset = 0x100,
  81. .init_early = iop13xx_init_early,
  82. .map_io = iop13xx_map_io,
  83. .init_irq = iop13xx_init_irq,
  84. .init_time = iq81340mc_timer_init,
  85. .init_machine = iq81340mc_init,
  86. .restart = iop13xx_restart,
  87. .nr_irqs = NR_IOP13XX_IRQS,
  88. MACHINE_END