generic_board.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*
  2. * File: arch/blackfin/mach-bf533/generic_board.c
  3. * Based on: arch/blackfin/mach-bf533/ezkit.c
  4. * Author: Aidan Williams <aidan@nicta.com.au>
  5. *
  6. * Created: 2005
  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. /*
  34. * Name the Board for the /proc/cpuinfo
  35. */
  36. const char bfin_board_name[] = "UNKNOWN BOARD";
  37. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  38. static struct platform_device rtc_device = {
  39. .name = "rtc-bfin",
  40. .id = -1,
  41. };
  42. #endif
  43. /*
  44. * Driver needs to know address, irq and flag pin.
  45. */
  46. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  47. static struct resource smc91x_resources[] = {
  48. {
  49. .start = 0x20300300,
  50. .end = 0x20300300 + 16,
  51. .flags = IORESOURCE_MEM,
  52. }, {
  53. .start = IRQ_PROG_INTB,
  54. .end = IRQ_PROG_INTB,
  55. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  56. }, {
  57. .start = IRQ_PF7,
  58. .end = IRQ_PF7,
  59. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  60. },
  61. };
  62. static struct platform_device smc91x_device = {
  63. .name = "smc91x",
  64. .id = 0,
  65. .num_resources = ARRAY_SIZE(smc91x_resources),
  66. .resource = smc91x_resources,
  67. };
  68. #endif
  69. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  70. #ifdef CONFIG_BFIN_SIR0
  71. static struct resource bfin_sir0_resources[] = {
  72. {
  73. .start = 0xFFC00400,
  74. .end = 0xFFC004FF,
  75. .flags = IORESOURCE_MEM,
  76. },
  77. {
  78. .start = IRQ_UART0_RX,
  79. .end = IRQ_UART0_RX+1,
  80. .flags = IORESOURCE_IRQ,
  81. },
  82. {
  83. .start = CH_UART0_RX,
  84. .end = CH_UART0_RX+1,
  85. .flags = IORESOURCE_DMA,
  86. },
  87. };
  88. static struct platform_device bfin_sir0_device = {
  89. .name = "bfin_sir",
  90. .id = 0,
  91. .num_resources = ARRAY_SIZE(bfin_sir0_resources),
  92. .resource = bfin_sir0_resources,
  93. };
  94. #endif
  95. #endif
  96. static struct platform_device *generic_board_devices[] __initdata = {
  97. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  98. &rtc_device,
  99. #endif
  100. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  101. &smc91x_device,
  102. #endif
  103. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  104. #ifdef CONFIG_BFIN_SIR0
  105. &bfin_sir0_device,
  106. #endif
  107. #endif
  108. };
  109. static int __init generic_board_init(void)
  110. {
  111. printk(KERN_INFO "%s(): registering device resources\n", __func__);
  112. return platform_add_devices(generic_board_devices, ARRAY_SIZE(generic_board_devices));
  113. }
  114. arch_initcall(generic_board_init);