tepla.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * Copyright 2004-2007 Analog Devices Inc.
  3. * 2005 National ICT Australia (NICTA)
  4. * Aidan Williams <aidan@nicta.com.au>
  5. *
  6. * Thanks to Jamey Hicks.
  7. *
  8. * Only SMSC91C1111 was registered, may do more later.
  9. *
  10. * Licensed under the GPL-2
  11. */
  12. #include <linux/device.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/irq.h>
  15. const char bfin_board_name[] = "Tepla-BF561";
  16. /*
  17. * Driver needs to know address, irq and flag pin.
  18. */
  19. static struct resource smc91x_resources[] = {
  20. {
  21. .start = 0x2C000300,
  22. .end = 0x2C000320,
  23. .flags = IORESOURCE_MEM,
  24. }, {
  25. .start = IRQ_PROG_INTB,
  26. .end = IRQ_PROG_INTB,
  27. .flags = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL,
  28. }, {
  29. .start = IRQ_PF7,
  30. .end = IRQ_PF7,
  31. .flags = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL,
  32. },
  33. };
  34. static struct platform_device smc91x_device = {
  35. .name = "smc91x",
  36. .id = 0,
  37. .num_resources = ARRAY_SIZE(smc91x_resources),
  38. .resource = smc91x_resources,
  39. };
  40. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  41. #ifdef CONFIG_BFIN_SIR0
  42. static struct resource bfin_sir0_resources[] = {
  43. {
  44. .start = 0xFFC00400,
  45. .end = 0xFFC004FF,
  46. .flags = IORESOURCE_MEM,
  47. },
  48. {
  49. .start = IRQ_UART0_RX,
  50. .end = IRQ_UART0_RX+1,
  51. .flags = IORESOURCE_IRQ,
  52. },
  53. {
  54. .start = CH_UART0_RX,
  55. .end = CH_UART0_RX+1,
  56. .flags = IORESOURCE_DMA,
  57. },
  58. };
  59. static struct platform_device bfin_sir0_device = {
  60. .name = "bfin_sir",
  61. .id = 0,
  62. .num_resources = ARRAY_SIZE(bfin_sir0_resources),
  63. .resource = bfin_sir0_resources,
  64. };
  65. #endif
  66. #endif
  67. static struct platform_device *tepla_devices[] __initdata = {
  68. &smc91x_device,
  69. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  70. #ifdef CONFIG_BFIN_SIR0
  71. &bfin_sir0_device,
  72. #endif
  73. #endif
  74. };
  75. static int __init tepla_init(void)
  76. {
  77. printk(KERN_INFO "%s(): registering device resources\n", __func__);
  78. return platform_add_devices(tepla_devices, ARRAY_SIZE(tepla_devices));
  79. }
  80. arch_initcall(tepla_init);