aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/mbx
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/mbx')
-rw-r--r--drivers/video/mbx/mbxdebugfs.c188
1 files changed, 122 insertions, 66 deletions
diff --git a/drivers/video/mbx/mbxdebugfs.c b/drivers/video/mbx/mbxdebugfs.c
index 84aab3ad024e..472a3ca3d92d 100644
--- a/drivers/video/mbx/mbxdebugfs.c
+++ b/drivers/video/mbx/mbxdebugfs.c
@@ -10,6 +10,8 @@ struct mbxfb_debugfs_data {
10 struct dentry *clock; 10 struct dentry *clock;
11 struct dentry *display; 11 struct dentry *display;
12 struct dentry *gsctl; 12 struct dentry *gsctl;
13 struct dentry *sdram;
14 struct dentry *misc;
13}; 15};
14 16
15static int open_file_generic(struct inode *inode, struct file *file) 17static int open_file_generic(struct inode *inode, struct file *file)
@@ -29,11 +31,11 @@ static ssize_t sysconf_read_file(struct file *file, char __user *userbuf,
29{ 31{
30 char * s = big_buffer; 32 char * s = big_buffer;
31 33
32 s += sprintf(s, "SYSCFG = %08lx\n", SYSCFG); 34 s += sprintf(s, "SYSCFG = %08x\n", readl(SYSCFG));
33 s += sprintf(s, "PFBASE = %08lx\n", PFBASE); 35 s += sprintf(s, "PFBASE = %08x\n", readl(PFBASE));
34 s += sprintf(s, "PFCEIL = %08lx\n", PFCEIL); 36 s += sprintf(s, "PFCEIL = %08x\n", readl(PFCEIL));
35 s += sprintf(s, "POLLFLAG = %08lx\n", POLLFLAG); 37 s += sprintf(s, "POLLFLAG = %08x\n", readl(POLLFLAG));
36 s += sprintf(s, "SYSRST = %08lx\n", SYSRST); 38 s += sprintf(s, "SYSRST = %08x\n", readl(SYSRST));
37 39
38 return simple_read_from_buffer(userbuf, count, ppos, 40 return simple_read_from_buffer(userbuf, count, ppos,
39 big_buffer, s-big_buffer); 41 big_buffer, s-big_buffer);
@@ -45,24 +47,24 @@ static ssize_t gsctl_read_file(struct file *file, char __user *userbuf,
45{ 47{
46 char * s = big_buffer; 48 char * s = big_buffer;
47 49
48 s += sprintf(s, "GSCTRL = %08lx\n", GSCTRL); 50 s += sprintf(s, "GSCTRL = %08x\n", readl(GSCTRL));
49 s += sprintf(s, "VSCTRL = %08lx\n", VSCTRL); 51 s += sprintf(s, "VSCTRL = %08x\n", readl(VSCTRL));
50 s += sprintf(s, "GBBASE = %08lx\n", GBBASE); 52 s += sprintf(s, "GBBASE = %08x\n", readl(GBBASE));
51 s += sprintf(s, "VBBASE = %08lx\n", VBBASE); 53 s += sprintf(s, "VBBASE = %08x\n", readl(VBBASE));
52 s += sprintf(s, "GDRCTRL = %08lx\n", GDRCTRL); 54 s += sprintf(s, "GDRCTRL = %08x\n", readl(GDRCTRL));
53 s += sprintf(s, "VCMSK = %08lx\n", VCMSK); 55 s += sprintf(s, "VCMSK = %08x\n", readl(VCMSK));
54 s += sprintf(s, "GSCADR = %08lx\n", GSCADR); 56 s += sprintf(s, "GSCADR = %08x\n", readl(GSCADR));
55 s += sprintf(s, "VSCADR = %08lx\n", VSCADR); 57 s += sprintf(s, "VSCADR = %08x\n", readl(VSCADR));
56 s += sprintf(s, "VUBASE = %08lx\n", VUBASE); 58 s += sprintf(s, "VUBASE = %08x\n", readl(VUBASE));
57 s += sprintf(s, "VVBASE = %08lx\n", VVBASE); 59 s += sprintf(s, "VVBASE = %08x\n", readl(VVBASE));
58 s += sprintf(s, "GSADR = %08lx\n", GSADR); 60 s += sprintf(s, "GSADR = %08x\n", readl(GSADR));
59 s += sprintf(s, "VSADR = %08lx\n", VSADR); 61 s += sprintf(s, "VSADR = %08x\n", readl(VSADR));
60 s += sprintf(s, "HCCTRL = %08lx\n", HCCTRL); 62 s += sprintf(s, "HCCTRL = %08x\n", readl(HCCTRL));
61 s += sprintf(s, "HCSIZE = %08lx\n", HCSIZE); 63 s += sprintf(s, "HCSIZE = %08x\n", readl(HCSIZE));
62 s += sprintf(s, "HCPOS = %08lx\n", HCPOS); 64 s += sprintf(s, "HCPOS = %08x\n", readl(HCPOS));
63 s += sprintf(s, "HCBADR = %08lx\n", HCBADR); 65 s += sprintf(s, "HCBADR = %08x\n", readl(HCBADR));
64 s += sprintf(s, "HCCKMSK = %08lx\n", HCCKMSK); 66 s += sprintf(s, "HCCKMSK = %08x\n", readl(HCCKMSK));
65 s += sprintf(s, "GPLUT = %08lx\n", GPLUT); 67 s += sprintf(s, "GPLUT = %08x\n", readl(GPLUT));
66 68
67 return simple_read_from_buffer(userbuf, count, ppos, 69 return simple_read_from_buffer(userbuf, count, ppos,
68 big_buffer, s-big_buffer); 70 big_buffer, s-big_buffer);
@@ -73,36 +75,36 @@ static ssize_t display_read_file(struct file *file, char __user *userbuf,
73{ 75{
74 char * s = big_buffer; 76 char * s = big_buffer;
75 77
76 s += sprintf(s, "DSCTRL = %08lx\n", DSCTRL); 78 s += sprintf(s, "DSCTRL = %08x\n", readl(DSCTRL));
77 s += sprintf(s, "DHT01 = %08lx\n", DHT01); 79 s += sprintf(s, "DHT01 = %08x\n", readl(DHT01));
78 s += sprintf(s, "DHT02 = %08lx\n", DHT02); 80 s += sprintf(s, "DHT02 = %08x\n", readl(DHT02));
79 s += sprintf(s, "DHT03 = %08lx\n", DHT03); 81 s += sprintf(s, "DHT03 = %08x\n", readl(DHT03));
80 s += sprintf(s, "DVT01 = %08lx\n", DVT01); 82 s += sprintf(s, "DVT01 = %08x\n", readl(DVT01));
81 s += sprintf(s, "DVT02 = %08lx\n", DVT02); 83 s += sprintf(s, "DVT02 = %08x\n", readl(DVT02));
82 s += sprintf(s, "DVT03 = %08lx\n", DVT03); 84 s += sprintf(s, "DVT03 = %08x\n", readl(DVT03));
83 s += sprintf(s, "DBCOL = %08lx\n", DBCOL); 85 s += sprintf(s, "DBCOL = %08x\n", readl(DBCOL));
84 s += sprintf(s, "BGCOLOR = %08lx\n", BGCOLOR); 86 s += sprintf(s, "BGCOLOR = %08x\n", readl(BGCOLOR));
85 s += sprintf(s, "DINTRS = %08lx\n", DINTRS); 87 s += sprintf(s, "DINTRS = %08x\n", readl(DINTRS));
86 s += sprintf(s, "DINTRE = %08lx\n", DINTRE); 88 s += sprintf(s, "DINTRE = %08x\n", readl(DINTRE));
87 s += sprintf(s, "DINTRCNT = %08lx\n", DINTRCNT); 89 s += sprintf(s, "DINTRCNT = %08x\n", readl(DINTRCNT));
88 s += sprintf(s, "DSIG = %08lx\n", DSIG); 90 s += sprintf(s, "DSIG = %08x\n", readl(DSIG));
89 s += sprintf(s, "DMCTRL = %08lx\n", DMCTRL); 91 s += sprintf(s, "DMCTRL = %08x\n", readl(DMCTRL));
90 s += sprintf(s, "CLIPCTRL = %08lx\n", CLIPCTRL); 92 s += sprintf(s, "CLIPCTRL = %08x\n", readl(CLIPCTRL));
91 s += sprintf(s, "SPOCTRL = %08lx\n", SPOCTRL); 93 s += sprintf(s, "SPOCTRL = %08x\n", readl(SPOCTRL));
92 s += sprintf(s, "SVCTRL = %08lx\n", SVCTRL); 94 s += sprintf(s, "SVCTRL = %08x\n", readl(SVCTRL));
93 s += sprintf(s, "DLSTS = %08lx\n", DLSTS); 95 s += sprintf(s, "DLSTS = %08x\n", readl(DLSTS));
94 s += sprintf(s, "DLLCTRL = %08lx\n", DLLCTRL); 96 s += sprintf(s, "DLLCTRL = %08x\n", readl(DLLCTRL));
95 s += sprintf(s, "DVLNUM = %08lx\n", DVLNUM); 97 s += sprintf(s, "DVLNUM = %08x\n", readl(DVLNUM));
96 s += sprintf(s, "DUCTRL = %08lx\n", DUCTRL); 98 s += sprintf(s, "DUCTRL = %08x\n", readl(DUCTRL));
97 s += sprintf(s, "DVECTRL = %08lx\n", DVECTRL); 99 s += sprintf(s, "DVECTRL = %08x\n", readl(DVECTRL));
98 s += sprintf(s, "DHDET = %08lx\n", DHDET); 100 s += sprintf(s, "DHDET = %08x\n", readl(DHDET));
99 s += sprintf(s, "DVDET = %08lx\n", DVDET); 101 s += sprintf(s, "DVDET = %08x\n", readl(DVDET));
100 s += sprintf(s, "DODMSK = %08lx\n", DODMSK); 102 s += sprintf(s, "DODMSK = %08x\n", readl(DODMSK));
101 s += sprintf(s, "CSC01 = %08lx\n", CSC01); 103 s += sprintf(s, "CSC01 = %08x\n", readl(CSC01));
102 s += sprintf(s, "CSC02 = %08lx\n", CSC02); 104 s += sprintf(s, "CSC02 = %08x\n", readl(CSC02));
103 s += sprintf(s, "CSC03 = %08lx\n", CSC03); 105 s += sprintf(s, "CSC03 = %08x\n", readl(CSC03));
104 s += sprintf(s, "CSC04 = %08lx\n", CSC04); 106 s += sprintf(s, "CSC04 = %08x\n", readl(CSC04));
105 s += sprintf(s, "CSC05 = %08lx\n", CSC05); 107 s += sprintf(s, "CSC05 = %08x\n", readl(CSC05));
106 108
107 return simple_read_from_buffer(userbuf, count, ppos, 109 return simple_read_from_buffer(userbuf, count, ppos,
108 big_buffer, s-big_buffer); 110 big_buffer, s-big_buffer);
@@ -113,24 +115,61 @@ static ssize_t clock_read_file(struct file *file, char __user *userbuf,
113{ 115{
114 char * s = big_buffer; 116 char * s = big_buffer;
115 117
116 s += sprintf(s, "SYSCLKSRC = %08lx\n", SYSCLKSRC); 118 s += sprintf(s, "SYSCLKSRC = %08x\n", readl(SYSCLKSRC));
117 s += sprintf(s, "PIXCLKSRC = %08lx\n", PIXCLKSRC); 119 s += sprintf(s, "PIXCLKSRC = %08x\n", readl(PIXCLKSRC));
118 s += sprintf(s, "CLKSLEEP = %08lx\n", CLKSLEEP); 120 s += sprintf(s, "CLKSLEEP = %08x\n", readl(CLKSLEEP));
119 s += sprintf(s, "COREPLL = %08lx\n", COREPLL); 121 s += sprintf(s, "COREPLL = %08x\n", readl(COREPLL));
120 s += sprintf(s, "DISPPLL = %08lx\n", DISPPLL); 122 s += sprintf(s, "DISPPLL = %08x\n", readl(DISPPLL));
121 s += sprintf(s, "PLLSTAT = %08lx\n", PLLSTAT); 123 s += sprintf(s, "PLLSTAT = %08x\n", readl(PLLSTAT));
122 s += sprintf(s, "VOVRCLK = %08lx\n", VOVRCLK); 124 s += sprintf(s, "VOVRCLK = %08x\n", readl(VOVRCLK));
123 s += sprintf(s, "PIXCLK = %08lx\n", PIXCLK); 125 s += sprintf(s, "PIXCLK = %08x\n", readl(PIXCLK));
124 s += sprintf(s, "MEMCLK = %08lx\n", MEMCLK); 126 s += sprintf(s, "MEMCLK = %08x\n", readl(MEMCLK));
125 s += sprintf(s, "M24CLK = %08lx\n", M24CLK); 127 s += sprintf(s, "M24CLK = %08x\n", readl(M24CLK));
126 s += sprintf(s, "MBXCLK = %08lx\n", MBXCLK); 128 s += sprintf(s, "MBXCLK = %08x\n", readl(MBXCLK));
127 s += sprintf(s, "SDCLK = %08lx\n", SDCLK); 129 s += sprintf(s, "SDCLK = %08x\n", readl(SDCLK));
128 s += sprintf(s, "PIXCLKDIV = %08lx\n", PIXCLKDIV); 130 s += sprintf(s, "PIXCLKDIV = %08x\n", readl(PIXCLKDIV));
129 131
130 return simple_read_from_buffer(userbuf, count, ppos, 132 return simple_read_from_buffer(userbuf, count, ppos,
131 big_buffer, s-big_buffer); 133 big_buffer, s-big_buffer);
132} 134}
133 135
136static ssize_t sdram_read_file(struct file *file, char __user *userbuf,
137 size_t count, loff_t *ppos)
138{
139 char * s = big_buffer;
140
141 s += sprintf(s, "LMRST = %08x\n", readl(LMRST));
142 s += sprintf(s, "LMCFG = %08x\n", readl(LMCFG));
143 s += sprintf(s, "LMPWR = %08x\n", readl(LMPWR));
144 s += sprintf(s, "LMPWRSTAT = %08x\n", readl(LMPWRSTAT));
145 s += sprintf(s, "LMCEMR = %08x\n", readl(LMCEMR));
146 s += sprintf(s, "LMTYPE = %08x\n", readl(LMTYPE));
147 s += sprintf(s, "LMTIM = %08x\n", readl(LMTIM));
148 s += sprintf(s, "LMREFRESH = %08x\n", readl(LMREFRESH));
149 s += sprintf(s, "LMPROTMIN = %08x\n", readl(LMPROTMIN));
150 s += sprintf(s, "LMPROTMAX = %08x\n", readl(LMPROTMAX));
151 s += sprintf(s, "LMPROTCFG = %08x\n", readl(LMPROTCFG));
152 s += sprintf(s, "LMPROTERR = %08x\n", readl(LMPROTERR));
153
154 return simple_read_from_buffer(userbuf, count, ppos,
155 big_buffer, s-big_buffer);
156}
157
158static ssize_t misc_read_file(struct file *file, char __user *userbuf,
159 size_t count, loff_t *ppos)
160{
161 char * s = big_buffer;
162
163 s += sprintf(s, "LCD_CONFIG = %08x\n", readl(LCD_CONFIG));
164 s += sprintf(s, "ODFBPWR = %08x\n", readl(ODFBPWR));
165 s += sprintf(s, "ODFBSTAT = %08x\n", readl(ODFBSTAT));
166 s += sprintf(s, "ID = %08x\n", readl(ID));
167
168 return simple_read_from_buffer(userbuf, count, ppos,
169 big_buffer, s-big_buffer);
170}
171
172
134static struct file_operations sysconf_fops = { 173static struct file_operations sysconf_fops = {
135 .read = sysconf_read_file, 174 .read = sysconf_read_file,
136 .write = write_file_dummy, 175 .write = write_file_dummy,
@@ -155,6 +194,17 @@ static struct file_operations gsctl_fops = {
155 .open = open_file_generic, 194 .open = open_file_generic,
156}; 195};
157 196
197static struct file_operations sdram_fops = {
198 .read = sdram_read_file,
199 .write = write_file_dummy,
200 .open = open_file_generic,
201};
202
203static struct file_operations misc_fops = {
204 .read = misc_read_file,
205 .write = write_file_dummy,
206 .open = open_file_generic,
207};
158 208
159static void __devinit mbxfb_debugfs_init(struct fb_info *fbi) 209static void __devinit mbxfb_debugfs_init(struct fb_info *fbi)
160{ 210{
@@ -173,6 +223,10 @@ static void __devinit mbxfb_debugfs_init(struct fb_info *fbi)
173 fbi, &display_fops); 223 fbi, &display_fops);
174 dbg->gsctl = debugfs_create_file("gsctl", 0444, dbg->dir, 224 dbg->gsctl = debugfs_create_file("gsctl", 0444, dbg->dir,
175 fbi, &gsctl_fops); 225 fbi, &gsctl_fops);
226 dbg->sdram = debugfs_create_file("sdram", 0444, dbg->dir,
227 fbi, &sdram_fops);
228 dbg->misc = debugfs_create_file("misc", 0444, dbg->dir,
229 fbi, &misc_fops);
176} 230}
177 231
178static void __devexit mbxfb_debugfs_remove(struct fb_info *fbi) 232static void __devexit mbxfb_debugfs_remove(struct fb_info *fbi)
@@ -180,6 +234,8 @@ static void __devexit mbxfb_debugfs_remove(struct fb_info *fbi)
180 struct mbxfb_info *mfbi = fbi->par; 234 struct mbxfb_info *mfbi = fbi->par;
181 struct mbxfb_debugfs_data *dbg = mfbi->debugfs_data; 235 struct mbxfb_debugfs_data *dbg = mfbi->debugfs_data;
182 236
237 debugfs_remove(dbg->misc);
238 debugfs_remove(dbg->sdram);
183 debugfs_remove(dbg->gsctl); 239 debugfs_remove(dbg->gsctl);
184 debugfs_remove(dbg->display); 240 debugfs_remove(dbg->display);
185 debugfs_remove(dbg->clock); 241 debugfs_remove(dbg->clock);