fluctuationAnalysisOfFireHydrantData.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * TI DaVinci DM365 EVM board support
  3. *
  4. * Copyright (C) 2009 Texas Instruments Incorporated
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation version 2.
  9. *
  10. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  11. * kind, whether express or implied; without even the implied warranty
  12. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #include <linux/kernel.h>
  16. #include <linux/init.h>
  17. #include <linux/err.h>
  18. #include <linux/i2c.h>
  19. #include <linux/io.h>
  20. #include <linux/clk.h>
  21. #include <linux/i2c/at24.h>
  22. #include <linux/leds.h>
  23. #include <linux/mtd/mtd.h>
  24. #include <linux/mtd/partitions.h>
  25. #include <linux/slab.h>
  26. #include <linux/mtd/nand.h>
  27. #include <linux/input.h>
  28. #include <linux/spi/spi.h>
  29. #include <linux/spi/eeprom.h>
  30. #include <asm/mach-types.h>
  31. #include <asm/mach/arch.h>
  32. #include <mach/mux.h>
  33. #include <mach/common.h>
  34. #include <linux/platform_data/i2c-davinci.h>
  35. #include <mach/serial.h>
  36. #include <linux/platform_data/mmc-davinci.h>
  37. #include <linux/platform_data/mtd-davinci.h>
  38. #include <linux/platform_data/keyscan-davinci.h>
  39. #include <media/tvp514x.h>
  40. #include "davinci.h"
  41. static inline int have_imager(void)
  42. {
  43. /* REVISIT when it's supported, trigger via Kconfig */
  44. return 0;
  45. }
  46. static inline int have_tvp7002(void)
  47. {
  48. /* REVISIT when it's supported, trigger via Kconfig */
  49. return 0;
  50. }
  51. #define DM365_EVM_PHY_ID "davinci_mdio-0:01"
  52. /*
  53. * A MAX-II CPLD is used for various board control functions.
  54. */
  55. #define CPLD_OFFSET(a13a8,a2a1) (((a13a8) << 10) + ((a2a1) << 3))
  56. #define CPLD_VERSION CPLD_OFFSET(0,0) /* r/o */
  57. #define CPLD_TEST CPLD_OFFSET(0,1)
  58. #define CPLD_LEDS CPLD_OFFSET(0,2)
  59. #define CPLD_MUX CPLD_OFFSET(0,3)
  60. #define CPLD_SWITCH CPLD_OFFSET(1,0) /* r/o */
  61. #define CPLD_POWER CPLD_OFFSET(1,1)
  62. #define CPLD_VIDEO CPLD_OFFSET(1,2)
  63. #define CPLD_CARDSTAT CPLD_OFFSET(1,3) /* r/o */
  64. #define CPLD_DILC_OUT CPLD_OFFSET(2,0)
  65. #define CPLD_DILC_IN CPLD_OFFSET(2,1) /* r/o */
  66. #define CPLD_IMG_DIR0 CPLD_OFFSET(2,2)
  67. #define CPLD_IMG_MUX0 CPLD_OFFSET(2,3)
  68. #define CPLD_IMG_MUX1 CPLD_OFFSET(3,0)
  69. #define CPLD_IMG_DIR1 CPLD_OFFSET(3,1)
  70. #define CPLD_IMG_MUX2 CPLD_OFFSET(3,2)
  71. #define CPLD_IMG_MUX3 CPLD_OFFSET(3,3)
  72. #define CPLD_IMG_DIR2 CPLD_OFFSET(4,0)
  73. #define CPLD_IMG_MUX4 CPLD_OFFSET(4,1)
  74. #define CPLD_IMG_MUX5 CPLD_OFFSET(4,2)
  75. #define CPLD_RESETS CPLD_OFFSET(4,3)
  76. #define CPLD_CCD_DIR1 CPLD_OFFSET(0x3e,0)
  77. #define CPLD_CCD_IO1 CPLD_OFFSET(0x3e,1)
  78. #define CPLD_CCD_DIR2 CPLD_OFFSET(0x3e,2)
  79. #define CPLD_CCD_IO2 CPLD_OFFSET(0x3e,3)
  80. #define CPLD_CCD_DIR3 CPLD_OFFSET(0x3f,0)
  81. #define CPLD_CCD_IO3 CPLD_OFFSET(0x3f,1)
  82. static void __iomem *cpld;
  83. /* NOTE: this is geared for the standard config, with a socketed
  84. * 2 GByte Micron NAND (MT29F16G08FAA) using 128KB sectors. If you
  85. * swap chips with a different block size, partitioning will
  86. * need to be changed. This NAND chip MT29F16G08FAA is the default