34 #include <linux/module.h>
35 #include <linux/kernel.h>
40 #include <asm/uaccess.h>
54 {
"Frame", 0x0c, 16 },
56 {
"Testmode", 0x0f, 8 },
57 {
"TxMaxPp", 0x10, 16 },
58 {
"TxCSRp", 0x12, 16 },
59 {
"RxMaxPp", 0x14, 16 },
60 {
"RxCSR", 0x16, 16 },
61 {
"RxCount", 0x18, 16 },
62 {
"ConfigData", 0x1f, 8 },
63 {
"DevCtl", 0x60, 8 },
65 {
"TxFIFOsz", 0x62, 8 },
66 {
"RxFIFOsz", 0x63, 8 },
67 {
"TxFIFOadd", 0x64, 16 },
68 {
"RxFIFOadd", 0x66, 16 },
69 {
"VControl", 0x68, 32 },
70 {
"HWVers", 0x6C, 16 },
71 {
"EPInfo", 0x78, 8 },
72 {
"RAMInfo", 0x79, 8 },
73 {
"LinkInfo", 0x7A, 8 },
75 {
"HS_EOF1", 0x7C, 8 },
76 {
"FS_EOF1", 0x7D, 8 },
77 {
"LS_EOF1", 0x7E, 8 },
78 {
"SOFT_RST", 0x7F, 8 },
79 {
"DMA_CNTLch0", 0x204, 16 },
80 {
"DMA_ADDRch0", 0x208, 32 },
81 {
"DMA_COUNTch0", 0x20C, 32 },
82 {
"DMA_CNTLch1", 0x214, 16 },
83 {
"DMA_ADDRch1", 0x218, 32 },
84 {
"DMA_COUNTch1", 0x21C, 32 },
85 {
"DMA_CNTLch2", 0x224, 16 },
86 {
"DMA_ADDRch2", 0x228, 32 },
87 {
"DMA_COUNTch2", 0x22C, 32 },
88 {
"DMA_CNTLch3", 0x234, 16 },
89 {
"DMA_ADDRch3", 0x238, 32 },
90 {
"DMA_COUNTch3", 0x23C, 32 },
91 {
"DMA_CNTLch4", 0x244, 16 },
92 {
"DMA_ADDRch4", 0x248, 32 },
93 {
"DMA_COUNTch4", 0x24C, 32 },
94 {
"DMA_CNTLch5", 0x254, 16 },
95 {
"DMA_ADDRch5", 0x258, 32 },
96 {
"DMA_COUNTch5", 0x25C, 32 },
97 {
"DMA_CNTLch6", 0x264, 16 },
98 {
"DMA_ADDRch6", 0x268, 32 },
99 {
"DMA_COUNTch6", 0x26C, 32 },
100 {
"DMA_CNTLch7", 0x274, 16 },
101 {
"DMA_ADDRch7", 0x278, 32 },
102 {
"DMA_COUNTch7", 0x27C, 32 },
111 seq_printf(s,
"MUSB (M)HDRC Register Dump\n");
113 for (i = 0; i <
ARRAY_SIZE(musb_regmap); i++) {
114 switch (musb_regmap[i].
size) {
120 seq_printf(s,
"%-12s: %04x\n", musb_regmap[i].name,
124 seq_printf(s,
"%-12s: %08x\n", musb_regmap[i].name,
138 static int musb_test_mode_show(
struct seq_file *s,
void *unused)
140 struct musb *musb = s->
private;
173 .open = musb_regdump_open,
185 const char __user *ubuf,
size_t count, loff_t *ppos)
188 struct musb *musb = s->
private;
192 memset(buf, 0x00,
sizeof(buf));
197 if (!
strncmp(buf,
"force host", 9))
200 if (!
strncmp(buf,
"fifo access", 11))
203 if (!
strncmp(buf,
"force full-speed", 15))
206 if (!
strncmp(buf,
"force high-speed", 15))
209 if (!
strncmp(buf,
"test packet", 10)) {
214 if (!
strncmp(buf,
"test K", 6))
217 if (!
strncmp(buf,
"test J", 6))
220 if (!
strncmp(buf,
"test SE0 NAK", 12))
229 .open = musb_test_mode_open,
230 .write = musb_test_mode_write,
256 root, musb, &musb_test_mode_fops);
262 musb->debugfs_root = root;