processor.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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, CPU_SH7372,
  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. #ifdef CONFIG_SMP
  72. struct task_struct *idle;
  73. #endif
  74. unsigned int phys_bits;
  75. unsigned long flags;
  76. } __attribute__ ((aligned(L1_CACHE_BYTES)));
  77. extern struct sh_cpuinfo cpu_data[];
  78. #define boot_cpu_data cpu_data[0]
  79. #define current_cpu_data cpu_data[smp_processor_id()]
  80. #define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
  81. #define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory")
  82. #define cpu_relax() barrier()
  83. void default_idle(void);
  84. void cpu_idle_wait(void);
  85. void stop_this_cpu(void *);
  86. /* Forward decl */
  87. struct seq_operations;
  88. struct task_struct;
  89. extern struct pt_regs fake_swapper_regs;
  90. extern void cpu_init(void);
  91. extern void cpu_probe(void);
  92. /* arch/sh/kernel/process.c */
  93. extern unsigned int xstate_size;
  94. extern void free_thread_xstate(struct task_struct *);
  95. extern struct kmem_cache *task_xstate_cachep;
  96. /* arch/sh/mm/alignment.c */
  97. extern int get_unalign_ctl(struct task_struct *, unsigned long addr);
  98. extern int set_unalign_ctl(struct task_struct *, unsigned int val);
  99. #define GET_UNALIGN_CTL(tsk, addr) get_unalign_ctl((tsk), (addr))
  100. #define SET_UNALIGN_CTL(tsk, val) set_unalign_ctl((tsk), (val))
  101. /* arch/sh/mm/init.c */
  102. extern unsigned int mem_init_done;
  103. /* arch/sh/kernel/setup.c */
  104. const char *get_cpu_subtype(struct sh_cpuinfo *c);
  105. extern const struct seq_operations cpuinfo_op;
  106. /* thread_struct flags */
  107. #define SH_THREAD_UAC_NOPRINT (1 << 0)
  108. #define SH_THREAD_UAC_SIGBUS (1 << 1)
  109. #define SH_THREAD_UAC_MASK (SH_THREAD_UAC_NOPRINT | SH_THREAD_UAC_SIGBUS)
  110. /* processor boot mode configuration */
  111. #define MODE_PIN0 (1 << 0)
  112. #define MODE_PIN1 (1 << 1)
  113. #define MODE_PIN2 (1 << 2)
  114. #define MODE_PIN3 (1 << 3)
  115. #define MODE_PIN4 (1 << 4)
  116. #define MODE_PIN5 (1 << 5)
  117. #define MODE_PIN6 (1 << 6)
  118. #define MODE_PIN7 (1 << 7)
  119. #define MODE_PIN8 (1 << 8)
  120. #define MODE_PIN9 (1 << 9)
  121. #define MODE_PIN10 (1 << 10)
  122. #define MODE_PIN11 (1 << 11)
  123. #define MODE_PIN12 (1 << 12)
  124. #define MODE_PIN13 (1 << 13)
  125. #define MODE_PIN14 (1 << 14)
  126. #define MODE_PIN15 (1 << 15)
  127. int generic_mode_pins(void);
  128. int test_mode_pin(int pin);
  129. #ifdef CONFIG_VSYSCALL
  130. int vsyscall_init(void);
  131. #else
  132. #define vsyscall_init() do { } while (0)
  133. #endif
  134. /*
  135. * SH-2A has both 16 and 32-bit opcodes, do lame encoding checks.
  136. */
  137. #ifdef CONFIG_CPU_SH2A
  138. extern unsigned int instruction_size(unsigned int insn);
  139. #elif defined(CONFIG_SUPERH32)
  140. #define instruction_size(insn) (2)
  141. #else
  142. #define instruction_size(insn) (4)
  143. #endif
  144. #endif /* __ASSEMBLY__ */
  145. #ifdef CONFIG_SUPERH32
  146. # include "processor_32.h"
  147. #else
  148. # include "processor_64.h"
  149. #endif
  150. #endif /* __ASM_SH_PROCESSOR_H */