calculationDeviationOfLeakageCurrent.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * linux/arch/arm/mach-sa1100/assabet.c
  3. *
  4. * Author: Nicolas Pitre
  5. *
  6. * This file contains all Assabet-specific tweaks.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/kernel.h>
  14. #include <linux/module.h>
  15. #include <linux/errno.h>
  16. #include <linux/ioport.h>
  17. #include <linux/platform_data/sa11x0-serial.h>
  18. #include <linux/serial_core.h>
  19. #include <linux/mfd/ucb1x00.h>
  20. #include <linux/mtd/mtd.h>
  21. #include <linux/mtd/partitions.h>
  22. #include <linux/delay.h>
  23. #include <linux/mm.h>
  24. #include <linux/leds.h>
  25. #include <linux/slab.h>
  26. #include <video/sa1100fb.h>
  27. #include <mach/hardware.h>
  28. #include <asm/mach-types.h>
  29. #include <asm/setup.h>
  30. #include <asm/page.h>
  31. #include <asm/pgtable-hwdef.h>
  32. #include <asm/pgtable.h>
  33. #include <asm/tlbflush.h>
  34. #include <asm/mach/arch.h>
  35. #include <asm/mach/flash.h>
  36. #include <asm/mach/irda.h>
  37. #include <asm/mach/map.h>
  38. #include <mach/assabet.h>
  39. #include <linux/platform_data/mfd-mcp-sa11x0.h>
  40. #include <mach/irqs.h>
  41. #include "generic.h"
  42. #define ASSABET_BCR_DB1110 \
  43. (ASSABET_BCR_SPK_OFF | \
  44. ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \
  45. ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \
  46. ASSABET_BCR_IRDA_MD0)
  47. #define ASSABET_BCR_DB1111 \
  48. (ASSABET_BCR_SPK_OFF | \
  49. ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \
  50. ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \
  51. ASSABET_BCR_CF_BUS_OFF | ASSABET_BCR_STEREO_LB | \
  52. ASSABET_BCR_IRDA_MD0 | ASSABET_BCR_CF_RST)
  53. unsigned long SCR_value = ASSABET_SCR_INIT;
  54. EXPORT_SYMBOL(SCR_value);
  55. static unsigned long BCR_value = ASSABET_BCR_DB1110;
  56. void ASSABET_BCR_frob(unsigned int mask, unsigned int val)
  57. {
  58. unsigned long flags;
  59. local_irq_save(flags);
  60. BCR_value = (BCR_value & ~mask) | val;
  61. ASSABET_BCR = BCR_value;
  62. local_irq_restore(flags);
  63. }
  64. EXPORT_SYMBOL(ASSABET_BCR_frob);
  65. static void assabet_ucb1x00_reset(enum ucb1x00_reset state)
  66. {
  67. if (state == UCB_RST_PROBE)
  68. ASSABET_BCR_set(ASSABET_BCR_CODEC_RST);
  69. }
  70. /*
  71. * Assabet flash support code.
  72. */
  73. #ifdef ASSABET_REV_4
  74. /*
  75. * Phase 4 Assabet has two 28F160B3 flash parts in bank 0:
  76. */
  77. static struct mtd_partition assabet_partitions[] = {
  78. {
  79. .name = "bootloader",
  80. .size = 0x00020000,
  81. .offset = 0,
  82. .mask_flags = MTD_WRITEABLE,
  83. }, {
  84. .name = "bootloader params",
  85. .size = 0x00020000,
  86. .offset = MTDPART_OFS_APPEND,
  87. .mask_flags = MTD_WRITEABLE,
  88. }, {
  89. .name = "jffs",
  90. .size = MTDPART_SIZ_FULL,
  91. .offset = MTDPART_OFS_APPEND,
  92. }
  93. };
  94. #else
  95. /*
  96. * Phase 5 Assabet has two 28F128J3A flash parts in bank 0:
  97. */
  98. static struct mtd_partition assabet_partitions[] = {
  99. {
  100. .name = "bootloader",
  101. .size = 0x00040000,
  102. .offset = 0,
  103. .mask_flags = MTD_WRITEABLE,
  104. }, {
  105. .name = "bootloader params",
  106. .size = 0x00040000,
  107. .offset = MTDPART_OFS_APPEND,
  108. .mask_flags = MTD_WRITEABLE,
  109. }, {
  110. .name = "jffs",
  111. .size = MTDPART_SIZ_FULL,
  112. .offset = MTDPART_OFS_APPEND,
  113. }
  114. };
  115. #endif