processor.h 3.0 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3
#ifndef __ASM_SH_PROCESSOR_H
#define __ASM_SH_PROCESSOR_H

P
Paul Mundt 已提交
4
#include <asm/cpu-features.h>
5
#include <asm/segment.h>
6
#include <asm/cache.h>
P
Paul Mundt 已提交
7

P
Paul Mundt 已提交
8
#ifndef __ASSEMBLY__
L
Linus Torvalds 已提交
9 10 11 12
/*
 *  CPU type and hardware bug flags. Kept separately for each CPU.
 *
 *  Each one of these also needs a CONFIG_CPU_SUBTYPE_xxx entry
13
 *  in arch/sh/mm/Kconfig, as well as an entry in arch/sh/kernel/setup.c
L
Linus Torvalds 已提交
14 15 16 17
 *  for parsing the subtype in get_cpu_subtype().
 */
enum cpu_type {
	/* SH-2 types */
P
Paul Mundt 已提交
18
	CPU_SH7619,
Y
Yoshinori Sato 已提交
19 20

	/* SH-2A types */
21
	CPU_SH7201, CPU_SH7203, CPU_SH7206, CPU_SH7263, CPU_MXG,
L
Linus Torvalds 已提交
22 23

	/* SH-3 types */
24 25
	CPU_SH7705, CPU_SH7706, CPU_SH7707,
	CPU_SH7708, CPU_SH7708S, CPU_SH7708R,
26
	CPU_SH7709, CPU_SH7709A, CPU_SH7710, CPU_SH7712,
27
	CPU_SH7720, CPU_SH7721, CPU_SH7729,
L
Linus Torvalds 已提交
28 29 30

	/* SH-4 types */
	CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R,
31
	CPU_SH7760, CPU_SH4_202, CPU_SH4_501,
32 33

	/* SH-4A types */
34
	CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SH7786,
35
	CPU_SH7723, CPU_SH7724, CPU_SHX3,
P
Paul Mundt 已提交
36 37

	/* SH4AL-DSP types */
38
	CPU_SH7343, CPU_SH7722, CPU_SH7366,
L
Linus Torvalds 已提交
39

40 41 42
	/* SH-5 types */
        CPU_SH5_101, CPU_SH5_103,

L
Linus Torvalds 已提交
43 44 45 46
	/* Unknown subtype */
	CPU_SH_NONE
};

47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
/*
 * TLB information structure
 *
 * Defined for both I and D tlb, per-processor.
 */
struct tlb_info {
	unsigned long long next;
	unsigned long long first;
	unsigned long long last;

	unsigned int entries;
	unsigned int step;

	unsigned long flags;
};

struct sh_cpuinfo {
	unsigned int type;
	int cut_major, cut_minor;
	unsigned long loops_per_jiffy;
	unsigned long asid_cache;

	struct cache_info icache;	/* Primary I-cache */
	struct cache_info dcache;	/* Primary D-cache */
	struct cache_info scache;	/* Secondary cache */

	/* TLB info */
	struct tlb_info itlb;
	struct tlb_info dtlb;

	unsigned long flags;
} __attribute__ ((aligned(L1_CACHE_BYTES)));

extern struct sh_cpuinfo cpu_data[];
#define boot_cpu_data cpu_data[0]
#define current_cpu_data cpu_data[smp_processor_id()]
#define raw_current_cpu_data cpu_data[raw_smp_processor_id()]

85 86 87
#define cpu_sleep()	__asm__ __volatile__ ("sleep" : : : "memory")
#define cpu_relax()	barrier()

P
Paul Mundt 已提交
88
/* Forward decl */
P
Paul Mundt 已提交
89 90 91
struct seq_operations;

extern struct pt_regs fake_swapper_regs;
P
Paul Mundt 已提交
92

93 94
/* arch/sh/kernel/setup.c */
const char *get_cpu_subtype(struct sh_cpuinfo *c);
P
Paul Mundt 已提交
95
extern const struct seq_operations cpuinfo_op;
96

97
/* processor boot mode configuration */
M
Magnus Damm 已提交
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
#define MODE_PIN0 (1 << 0)
#define MODE_PIN1 (1 << 1)
#define MODE_PIN2 (1 << 2)
#define MODE_PIN3 (1 << 3)
#define MODE_PIN4 (1 << 4)
#define MODE_PIN5 (1 << 5)
#define MODE_PIN6 (1 << 6)
#define MODE_PIN7 (1 << 7)
#define MODE_PIN8 (1 << 8)
#define MODE_PIN9 (1 << 9)
#define MODE_PIN10 (1 << 10)
#define MODE_PIN11 (1 << 11)
#define MODE_PIN12 (1 << 12)
#define MODE_PIN13 (1 << 13)
#define MODE_PIN14 (1 << 14)
#define MODE_PIN15 (1 << 15)

115 116 117
int generic_mode_pins(void);
int test_mode_pin(int pin);

118 119 120 121 122 123
#ifdef CONFIG_VSYSCALL
int vsyscall_init(void);
#else
#define vsyscall_init() do { } while (0)
#endif

P
Paul Mundt 已提交
124 125 126 127 128 129 130 131
#endif /* __ASSEMBLY__ */

#ifdef CONFIG_SUPERH32
# include "processor_32.h"
#else
# include "processor_64.h"
#endif

L
Linus Torvalds 已提交
132
#endif /* __ASM_SH_PROCESSOR_H */