memoryOperation.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * linux/arch/arm/mach-omap2/board-omap3touchbook.c
  3. *
  4. * Copyright (C) 2009 Always Innovating
  5. *
  6. * Modified from mach-omap2/board-omap3beagleboard.c
  7. *
  8. * Initial code: Grégoire Gentil, Tim Yamin
  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/io.h>
  21. #include <linux/leds.h>
  22. #include <linux/gpio.h>
  23. #include <linux/input.h>
  24. #include <linux/gpio_keys.h>
  25. #include <linux/mtd/mtd.h>
  26. #include <linux/mtd/partitions.h>
  27. #include <linux/mtd/nand.h>
  28. #include <linux/mmc/host.h>
  29. #include <linux/platform_data/spi-omap2-mcspi.h>
  30. #include <linux/spi/spi.h>
  31. #include <linux/spi/ads7846.h>
  32. #include <linux/regulator/machine.h>
  33. #include <linux/i2c/twl.h>
  34. #include <asm/mach-types.h>
  35. #include <asm/mach/arch.h>
  36. #include <asm/mach/map.h>
  37. #include <asm/mach/flash.h>
  38. #include <asm/system_info.h>
  39. #include "common.h"
  40. #include "gpmc.h"
  41. #include <linux/platform_data/mtd-nand-omap2.h>
  42. #include "mux.h"
  43. #include "hsmmc.h"
  44. #include "board-flash.h"
  45. #include "common-board-devices.h"
  46. #include <asm/setup.h>
  47. #define OMAP3_AC_GPIO 136
  48. #define OMAP3_TS_GPIO 162
  49. #define TB_BL_PWM_TIMER 9
  50. #define TB_KILL_POWER_GPIO 168
  51. #define NAND_CS 0
  52. static unsigned long touchbook_revision;
  53. static struct mtd_partition omap3touchbook_nand_partitions[] = {
  54. /* All the partition sizes are listed in terms of NAND block size */
  55. {
  56. .name = "X-Loader",
  57. .offset = 0,
  58. .size = 4 * NAND_BLOCK_SIZE,
  59. .mask_flags = MTD_WRITEABLE, /* force read-only */
  60. },
  61. {
  62. .name = "U-Boot",
  63. .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
  64. .size = 15 * NAND_BLOCK_SIZE,
  65. .mask_flags = MTD_WRITEABLE, /* force read-only */
  66. },
  67. {
  68. .name = "U-Boot Env",
  69. .offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */
  70. .size = 1 * NAND_BLOCK_SIZE,
  71. },
  72. {
  73. .name = "Kernel",
  74. .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
  75. .size = 32 * NAND_BLOCK_SIZE,
  76. },
  77. {
  78. .name = "File System",
  79. .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */
  80. .size = MTDPART_SIZ_FULL,