1212#ifdef __KERNEL__
1313
1414/* Build Configuration Registers */
15+ #define ARC_REG_DCCMBASE_BCR 0x61 /* DCCM Base Addr */
16+ #define ARC_REG_CRC_BCR 0x62
17+ #define ARC_REG_DVFB_BCR 0x64
18+ #define ARC_REG_EXTARITH_BCR 0x65
1519#define ARC_REG_VECBASE_BCR 0x68
20+ #define ARC_REG_PERIBASE_BCR 0x69
21+ #define ARC_REG_FP_BCR 0x6B /* Single-Precision FPU */
22+ #define ARC_REG_DPFP_BCR 0x6C /* Dbl Precision FPU */
1623#define ARC_REG_MMU_BCR 0x6f
24+ #define ARC_REG_DCCM_BCR 0x74 /* DCCM Present + SZ */
25+ #define ARC_REG_TIMERS_BCR 0x75
26+ #define ARC_REG_ICCM_BCR 0x78
27+ #define ARC_REG_XY_MEM_BCR 0x79
28+ #define ARC_REG_MAC_BCR 0x7a
29+ #define ARC_REG_MUL_BCR 0x7b
30+ #define ARC_REG_SWAP_BCR 0x7c
31+ #define ARC_REG_NORM_BCR 0x7d
32+ #define ARC_REG_MIXMAX_BCR 0x7e
33+ #define ARC_REG_BARREL_BCR 0x7f
34+ #define ARC_REG_D_UNCACH_BCR 0x6A
1735
1836/* status32 Bits Positions */
1937#define STATUS_H_BIT 0 /* CPU Halted */
88106#define TIMER_CTRL_IE (1 << 0) /* Interupt when Count reachs limit */
89107#define TIMER_CTRL_NH (1 << 1) /* Count only when CPU NOT halted */
90108
91- #if defined(CONFIG_ARC_MMU_V1 )
92- #define CONFIG_ARC_MMU_VER 1
93- #elif defined(CONFIG_ARC_MMU_V2 )
94- #define CONFIG_ARC_MMU_VER 2
95- #elif defined(CONFIG_ARC_MMU_V3 )
96- #define CONFIG_ARC_MMU_VER 3
97- #else
98- #error "Error: MMU ver"
99- #endif
100-
101109/* MMU Management regs */
102110#define ARC_REG_TLBPD0 0x405
103111#define ARC_REG_TLBPD1 0x406
@@ -277,6 +285,13 @@ struct arc_fpu {
277285 ***************************************************************
278286 * Build Configuration Registers, with encoded hardware config
279287 */
288+ struct bcr_identity {
289+ #ifdef CONFIG_CPU_BIG_ENDIAN
290+ unsigned int chip_id :16 , cpu_id :8 , family :8 ;
291+ #else
292+ unsigned int family :8 , cpu_id :8 , chip_id :16 ;
293+ #endif
294+ };
280295
281296struct bcr_mmu_1_2 {
282297#ifdef CONFIG_CPU_BIG_ENDIAN
@@ -296,6 +311,38 @@ struct bcr_mmu_3 {
296311#endif
297312};
298313
314+ #define EXTN_SWAP_VALID 0x1
315+ #define EXTN_NORM_VALID 0x2
316+ #define EXTN_MINMAX_VALID 0x2
317+ #define EXTN_BARREL_VALID 0x2
318+
319+ struct bcr_extn {
320+ #ifdef CONFIG_CPU_BIG_ENDIAN
321+ unsigned int pad :20 , crc :1 , ext_arith :2 , mul :2 , barrel :2 , minmax :2 ,
322+ norm :2 , swap :1 ;
323+ #else
324+ unsigned int swap :1 , norm :2 , minmax :2 , barrel :2 , mul :2 , ext_arith :2 ,
325+ crc :1 , pad :20 ;
326+ #endif
327+ };
328+
329+ /* DSP Options Ref Manual */
330+ struct bcr_extn_mac_mul {
331+ #ifdef CONFIG_CPU_BIG_ENDIAN
332+ unsigned int pad :16 , type :8 , ver :8 ;
333+ #else
334+ unsigned int ver :8 , type :8 , pad :16 ;
335+ #endif
336+ };
337+
338+ struct bcr_extn_xymem {
339+ #ifdef CONFIG_CPU_BIG_ENDIAN
340+ unsigned int ram_org :2 , num_banks :4 , bank_sz :4 , ver :8 ;
341+ #else
342+ unsigned int ver :8 , bank_sz :4 , num_banks :4 , ram_org :2 ;
343+ #endif
344+ };
345+
299346struct bcr_cache {
300347#ifdef CONFIG_CPU_BIG_ENDIAN
301348 unsigned int pad :12 , line_len :4 , sz :4 , config :4 , ver :8 ;
@@ -304,6 +351,48 @@ struct bcr_cache {
304351#endif
305352};
306353
354+ struct bcr_perip {
355+ #ifdef CONFIG_CPU_BIG_ENDIAN
356+ unsigned int start :8 , pad2 :8 , sz :8 , pad :8 ;
357+ #else
358+ unsigned int pad :8 , sz :8 , pad2 :8 , start :8 ;
359+ #endif
360+ };
361+ struct bcr_iccm {
362+ #ifdef CONFIG_CPU_BIG_ENDIAN
363+ unsigned int base :16 , pad :5 , sz :3 , ver :8 ;
364+ #else
365+ unsigned int ver :8 , sz :3 , pad :5 , base :16 ;
366+ #endif
367+ };
368+
369+ /* DCCM Base Address Register: ARC_REG_DCCMBASE_BCR */
370+ struct bcr_dccm_base {
371+ #ifdef CONFIG_CPU_BIG_ENDIAN
372+ unsigned int addr :24 , ver :8 ;
373+ #else
374+ unsigned int ver :8 , addr :24 ;
375+ #endif
376+ };
377+
378+ /* DCCM RAM Configuration Register: ARC_REG_DCCM_BCR */
379+ struct bcr_dccm {
380+ #ifdef CONFIG_CPU_BIG_ENDIAN
381+ unsigned int res :21 , sz :3 , ver :8 ;
382+ #else
383+ unsigned int ver :8 , sz :3 , res :21 ;
384+ #endif
385+ };
386+
387+ /* Both SP and DP FPU BCRs have same format */
388+ struct bcr_fp {
389+ #ifdef CONFIG_CPU_BIG_ENDIAN
390+ unsigned int fast :1 , ver :8 ;
391+ #else
392+ unsigned int ver :8 , fast :1 ;
393+ #endif
394+ };
395+
307396/*
308397 *******************************************************************
309398 * Generic structures to hold build configuration used at runtime
@@ -317,9 +406,22 @@ struct cpuinfo_arc_cache {
317406 unsigned int has_aliasing , sz , line_len , assoc , ver ;
318407};
319408
409+ struct cpuinfo_arc_ccm {
410+ unsigned int base_addr , sz ;
411+ };
412+
320413struct cpuinfo_arc {
321414 struct cpuinfo_arc_cache icache , dcache ;
322415 struct cpuinfo_arc_mmu mmu ;
416+ struct bcr_identity core ;
417+ unsigned int timers ;
418+ unsigned int vec_base ;
419+ unsigned int uncached_base ;
420+ struct cpuinfo_arc_ccm iccm , dccm ;
421+ struct bcr_extn extn ;
422+ struct bcr_extn_xymem extn_xymem ;
423+ struct bcr_extn_mac_mul extn_mac_mul ;
424+ struct bcr_fp fp , dpfp ;
323425};
324426
325427extern struct cpuinfo_arc cpuinfo_arc700 [];
0 commit comments