1 /* 1 2 * This file is subject to the terms and condi 3 * License. See the file "COPYING" in the mai 4 * for more details. 5 * 6 * Copyright (C) 2011 by Kevin Cernekee (cerne 7 * 8 * Definitions for BMIPS processors 9 */ 10 #ifndef _ASM_BMIPS_H 11 #define _ASM_BMIPS_H 12 13 #include <linux/compiler.h> 14 #include <linux/linkage.h> 15 #include <asm/addrspace.h> 16 #include <asm/mipsregs.h> 17 #include <asm/hazards.h> 18 19 /* NOTE: the CBR register returns a PA, and it 20 #define BMIPS_GET_CBR() ((void 21 (unsi 22 ((rea 23 24 #define BMIPS_RAC_CONFIG 0x0000 25 #define BMIPS_RAC_ADDRESS_RANGE 0x0000 26 #define BMIPS_RAC_CONFIG_1 0x0000 27 #define BMIPS_L2_CONFIG 0x0000 28 #define BMIPS_LMB_CONTROL 0x0000 29 #define BMIPS_SYSTEM_BASE 0x0000 30 #define BMIPS_PERF_GLOBAL_CONTROL 0x0002 31 #define BMIPS_PERF_CONTROL_0 0x0002 32 #define BMIPS_PERF_CONTROL_1 0x0002 33 #define BMIPS_PERF_COUNTER_0 0x0002 34 #define BMIPS_PERF_COUNTER_1 0x0002 35 #define BMIPS_PERF_COUNTER_2 0x0002 36 #define BMIPS_PERF_COUNTER_3 0x0002 37 #define BMIPS_RELO_VECTOR_CONTROL_0 0x0003 38 #define BMIPS_RELO_VECTOR_CONTROL_1 0x0003 39 40 #define BMIPS_NMI_RESET_VEC 0x8000 41 #define BMIPS_WARM_RESTART_VEC 0x8000 42 43 #define ZSCM_REG_BASE 0x9700 44 45 #if !defined(__ASSEMBLY__) 46 47 #include <linux/cpumask.h> 48 #include <asm/r4kcache.h> 49 #include <asm/smp-ops.h> 50 51 extern const struct plat_smp_ops bmips43xx_smp 52 extern const struct plat_smp_ops bmips5000_smp 53 54 static inline int register_bmips_smp_ops(void) 55 { 56 #if IS_ENABLED(CONFIG_CPU_BMIPS) && IS_ENABLED 57 switch (current_cpu_type()) { 58 case CPU_BMIPS32: 59 case CPU_BMIPS3300: 60 return register_up_smp_ops(); 61 case CPU_BMIPS4350: 62 case CPU_BMIPS4380: 63 register_smp_ops(&bmips43xx_sm 64 break; 65 case CPU_BMIPS5000: 66 register_smp_ops(&bmips5000_sm 67 break; 68 default: 69 return -ENODEV; 70 } 71 72 return 0; 73 #else 74 return -ENODEV; 75 #endif 76 } 77 78 extern char bmips_reset_nmi_vec[]; 79 extern char bmips_reset_nmi_vec_end[]; 80 extern char bmips_smp_movevec[]; 81 extern char bmips_smp_int_vec[]; 82 extern char bmips_smp_int_vec_end[]; 83 84 extern void __iomem *bmips_cbr_addr; 85 extern int bmips_smp_enabled; 86 extern int bmips_cpu_offset; 87 extern cpumask_t bmips_booted_mask; 88 extern unsigned long bmips_tp1_irqs; 89 90 extern void bmips_ebase_setup(void); 91 extern asmlinkage void plat_wired_tlb_setup(vo 92 extern void bmips_cpu_setup(void); 93 94 static inline unsigned long bmips_read_zscm_re 95 { 96 unsigned long ret; 97 98 barrier(); 99 cache_op(Index_Load_Tag_S, ZSCM_REG_BA 100 __sync(); 101 _ssnop(); 102 _ssnop(); 103 _ssnop(); 104 _ssnop(); 105 _ssnop(); 106 _ssnop(); 107 _ssnop(); 108 ret = read_c0_ddatalo(); 109 _ssnop(); 110 111 return ret; 112 } 113 114 static inline void bmips_write_zscm_reg(unsign 115 { 116 write_c0_ddatalo(data); 117 _ssnop(); 118 _ssnop(); 119 _ssnop(); 120 cache_op(Index_Store_Tag_S, ZSCM_REG_B 121 _ssnop(); 122 _ssnop(); 123 _ssnop(); 124 barrier(); 125 } 126 127 #endif /* !defined(__ASSEMBLY__) */ 128 129 #endif /* _ASM_BMIPS_H */ 130
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.