realizationOfDataCalculation.c 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /*
  2. * linux/arch/arm/mach-omap1/board-osk.c
  3. *
  4. * Board specific init for OMAP5912 OSK
  5. *
  6. * Written by Dirk Behme <dirk.behme@de.bosch.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. *
  13. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  14. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  15. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  16. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  17. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  18. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  20. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  21. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  22. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. *
  24. * You should have received a copy of the GNU General Public License along
  25. * with this program; if not, write to the Free Software Foundation, Inc.,
  26. * 675 Mass Ave, Cambridge, MA 02139, USA.
  27. */
  28. #include <linux/gpio.h>
  29. #include <linux/kernel.h>
  30. #include <linux/init.h>
  31. #include <linux/platform_device.h>
  32. #include <linux/interrupt.h>
  33. #include <linux/irq.h>
  34. #include <linux/i2c.h>
  35. #include <linux/leds.h>
  36. #include <linux/smc91x.h>
  37. #include <linux/omapfb.h>
  38. #include <linux/mtd/mtd.h>
  39. #include <linux/mtd/partitions.h>
  40. #include <linux/mtd/physmap.h>
  41. #include <linux/i2c/tps65010.h>
  42. #include <linux/platform_data/gpio-omap.h>
  43. #include <linux/platform_data/omap1_bl.h>
  44. #include <asm/mach-types.h>
  45. #include <asm/mach/arch.h>
  46. #include <asm/mach/map.h>
  47. #include <mach/flash.h>
  48. #include <mach/mux.h>
  49. #include <mach/tc.h>
  50. #include <mach/hardware.h>
  51. #include <mach/usb.h>
  52. #include "common.h"
  53. /* At OMAP5912 OSK the Ethernet is directly connected to CS1 */
  54. #define OMAP_OSK_ETHR_START 0x04800300
  55. /* TPS65010 has four GPIOs. nPG and LED2 can be treated like GPIOs with
  56. * alternate pin configurations for hardware-controlled blinking.
  57. */
  58. #define OSK_TPS_GPIO_BASE (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */)
  59. # define OSK_TPS_GPIO_USB_PWR_EN (OSK_TPS_GPIO_BASE + 0)
  60. # define OSK_TPS_GPIO_LED_D3 (OSK_TPS_GPIO_BASE + 1)
  61. # define OSK_TPS_GPIO_LAN_RESET (OSK_TPS_GPIO_BASE + 2)
  62. # define OSK_TPS_GPIO_DSP_PWR_EN (OSK_TPS_GPIO_BASE + 3)
  63. # define OSK_TPS_GPIO_LED_D9 (OSK_TPS_GPIO_BASE + 4)
  64. # define OSK_TPS_GPIO_LED_D2 (OSK_TPS_GPIO_BASE + 5)
  65. static struct mtd_partition osk_partitions[] = {
  66. /* bootloader (U-Boot, etc) in first sector */
  67. {
  68. .name = "bootloader",
  69. .offset = 0,
  70. .size = SZ_128K,
  71. .mask_flags = MTD_WRITEABLE, /* force read-only */
  72. },
  73. /* bootloader params in the next sector */
  74. {
  75. .name = "params",
  76. .offset = MTDPART_OFS_APPEND,
  77. .size = SZ_128K,
  78. .mask_flags = 0,
  79. }, {
  80. .name = "kernel",
  81. .offset = MTDPART_OFS_APPEND,
  82. .size = SZ_2M,
  83. .mask_flags = 0
  84. }, {
  85. .name = "filesystem",
  86. .offset = MTDPART_OFS_APPEND,
  87. .size = MTDPART_SIZ_FULL,
  88. .mask_flags = 0
  89. }
  90. };
  91. static struct physmap_flash_data osk_flash_data = {
  92. .width = 2,
  93. .set_vpp = omap1_set_vpp,
  94. .parts = osk_partitions,
  95. .nr_parts = ARRAY_SIZE(osk_partitions),
  96. };
  97. static struct resource osk_flash_resource = {
  98. /* this is on CS3, wherever it's mapped */
  99. .flags = IORESOURCE_MEM,
  100. };
  101. static struct platform_device osk5912_flash_device = {
  102. .name = "physmap-flash",
  103. .id = 0,
  104. .dev = {
  105. .platform_data = &osk_flash_data,
  106. },
  107. .num_resources = 1,
  108. .resource = &osk_flash_resource,
  109. };
  110. static struct smc91x_platdata osk5912_smc91x_info = {
  111. .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
  112. .leda = RPC_LED_100_10,
  113. .ledb = RPC_LED_TX_RX,
  114. };
  115. static struct resource osk5912_smc91x_resources[] = {
  116. [0] = {
  117. .start = OMAP_OSK_ETHR_START, /* Physical */
  118. .end = OMAP_OSK_ETHR_START + 0xf,
  119. .flags = IORESOURCE_MEM,
  120. },
  121. [1] = {
  122. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
  123. },
  124. };
  125. static struct platform_device osk5912_smc91x_device = {
  126. .name = "smc91x",
  127. .id = -1,
  128. .dev = {
  129. .platform_data = &osk5912_smc91x_info,
  130. },
  131. .num_resources = ARRAY_SIZE(osk5912_smc91x_resources),
  132. .resource = osk5912_smc91x_resources,
  133. };
  134. static struct resource osk5912_cf_resources[] = {
  135. [0] = {
  136. .flags = IORESOURCE_IRQ,
  137. },
  138. };
  139. static struct platform_device osk5912_cf_device = {
  140. .name = "omap_cf",
  141. .id = -1,
  142. .dev = {
  143. .platform_data = (void *) 2 /* CS2 */,
  144. },
  145. .num_resources = ARRAY_SIZE(osk5912_cf_resources),
  146. .resource = osk5912_cf_resources,
  147. };
  148. static struct platform_device *osk5912_devices[] __initdata = {