tepla.c 2.1 KB

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