iq80331.c 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /*
  2. * arch/arm/mach-iop33x/iq80331.c
  3. *
  4. * Board support code for the Intel IQ80331 platform.
  5. *
  6. * Author: Dave Jiang <dave.jiang@intel.com>
  7. * Copyright (C) 2003 Intel Corp.
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2 of the License, or (at your
  12. * option) any later version.
  13. */
  14. #include <linux/mm.h>
  15. #include <linux/init.h>
  16. #include <linux/kernel.h>
  17. #include <linux/pci.h>
  18. #include <linux/string.h>
  19. #include <linux/serial_core.h>
  20. #include <linux/serial_8250.h>
  21. #include <linux/mtd/physmap.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/io.h>
  24. #include <mach/hardware.h>
  25. #include <asm/irq.h>
  26. #include <asm/mach/arch.h>
  27. #include <asm/mach/map.h>
  28. #include <asm/mach/pci.h>
  29. #include <asm/mach/time.h>
  30. #include <asm/mach-types.h>
  31. #include <asm/page.h>
  32. #include <asm/pgtable.h>
  33. #include <mach/time.h>
  34. /*
  35. * IQ80331 timer tick configuration.
  36. */
  37. static void __init iq80331_timer_init(void)
  38. {
  39. /* D-Step parts run at a higher internal bus frequency */
  40. if (*IOP3XX_ATURID >= 0xa)
  41. iop_init_time(333000000);
  42. else
  43. iop_init_time(266000000);
  44. }
  45. static struct sys_timer iq80331_timer = {
  46. .init = iq80331_timer_init,
  47. };
  48. /*
  49. * IQ80331 PCI.
  50. */
  51. static int __init
  52. iq80331_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
  53. {
  54. int irq;
  55. if (slot == 1 && pin == 1) {
  56. /* PCI-X Slot INTA */
  57. irq = IRQ_IOP33X_XINT1;
  58. } else if (slot == 1 && pin == 2) {
  59. /* PCI-X Slot INTB */
  60. irq = IRQ_IOP33X_XINT2;
  61. } else if (slot == 1 && pin == 3) {
  62. /* PCI-X Slot INTC */
  63. irq = IRQ_IOP33X_XINT3;
  64. } else if (slot == 1 && pin == 4) {
  65. /* PCI-X Slot INTD */
  66. irq = IRQ_IOP33X_XINT0;
  67. } else if (slot == 2) {
  68. /* GigE */
  69. irq = IRQ_IOP33X_XINT2;
  70. } else {
  71. printk(KERN_ERR "iq80331_pci_map_irq() called for unknown "
  72. "device PCI:%d:%d:%d\n", dev->bus->number,
  73. PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
  74. irq = -1;
  75. }
  76. return irq;
  77. }
  78. static struct hw_pci iq80331_pci __initdata = {
  79. .swizzle = pci_std_swizzle,
  80. .nr_controllers = 1,
  81. .setup = iop3xx_pci_setup,
  82. .preinit = iop3xx_pci_preinit_cond,
  83. .scan = iop3xx_pci_scan_bus,
  84. .map_irq = iq80331_pci_map_irq,
  85. };
  86. static int __init iq80331_pci_init(void)
  87. {
  88. if ((iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) &&
  89. machine_is_iq80331())
  90. pci_common_init(&iq80331_pci);
  91. return 0;
  92. }
  93. subsys_initcall(iq80331_pci_init);
  94. /*
  95. * IQ80331 machine initialisation.
  96. */
  97. static struct physmap_flash_data iq80331_flash_data = {
  98. .width = 1,
  99. };
  100. static struct resource iq80331_flash_resource = {
  101. .start = 0xc0000000,
  102. .end = 0xc07fffff,
  103. .flags = IORESOURCE_MEM,
  104. };
  105. static struct platform_device iq80331_flash_device = {
  106. .name = "physmap-flash",
  107. .id = 0,
  108. .dev = {
  109. .platform_data = &iq80331_flash_data,
  110. },
  111. .num_resources = 1,
  112. .resource = &iq80331_flash_resource,
  113. };
  114. static void __init iq80331_init_machine(void)
  115. {
  116. platform_device_register(&iop3xx_i2c0_device);
  117. platform_device_register(&iop3xx_i2c1_device);
  118. platform_device_register(&iop33x_uart0_device);
  119. platform_device_register(&iop33x_uart1_device);
  120. platform_device_register(&iq80331_flash_device);
  121. platform_device_register(&iop3xx_dma_0_channel);
  122. platform_device_register(&iop3xx_dma_1_channel);
  123. platform_device_register(&iop3xx_aau_channel);
  124. }
  125. MACHINE_START(IQ80331, "Intel IQ80331")
  126. /* Maintainer: Intel Corp. */
  127. .boot_params = 0x00000100,
  128. .map_io = iop3xx_map_io,
  129. .init_irq = iop33x_init_irq,
  130. .timer = &iq80331_timer,
  131. .init_machine = iq80331_init_machine,
  132. MACHINE_END