processor.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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_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. /*
  38. * TLB information structure
  39. *
  40. * Defined for both I and D tlb, per-processor.
  41. */
  42. struct tlb_info {
  43. unsigned long long next;
  44. unsigned long long first;
  45. unsigned long long last;
  46. unsigned int entries;
  47. unsigned int step;
  48. unsigned long flags;
  49. };
  50. struct sh_cpuinfo {
  51. unsigned int type;
  52. int cut_major, cut_minor;
  53. unsigned long loops_per_jiffy;
  54. unsigned long asid_cache;
  55. struct cache_info icache; /* Primary I-cache */
  56. struct cache_info dcache; /* Primary D-cache */
  57. struct cache_info scache; /* Secondary cache */
  58. /* TLB info */
  59. struct tlb_info itlb;
  60. struct tlb_info dtlb;
  61. unsigned long flags;
  62. } __attribute__ ((aligned(L1_CACHE_BYTES)));
  63. extern struct sh_cpuinfo cpu_data[];
  64. #define boot_cpu_data cpu_data[0]
  65. #define current_cpu_data cpu_data[smp_processor_id()]
  66. #define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
  67. #define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory")
  68. #define cpu_relax() barrier()
  69. /* Forward decl */
  70. struct seq_operations;
  71. extern struct pt_regs fake_swapper_regs;
  72. /* arch/sh/kernel/setup.c */
  73. const char *get_cpu_subtype(struct sh_cpuinfo *c);
  74. extern const struct seq_operations cpuinfo_op;
  75. /* processor boot mode configuration */
  76. #define MODE_PIN0 (1 << 0)
  77. #define MODE_PIN1 (1 << 1)
  78. #define MODE_PIN2 (1 << 2)
  79. #define MODE_PIN3 (1 << 3)
  80. #define MODE_PIN4 (1 << 4)
  81. #define MODE_PIN5 (1 << 5)
  82. #define MODE_PIN6 (1 << 6)
  83. #define MODE_PIN7 (1 << 7)
  84. #define MODE_PIN8 (1 << 8)
  85. #define MODE_PIN9 (1 << 9)
  86. #define MODE_PIN10 (1 << 10)
  87. #define MODE_PIN11 (1 << 11)
  88. #define MODE_PIN12 (1 << 12)
  89. #define MODE_PIN13 (1 << 13)
  90. #define MODE_PIN14 (1 << 14)
  91. #define MODE_PIN15 (1 << 15)
  92. int generic_mode_pins(void);
  93. int test_mode_pin(int pin);
  94. #ifdef CONFIG_VSYSCALL
  95. int vsyscall_init(void);
  96. #else
  97. #define vsyscall_init() do { } while (0)
  98. #endif
  99. #endif /* __ASSEMBLY__ */
  100. #ifdef CONFIG_SUPERH32
  101. # include "processor_32.h"
  102. #else
  103. # include "processor_64.h"
  104. #endif
  105. #endif /* __ASM_SH_PROCESSOR_H */