ibmstb4.c 2.9 KB

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