2005-04-17 06:20:36 +08:00
|
|
|
#ifndef __ASM_SH_PROCESSOR_H
|
|
|
|
#define __ASM_SH_PROCESSOR_H
|
|
|
|
|
2007-11-10 19:01:51 +08:00
|
|
|
#include <asm/cpu-features.h>
|
2008-06-03 17:48:54 +08:00
|
|
|
#include <asm/segment.h>
|
2008-09-17 22:24:02 +08:00
|
|
|
#include <asm/cache.h>
|
2007-11-10 19:01:51 +08:00
|
|
|
|
2007-11-11 17:11:18 +08:00
|
|
|
#ifndef __ASSEMBLY__
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* CPU type and hardware bug flags. Kept separately for each CPU.
|
|
|
|
*
|
|
|
|
* Each one of these also needs a CONFIG_CPU_SUBTYPE_xxx entry
|
2006-02-01 19:06:02 +08:00
|
|
|
* in arch/sh/mm/Kconfig, as well as an entry in arch/sh/kernel/setup.c
|
2005-04-17 06:20:36 +08:00
|
|
|
* for parsing the subtype in get_cpu_subtype().
|
|
|
|
*/
|
|
|
|
enum cpu_type {
|
|
|
|
/* SH-2 types */
|
2007-06-08 10:55:28 +08:00
|
|
|
CPU_SH7619,
|
2006-11-05 15:18:08 +08:00
|
|
|
|
|
|
|
/* SH-2A types */
|
2012-05-10 16:26:52 +08:00
|
|
|
CPU_SH7201, CPU_SH7203, CPU_SH7206, CPU_SH7263, CPU_SH7264, CPU_SH7269,
|
|
|
|
CPU_MXG,
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* SH-3 types */
|
2006-09-27 16:38:11 +08:00
|
|
|
CPU_SH7705, CPU_SH7706, CPU_SH7707,
|
|
|
|
CPU_SH7708, CPU_SH7708S, CPU_SH7708R,
|
2007-03-27 17:13:51 +08:00
|
|
|
CPU_SH7709, CPU_SH7709A, CPU_SH7710, CPU_SH7712,
|
2007-12-26 10:45:06 +08:00
|
|
|
CPU_SH7720, CPU_SH7721, CPU_SH7729,
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* SH-4 types */
|
|
|
|
CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R,
|
2007-11-07 10:05:32 +08:00
|
|
|
CPU_SH7760, CPU_SH4_202, CPU_SH4_501,
|
2006-11-20 13:14:29 +08:00
|
|
|
|
|
|
|
/* SH-4A types */
|
2009-03-03 14:40:25 +08:00
|
|
|
CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SH7786,
|
2012-04-12 14:45:32 +08:00
|
|
|
CPU_SH7723, CPU_SH7724, CPU_SH7757, CPU_SH7734, CPU_SHX3,
|
2006-12-11 19:28:03 +08:00
|
|
|
|
|
|
|
/* SH4AL-DSP types */
|
2011-01-12 18:54:21 +08:00
|
|
|
CPU_SH7343, CPU_SH7722, CPU_SH7366, CPU_SH7372,
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-11-09 16:08:54 +08:00
|
|
|
/* SH-5 types */
|
|
|
|
CPU_SH5_101, CPU_SH5_103,
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/* Unknown subtype */
|
|
|
|
CPU_SH_NONE
|
|
|
|
};
|
|
|
|
|
2009-08-15 09:48:13 +08:00
|
|
|
enum cpu_family {
|
|
|
|
CPU_FAMILY_SH2,
|
|
|
|
CPU_FAMILY_SH2A,
|
|
|
|
CPU_FAMILY_SH3,
|
|
|
|
CPU_FAMILY_SH4,
|
|
|
|
CPU_FAMILY_SH4A,
|
|
|
|
CPU_FAMILY_SH4AL_DSP,
|
|
|
|
CPU_FAMILY_SH5,
|
|
|
|
CPU_FAMILY_UNKNOWN,
|
|
|
|
};
|
|
|
|
|
2008-09-17 22:24:02 +08:00
|
|
|
/*
|
|
|
|
* 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 {
|
2009-08-15 09:48:13 +08:00
|
|
|
unsigned int type, family;
|
2008-09-17 22:24:02 +08:00
|
|
|
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;
|
|
|
|
|
2010-10-26 13:44:58 +08:00
|
|
|
unsigned int phys_bits;
|
2008-09-17 22:24:02 +08:00
|
|
|
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()]
|
|
|
|
|
2008-11-26 14:47:44 +08:00
|
|
|
#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory")
|
|
|
|
#define cpu_relax() barrier()
|
|
|
|
|
2012-03-29 01:30:03 +08:00
|
|
|
void default_idle(void);
|
|
|
|
void stop_this_cpu(void *);
|
|
|
|
|
2007-11-11 17:11:18 +08:00
|
|
|
/* Forward decl */
|
2008-09-04 17:53:58 +08:00
|
|
|
struct seq_operations;
|
2010-01-19 14:40:03 +08:00
|
|
|
struct task_struct;
|
2008-09-04 17:53:58 +08:00
|
|
|
|
|
|
|
extern struct pt_regs fake_swapper_regs;
|
2006-09-27 17:33:49 +08:00
|
|
|
|
2010-04-21 11:20:42 +08:00
|
|
|
extern void cpu_init(void);
|
2010-04-21 11:01:06 +08:00
|
|
|
extern void cpu_probe(void);
|
|
|
|
|
2010-01-19 14:40:03 +08:00
|
|
|
/* arch/sh/kernel/process.c */
|
|
|
|
extern unsigned int xstate_size;
|
|
|
|
extern void free_thread_xstate(struct task_struct *);
|
|
|
|
extern struct kmem_cache *task_xstate_cachep;
|
|
|
|
|
2010-02-23 11:56:30 +08:00
|
|
|
/* arch/sh/mm/alignment.c */
|
|
|
|
extern int get_unalign_ctl(struct task_struct *, unsigned long addr);
|
|
|
|
extern int set_unalign_ctl(struct task_struct *, unsigned int val);
|
|
|
|
|
|
|
|
#define GET_UNALIGN_CTL(tsk, addr) get_unalign_ctl((tsk), (addr))
|
|
|
|
#define SET_UNALIGN_CTL(tsk, val) set_unalign_ctl((tsk), (val))
|
|
|
|
|
2010-01-18 20:08:32 +08:00
|
|
|
/* arch/sh/mm/init.c */
|
|
|
|
extern unsigned int mem_init_done;
|
|
|
|
|
2006-12-25 09:19:56 +08:00
|
|
|
/* arch/sh/kernel/setup.c */
|
|
|
|
const char *get_cpu_subtype(struct sh_cpuinfo *c);
|
2008-09-04 17:53:58 +08:00
|
|
|
extern const struct seq_operations cpuinfo_op;
|
2006-12-25 09:19:56 +08:00
|
|
|
|
2010-02-23 11:56:30 +08:00
|
|
|
/* thread_struct flags */
|
|
|
|
#define SH_THREAD_UAC_NOPRINT (1 << 0)
|
|
|
|
#define SH_THREAD_UAC_SIGBUS (1 << 1)
|
|
|
|
#define SH_THREAD_UAC_MASK (SH_THREAD_UAC_NOPRINT | SH_THREAD_UAC_SIGBUS)
|
|
|
|
|
2009-05-28 19:51:51 +08:00
|
|
|
/* processor boot mode configuration */
|
2009-06-02 17:22:02 +08:00
|
|
|
#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)
|
|
|
|
|
2009-05-28 19:51:51 +08:00
|
|
|
int generic_mode_pins(void);
|
|
|
|
int test_mode_pin(int pin);
|
|
|
|
|
2007-11-10 19:39:56 +08:00
|
|
|
#ifdef CONFIG_VSYSCALL
|
|
|
|
int vsyscall_init(void);
|
|
|
|
#else
|
|
|
|
#define vsyscall_init() do { } while (0)
|
|
|
|
#endif
|
|
|
|
|
2012-03-29 01:30:03 +08:00
|
|
|
/*
|
|
|
|
* SH-2A has both 16 and 32-bit opcodes, do lame encoding checks.
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_CPU_SH2A
|
|
|
|
extern unsigned int instruction_size(unsigned int insn);
|
|
|
|
#elif defined(CONFIG_SUPERH32)
|
|
|
|
#define instruction_size(insn) (2)
|
|
|
|
#else
|
|
|
|
#define instruction_size(insn) (4)
|
|
|
|
#endif
|
|
|
|
|
2007-11-11 17:11:18 +08:00
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
|
|
|
|
#ifdef CONFIG_SUPERH32
|
2012-10-03 01:01:25 +08:00
|
|
|
# include <asm/processor_32.h>
|
2007-11-11 17:11:18 +08:00
|
|
|
#else
|
2012-10-03 01:01:25 +08:00
|
|
|
# include <asm/processor_64.h>
|
2007-11-11 17:11:18 +08:00
|
|
|
#endif
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#endif /* __ASM_SH_PROCESSOR_H */
|