ibmstb4.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * arch/ppc/platforms/4xx/ibmstb4.c
  3. *
  4. * Author: Armin Kuster <akuster@mvista.com>
  5. *
  6. * 2000-2001 (c) MontaVista, Software, Inc. This file is licensed under
  7. * the terms of the GNU General Public License version 2. This program
  8. * is licensed "as is" without any warranty of any kind, whether express
  9. * or implied.
  10. */
  11. #include <linux/init.h>
  12. #include <asm/ocp.h>
  13. #include <asm/ppc4xx_pic.h>
  14. #include <platforms/4xx/ibmstb4.h>
  15. static struct ocp_func_iic_data ibmstb4_iic0_def = {
  16. .fast_mode = 0, /* Use standad mode (100Khz) */
  17. };
  18. static struct ocp_func_iic_data ibmstb4_iic1_def = {
  19. .fast_mode = 0, /* Use standad mode (100Khz) */
  20. };
  21. OCP_SYSFS_IIC_DATA()
  22. struct ocp_def core_ocp[] __initdata = {
  23. { .vendor = OCP_VENDOR_IBM,
  24. .function = OCP_FUNC_16550,
  25. .index = 0,
  26. .paddr = UART0_IO_BASE,
  27. .irq = UART0_INT,
  28. .pm = IBM_CPM_UART0,
  29. },
  30. { .vendor = OCP_VENDOR_IBM,
  31. .function = OCP_FUNC_16550,
  32. .index = 1,
  33. .paddr = UART1_IO_BASE,
  34. .irq = UART1_INT,
  35. .pm = IBM_CPM_UART1,
  36. },
  37. { .vendor = OCP_VENDOR_IBM,
  38. .function = OCP_FUNC_16550,
  39. .index = 2,
  40. .paddr = UART2_IO_BASE,
  41. .irq = UART2_INT,
  42. .pm = IBM_CPM_UART2,
  43. },
  44. { .vendor = OCP_VENDOR_IBM,
  45. .function = OCP_FUNC_IIC,
  46. .paddr = IIC0_BASE,
  47. .irq = IIC0_IRQ,
  48. .pm = IBM_CPM_IIC0,
  49. .additions = &ibmstb4_iic0_def,
  50. .show = &ocp_show_iic_data
  51. },
  52. { .vendor = OCP_VENDOR_IBM,
  53. .function = OCP_FUNC_IIC,
  54. .paddr = IIC1_BASE,
  55. .irq = IIC1_IRQ,
  56. .pm = IBM_CPM_IIC1,
  57. .additions = &ibmstb4_iic1_def,
  58. .show = &ocp_show_iic_data
  59. },
  60. { .vendor = OCP_VENDOR_IBM,
  61. .function = OCP_FUNC_GPIO,
  62. .paddr = GPIO0_BASE,
  63. .irq = OCP_IRQ_NA,
  64. .pm = IBM_CPM_GPIO0,
  65. },
  66. { .vendor = OCP_VENDOR_IBM,
  67. .function = OCP_FUNC_IDE,
  68. .paddr = IDE0_BASE,
  69. .irq = IDE0_IRQ,
  70. .pm = OCP_CPM_NA,
  71. },
  72. { .vendor = OCP_VENDOR_INVALID,
  73. }
  74. };
  75. /* Polarity and triggering settings for internal interrupt sources */
  76. struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
  77. { .polarity = 0x7fffff01,
  78. .triggering = 0x00000000,
  79. .ext_irq_mask = 0x0000007e, /* IRQ0 - IRQ5 */
  80. }
  81. };
  82. static struct resource ohci_usb_resources[] = {
  83. [0] = {
  84. .start = USB0_BASE,
  85. .end = USB0_BASE + USB0_SIZE - 1,
  86. .flags = IORESOURCE_MEM,
  87. },
  88. [1] = {
  89. .start = USB0_IRQ,
  90. .end = USB0_IRQ,
  91. .flags = IORESOURCE_IRQ,
  92. },
  93. };
  94. static u64 dma_mask = 0xffffffffULL;
  95. static struct platform_device ohci_usb_device = {
  96. .name = "ppc-soc-ohci",
  97. .id = 0,
  98. .num_resources = ARRAY_SIZE(ohci_usb_resources),
  99. .resource = ohci_usb_resources,
  100. .dev = {
  101. .dma_mask = &dma_mask,
  102. .coherent_dma_mask = 0xffffffffULL,
  103. }
  104. };
  105. static struct platform_device *ibmstb4_devs[] __initdata = {
  106. &ohci_usb_device,
  107. };
  108. static int __init
  109. ibmstb4_platform_add_devices(void)
  110. {
  111. return platform_add_devices(ibmstb4_devs, ARRAY_SIZE(ibmstb4_devs));
  112. }
  113. arch_initcall(ibmstb4_platform_add_devices);