influenceAnalysisOfCableAging.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. * linux/arch/arm/mach-omap2/board-omap3evm.c
  3. *
  4. * Copyright (C) 2008 Texas Instruments
  5. *
  6. * Modified from mach-omap2/board-3430sdp.c
  7. *
  8. * Initial code: Syed Mohammed Khasim
  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/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/delay.h>
  18. #include <linux/err.h>
  19. #include <linux/clk.h>
  20. #include <linux/gpio.h>
  21. #include <linux/input.h>
  22. #include <linux/input/matrix_keypad.h>
  23. #include <linux/leds.h>
  24. #include <linux/interrupt.h>
  25. #include <linux/mtd/mtd.h>
  26. #include <linux/mtd/partitions.h>
  27. #include <linux/mtd/nand.h>
  28. #include <linux/spi/spi.h>
  29. #include <linux/spi/ads7846.h>
  30. #include <linux/i2c/twl.h>
  31. #include <linux/usb/otg.h>
  32. #include <linux/usb/musb.h>
  33. #include <linux/usb/nop-usb-xceiv.h>
  34. #include <linux/smsc911x.h>
  35. #include <linux/wl12xx.h>
  36. #include <linux/regulator/fixed.h>
  37. #include <linux/regulator/machine.h>
  38. #include <linux/mmc/host.h>
  39. #include <linux/export.h>
  40. #include <asm/mach-types.h>
  41. #include <asm/mach/arch.h>
  42. #include <asm/mach/map.h>
  43. #include <linux/platform_data/mtd-nand-omap2.h>
  44. #include "common.h"
  45. #include <linux/platform_data/spi-omap2-mcspi.h>
  46. #include <video/omapdss.h>
  47. #include <video/omap-panel-tfp410.h>
  48. #include "soc.h"
  49. #include "mux.h"
  50. #include "sdram-micron-mt46h32m32lf-6.h"
  51. #include "hsmmc.h"
  52. #include "common-board-devices.h"
  53. #include "board-flash.h"
  54. #define NAND_CS 0
  55. #define OMAP3_EVM_TS_GPIO 175
  56. #define OMAP3_EVM_EHCI_VBUS 22
  57. #define OMAP3_EVM_EHCI_SELECT 61
  58. #define OMAP3EVM_ETHR_START 0x2c000000
  59. #define OMAP3EVM_ETHR_SIZE 1024
  60. #define OMAP3EVM_ETHR_ID_REV 0x50
  61. #define OMAP3EVM_ETHR_GPIO_IRQ 176
  62. #define OMAP3EVM_SMSC911X_CS 5
  63. /*
  64. * Eth Reset signal
  65. * 64 = Generation 1 (<=RevD)
  66. * 7 = Generation 2 (>=RevE)
  67. */
  68. #define OMAP3EVM_GEN1_ETHR_GPIO_RST 64
  69. #define OMAP3EVM_GEN2_ETHR_GPIO_RST 7
  70. /*
  71. * OMAP35x EVM revision
  72. * Run time detection of EVM revision is done by reading Ethernet
  73. * PHY ID -
  74. * GEN_1 = 0x01150000
  75. * GEN_2 = 0x92200000
  76. */
  77. enum {
  78. OMAP3EVM_BOARD_GEN_1 = 0, /* EVM Rev between A - D */
  79. OMAP3EVM_BOARD_GEN_2, /* EVM Rev >= Rev E */
  80. };
  81. static u8 omap3_evm_version;
  82. static u8 get_omap3_evm_rev(void)
  83. {
  84. return omap3_evm_version;
  85. }
  86. static void __init omap3_evm_get_revision(void)
  87. {
  88. void __iomem *ioaddr;
  89. unsigned int smsc_id;
  90. /* Ethernet PHY ID is stored at ID_REV register */
  91. ioaddr = ioremap_nocache(OMAP3EVM_ETHR_START, SZ_1K);
  92. if (!ioaddr)
  93. return;
  94. smsc_id = readl(ioaddr + OMAP3EVM_ETHR_ID_REV) & 0xFFFF0000;
  95. iounmap(ioaddr);
  96. switch (smsc_id) {
  97. /*SMSC9115 chipset*/
  98. case 0x01150000:
  99. omap3_evm_version = OMAP3EVM_BOARD_GEN_1;
  100. break;
  101. /*SMSC 9220 chipset*/
  102. case 0x92200000:
  103. default:
  104. omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
  105. }
  106. }
  107. #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
  108. #include "gpmc-smsc911x.h"
  109. static struct omap_smsc911x_platform_data smsc911x_cfg = {
  110. .cs = OMAP3EVM_SMSC911X_CS,
  111. .gpio_irq = OMAP3EVM_ETHR_GPIO_IRQ,
  112. .gpio_reset = -EINVAL,
  113. .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
  114. };
  115. static inline void __init omap3evm_init_smsc911x(void)
  116. {
  117. /* Configure ethernet controller reset gpio */
  118. if (cpu_is_omap3430()) {
  119. if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
  120. smsc911x_cfg.gpio_reset = OMAP3EVM_GEN1_ETHR_GPIO_RST;
  121. else
  122. smsc911x_cfg.gpio_reset = OMAP3EVM_GEN2_ETHR_GPIO_RST;
  123. }
  124. gpmc_smsc911x_init(&smsc911x_cfg);
  125. }
  126. #else
  127. static inline void __init omap3evm_init_smsc911x(void) { return; }
  128. #endif
  129. /*
  130. * OMAP3EVM LCD Panel control signals
  131. */
  132. #define OMAP3EVM_LCD_PANEL_LR 2
  133. #define OMAP3EVM_LCD_PANEL_UD 3
  134. #define OMAP3EVM_LCD_PANEL_INI 152
  135. #define OMAP3EVM_LCD_PANEL_ENVDD 153
  136. #define OMAP3EVM_LCD_PANEL_QVGA 154
  137. #define OMAP3EVM_LCD_PANEL_RESB 155
  138. #define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210
  139. #define OMAP3EVM_DVI_PANEL_EN_GPIO 199