ibmstb4.c 2.8 KB

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