processor.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. #ifndef __ASM_SH_PROCESSOR_H
  2. #define __ASM_SH_PROCESSOR_H
  3. #include <asm/cpu-features.h>
  4. #include <asm/segment.h>
  5. #include <asm/cache.h>
  6. #ifndef __ASSEMBLY__
  7. /*
  8. * CPU type and hardware bug flags. Kept separately for each CPU.
  9. *
  10. * Each one of these also needs a CONFIG_CPU_SUBTYPE_xxx entry
  11. * in arch/sh/mm/Kconfig, as well as an entry in arch/sh/kernel/setup.c
  12. * for parsing the subtype in get_cpu_subtype().
  13. */
  14. enum cpu_type {
  15. /* SH-2 types */
  16. CPU_SH7619,
  17. /* SH-2A types */
  18. CPU_SH7201, CPU_SH7203, CPU_SH7206, CPU_SH7263, CPU_MXG,
  19. /* SH-3 types */
  20. CPU_SH7705, CPU_SH7706, CPU_SH7707,
  21. CPU_SH7708, CPU_SH7708S, CPU_SH7708R,
  22. CPU_SH7709, CPU_SH7709A, CPU_SH7710, CPU_SH7712,
  23. CPU_SH7720, CPU_SH7721, CPU_SH7729,
  24. /* SH-4 types */
  25. CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R,
  26. CPU_SH7760, CPU_SH4_202, CPU_SH4_501,
  27. /* SH-4A types */
  28. CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SH7786,
  29. CPU_SH7723, CPU_SH7724, CPU_SH7757, CPU_SHX3,
  30. /* SH4AL-DSP types */
  31. CPU_SH7343, CPU_SH7722, CPU_SH7366,
  32. /* SH-5 types */
  33. CPU_SH5_101, CPU_SH5_103,
  34. /* Unknown subtype */
  35. CPU_SH_NONE
  36. };
  37. enum cpu_family {
  38. CPU_FAMILY_SH2,
  39. CPU_FAMILY_SH2A,
  40. CPU_FAMILY_SH3,
  41. CPU_FAMILY_SH4,
  42. CPU_FAMILY_SH4A,
  43. CPU_FAMILY_SH4AL_DSP,
  44. CPU_FAMILY_SH5,
  45. CPU_FAMILY_UNKNOWN,
  46. };
  47. /*
  48. * TLB information structure
  49. *
  50. * Defined for both I and D tlb, per-processor.
  51. */
  52. struct tlb_info {
  53. unsigned long long next;
  54. unsigned long long first;
  55. unsigned long long last;
  56. unsigned int entries;
  57. unsigned int step;
  58. unsigned long flags;
  59. };
  60. struct sh_cpuinfo {
  61. unsigned int type, family;
  62. int cut_major, cut_minor;
  63. unsigned long loops_per_jiffy;
  64. unsigned long asid_cache;
  65. struct cache_info icache; /* Primary I-cache */
  66. struct cache_info dcache; /* Primary D-cache */
  67. struct cache_info scache; /* Secondary cache */
  68. /* TLB info */
  69. struct tlb_info itlb;
  70. struct tlb_info dtlb;
  71. unsigned long flags;
  72. } __attribute__ ((aligned(L1_CACHE_BYTES)));
  73. extern struct sh_cpuinfo cpu_data[];
  74. #define boot_cpu_data cpu_data[0]
  75. #define current_cpu_data cpu_data[smp_processor_id()]
  76. #define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
  77. #define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory")
  78. #define cpu_relax() barrier()
  79. /* Forward decl */
  80. struct seq_operations;
  81. extern struct pt_regs fake_swapper_regs;
  82. /* arch/sh/kernel/setup.c */
  83. const char *get_cpu_subtype(struct sh_cpuinfo *c);
  84. extern const struct seq_operations cpuinfo_op;
  85. /* processor boot mode configuration */
  86. #define MODE_PIN0 (1 << 0)
  87. #define MODE_PIN1 (1 << 1)
  88. #define MODE_PIN2 (1 << 2)
  89. #define MODE_PIN3 (1 << 3)
  90. #define MODE_PIN4 (1 << 4)
  91. #define MODE_PIN5 (1 << 5)
  92. #define MODE_PIN6 (1 << 6)
  93. #define MODE_PIN7 (1 << 7)
  94. #define MODE_PIN8 (1 << 8)
  95. #define MODE_PIN9 (1 << 9)
  96. #define MODE_PIN10 (1 << 10)
  97. #define MODE_PIN11 (1 << 11)
  98. #define MODE_PIN12 (1 << 12)
  99. #define MODE_PIN13 (1 << 13)
  100. #define MODE_PIN14 (1 << 14)
  101. #define MODE_PIN15 (1 << 15)
  102. int generic_mode_pins(void);
  103. int test_mode_pin(int pin);
  104. #ifdef CONFIG_VSYSCALL
  105. int vsyscall_init(void);
  106. #else
  107. #define vsyscall_init() do { } while (0)
  108. #endif
  109. #endif /* __ASSEMBLY__ */
  110. #ifdef CONFIG_SUPERH32
  111. # include "processor_32.h"
  112. #else
  113. # include "processor_64.h"
  114. #endif
  115. #endif /* __ASM_SH_PROCESSOR_H */