blob: 5a5a2d80de176fded36c7045c14f0f1a24065315 [file] [log] [blame]
pbrook87ecb682007-11-17 17:14:51 +00001#include "hw.h"
2#include "sh.h"
bellard27c7ca72006-04-27 21:32:09 +00003#include "sh7750_regs.h"
aurel32ea0444b2009-02-03 19:55:35 +00004#include "sh7750_regnames.h"
bellard27c7ca72006-04-27 21:32:09 +00005
6#define REGNAME(r) {r, #r},
7
8typedef struct {
9 uint32_t regaddr;
10 const char *regname;
Anthony Liguoric227f092009-10-01 16:12:16 -050011} regname_t;
bellard27c7ca72006-04-27 21:32:09 +000012
Anthony Liguoric227f092009-10-01 16:12:16 -050013static regname_t regnames[] = {
bellard27c7ca72006-04-27 21:32:09 +000014 REGNAME(SH7750_PTEH_A7)
15 REGNAME(SH7750_PTEL_A7)
16 REGNAME(SH7750_PTEA_A7)
17 REGNAME(SH7750_TTB_A7)
18 REGNAME(SH7750_TEA_A7)
19 REGNAME(SH7750_MMUCR_A7)
20 REGNAME(SH7750_CCR_A7)
21 REGNAME(SH7750_QACR0_A7)
22 REGNAME(SH7750_QACR1_A7)
23 REGNAME(SH7750_TRA_A7)
24 REGNAME(SH7750_EXPEVT_A7)
25 REGNAME(SH7750_INTEVT_A7)
26 REGNAME(SH7750_STBCR_A7)
27 REGNAME(SH7750_STBCR2_A7)
28 REGNAME(SH7750_FRQCR_A7)
29 REGNAME(SH7750_WTCNT_A7)
30 REGNAME(SH7750_WTCSR_A7)
31 REGNAME(SH7750_R64CNT_A7)
32 REGNAME(SH7750_RSECCNT_A7)
33 REGNAME(SH7750_RMINCNT_A7)
34 REGNAME(SH7750_RHRCNT_A7)
35 REGNAME(SH7750_RWKCNT_A7)
36 REGNAME(SH7750_RDAYCNT_A7)
37 REGNAME(SH7750_RMONCNT_A7)
38 REGNAME(SH7750_RYRCNT_A7)
39 REGNAME(SH7750_RSECAR_A7)
40 REGNAME(SH7750_RMINAR_A7)
41 REGNAME(SH7750_RHRAR_A7)
42 REGNAME(SH7750_RWKAR_A7)
43 REGNAME(SH7750_RDAYAR_A7)
44 REGNAME(SH7750_RMONAR_A7)
45 REGNAME(SH7750_RCR1_A7)
46 REGNAME(SH7750_RCR2_A7)
bellard27c7ca72006-04-27 21:32:09 +000047 REGNAME(SH7750_BCR1_A7)
48 REGNAME(SH7750_BCR2_A7)
49 REGNAME(SH7750_WCR1_A7)
50 REGNAME(SH7750_WCR2_A7)
51 REGNAME(SH7750_WCR3_A7)
52 REGNAME(SH7750_MCR_A7)
53 REGNAME(SH7750_PCR_A7)
54 REGNAME(SH7750_RTCSR_A7)
55 REGNAME(SH7750_RTCNT_A7)
56 REGNAME(SH7750_RTCOR_A7)
57 REGNAME(SH7750_RFCR_A7)
58 REGNAME(SH7750_SAR0_A7)
59 REGNAME(SH7750_SAR1_A7)
60 REGNAME(SH7750_SAR2_A7)
61 REGNAME(SH7750_SAR3_A7)
62 REGNAME(SH7750_DAR0_A7)
63 REGNAME(SH7750_DAR1_A7)
64 REGNAME(SH7750_DAR2_A7)
65 REGNAME(SH7750_DAR3_A7)
66 REGNAME(SH7750_DMATCR0_A7)
67 REGNAME(SH7750_DMATCR1_A7)
68 REGNAME(SH7750_DMATCR2_A7)
69 REGNAME(SH7750_DMATCR3_A7)
70 REGNAME(SH7750_CHCR0_A7)
71 REGNAME(SH7750_CHCR1_A7)
72 REGNAME(SH7750_CHCR2_A7)
73 REGNAME(SH7750_CHCR3_A7)
74 REGNAME(SH7750_DMAOR_A7)
bellard27c7ca72006-04-27 21:32:09 +000075 REGNAME(SH7750_PCTRA_A7)
76 REGNAME(SH7750_PDTRA_A7)
77 REGNAME(SH7750_PCTRB_A7)
78 REGNAME(SH7750_PDTRB_A7)
79 REGNAME(SH7750_GPIOIC_A7)
80 REGNAME(SH7750_ICR_A7)
bellard27c7ca72006-04-27 21:32:09 +000081 REGNAME(SH7750_BCR3_A7)
82 REGNAME(SH7750_BCR4_A7)
aurel32c2432a42009-02-07 15:18:14 +000083 REGNAME(SH7750_SDMR2_A7)
Blue Swirlb9d38e92009-09-21 18:11:34 +000084 REGNAME(SH7750_SDMR3_A7) {(uint32_t) - 1, NULL}
bellard27c7ca72006-04-27 21:32:09 +000085};
86
87const char *regname(uint32_t addr)
88{
89 unsigned int i;
90
91 for (i = 0; regnames[i].regaddr != (uint32_t) - 1; i++) {
92 if (regnames[i].regaddr == addr)
93 return regnames[i].regname;
94 }
95
96 return "<unknown reg>";
97}