generic_board.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * File: arch/blackfin/mach-bf561/generic_board.c
  3. * Based on: arch/blackfin/mach-bf533/ezkit.c
  4. * Author: Aidan Williams <aidan@nicta.com.au>
  5. *
  6. * Created:
  7. * Description:
  8. *
  9. * Modified:
  10. * Copyright 2005 National ICT Australia (NICTA)
  11. * Copyright 2004-2006 Analog Devices Inc.
  12. *
  13. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  14. *
  15. * This program is free software; you can redistribute it and/or modify
  16. * it under the terms of the GNU General Public License as published by
  17. * the Free Software Foundation; either version 2 of the License, or
  18. * (at your option) any later version.
  19. *
  20. * This program is distributed in the hope that it will be useful,
  21. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. * GNU General Public License for more details.
  24. *
  25. * You should have received a copy of the GNU General Public License
  26. * along with this program; if not, see the file COPYING, or write
  27. * to the Free Software Foundation, Inc.,
  28. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  29. */
  30. #include <linux/device.h>
  31. #include <linux/platform_device.h>
  32. #include <linux/irq.h>
  33. const char bfin_board_name[] = "UNKNOWN BOARD";
  34. /*
  35. * Driver needs to know address, irq and flag pin.
  36. */
  37. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  38. static struct resource smc91x_resources[] = {
  39. {
  40. .start = 0x2C010300,
  41. .end = 0x2C010300 + 16,
  42. .flags = IORESOURCE_MEM,
  43. }, {
  44. .start = IRQ_PROG_INTB,
  45. .end = IRQ_PROG_INTB,
  46. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  47. }, {
  48. .start = IRQ_PF9,
  49. .end = IRQ_PF9,
  50. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  51. },
  52. };
  53. static struct platform_device smc91x_device = {
  54. .name = "smc91x",
  55. .id = 0,
  56. .num_resources = ARRAY_SIZE(smc91x_resources),
  57. .resource = smc91x_resources,
  58. };
  59. #endif
  60. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  61. #ifdef CONFIG_BFIN_SIR0
  62. static struct resource bfin_sir0_resources[] = {
  63. {
  64. .start = 0xFFC00400,
  65. .end = 0xFFC004FF,
  66. .flags = IORESOURCE_MEM,
  67. },
  68. {
  69. .start = IRQ_UART0_RX,
  70. .end = IRQ_UART0_RX+1,
  71. .flags = IORESOURCE_IRQ,
  72. },
  73. {
  74. .start = CH_UART0_RX,
  75. .end = CH_UART0_RX+1,
  76. .flags = IORESOURCE_DMA,
  77. },
  78. };
  79. static struct platform_device bfin_sir0_device = {
  80. .name = "bfin_sir",
  81. .id = 0,
  82. .num_resources = ARRAY_SIZE(bfin_sir0_resources),
  83. .resource = bfin_sir0_resources,
  84. };
  85. #endif
  86. #endif
  87. static struct platform_device *generic_board_devices[] __initdata = {
  88. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  89. &smc91x_device,
  90. #endif
  91. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  92. #ifdef CONFIG_BFIN_SIR0
  93. &bfin_sir0_device,
  94. #endif
  95. #endif
  96. };
  97. static int __init generic_board_init(void)
  98. {
  99. printk(KERN_INFO "%s(): registering device resources\n", __func__);
  100. return platform_add_devices(generic_board_devices,
  101. ARRAY_SIZE(generic_board_devices));
  102. }
  103. arch_initcall(generic_board_init);