aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/debug-mmrs.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/kernel/debug-mmrs.c')
-rw-r--r--arch/blackfin/kernel/debug-mmrs.c109
1 files changed, 69 insertions, 40 deletions
diff --git a/arch/blackfin/kernel/debug-mmrs.c b/arch/blackfin/kernel/debug-mmrs.c
index fce4807ceef..92f66482628 100644
--- a/arch/blackfin/kernel/debug-mmrs.c
+++ b/arch/blackfin/kernel/debug-mmrs.c
@@ -27,7 +27,7 @@
27#define PORT_MUX BFIN_PORT_MUX 27#define PORT_MUX BFIN_PORT_MUX
28#endif 28#endif
29 29
30#define _d(name, bits, addr, perms) debugfs_create_x##bits(name, perms, parent, (u##bits *)addr) 30#define _d(name, bits, addr, perms) debugfs_create_x##bits(name, perms, parent, (u##bits *)(addr))
31#define d(name, bits, addr) _d(name, bits, addr, S_IRUSR|S_IWUSR) 31#define d(name, bits, addr) _d(name, bits, addr, S_IRUSR|S_IWUSR)
32#define d_RO(name, bits, addr) _d(name, bits, addr, S_IRUSR) 32#define d_RO(name, bits, addr) _d(name, bits, addr, S_IRUSR)
33#define d_WO(name, bits, addr) _d(name, bits, addr, S_IWUSR) 33#define d_WO(name, bits, addr) _d(name, bits, addr, S_IWUSR)
@@ -223,7 +223,8 @@ bfin_debug_mmrs_dma(struct dentry *parent, unsigned long base, int num, char mdm
223 __DMA(CURR_DESC_PTR, curr_desc_ptr); 223 __DMA(CURR_DESC_PTR, curr_desc_ptr);
224 __DMA(CURR_ADDR, curr_addr); 224 __DMA(CURR_ADDR, curr_addr);
225 __DMA(IRQ_STATUS, irq_status); 225 __DMA(IRQ_STATUS, irq_status);
226 __DMA(PERIPHERAL_MAP, peripheral_map); 226 if (strcmp(pfx, "IMDMA") != 0)
227 __DMA(PERIPHERAL_MAP, peripheral_map);
227 __DMA(CURR_X_COUNT, curr_x_count); 228 __DMA(CURR_X_COUNT, curr_x_count);
228 __DMA(CURR_Y_COUNT, curr_y_count); 229 __DMA(CURR_Y_COUNT, curr_y_count);
229} 230}
@@ -277,6 +278,32 @@ bfin_debug_mmrs_gptimer(struct dentry *parent, unsigned long base, int num)
277} 278}
278#define GPTIMER(num) bfin_debug_mmrs_gptimer(parent, TIMER##num##_CONFIG, num) 279#define GPTIMER(num) bfin_debug_mmrs_gptimer(parent, TIMER##num##_CONFIG, num)
279 280
281#define GPTIMER_GROUP_OFF(mmr) REGS_OFF(gptimer_group, mmr)
282#define __GPTIMER_GROUP(uname, lname) __REGS(gptimer_group, #uname, lname)
283static void __init __maybe_unused
284bfin_debug_mmrs_gptimer_group(struct dentry *parent, unsigned long base, int num)
285{
286 char buf[32], *_buf;
287
288 if (num == -1) {
289 _buf = buf + sprintf(buf, "TIMER_");
290 __GPTIMER_GROUP(ENABLE, enable);
291 __GPTIMER_GROUP(DISABLE, disable);
292 __GPTIMER_GROUP(STATUS, status);
293 } else {
294 /* These MMRs are a bit odd as the group # is a suffix */
295 _buf = buf + sprintf(buf, "TIMER_ENABLE%i", num);
296 d(buf, 16, base + GPTIMER_GROUP_OFF(enable));
297
298 _buf = buf + sprintf(buf, "TIMER_DISABLE%i", num);
299 d(buf, 16, base + GPTIMER_GROUP_OFF(disable));
300
301 _buf = buf + sprintf(buf, "TIMER_STATUS%i", num);
302 d(buf, 32, base + GPTIMER_GROUP_OFF(status));
303 }
304}
305#define GPTIMER_GROUP(mmr, num) bfin_debug_mmrs_gptimer_group(parent, mmr, num)
306
280/* 307/*
281 * Handshake MDMA 308 * Handshake MDMA
282 */ 309 */
@@ -296,6 +323,29 @@ bfin_debug_mmrs_hmdma(struct dentry *parent, unsigned long base, int num)
296#define HMDMA(num) bfin_debug_mmrs_hmdma(parent, HMDMA##num##_CONTROL, num) 323#define HMDMA(num) bfin_debug_mmrs_hmdma(parent, HMDMA##num##_CONTROL, num)
297 324
298/* 325/*
326 * Peripheral Interrupts (PINT/GPIO)
327 */
328#ifdef PINT0_MASK_SET
329#define __PINT(uname, lname) __REGS(pint, #uname, lname)
330static void __init __maybe_unused
331bfin_debug_mmrs_pint(struct dentry *parent, unsigned long base, int num)
332{
333 char buf[32], *_buf = REGS_STR_PFX(buf, PINT, num);
334 __PINT(MASK_SET, mask_set);
335 __PINT(MASK_CLEAR, mask_clear);
336 __PINT(REQUEST, request);
337 __PINT(ASSIGN, assign);
338 __PINT(EDGE_SET, edge_set);
339 __PINT(EDGE_CLEAR, edge_clear);
340 __PINT(INVERT_SET, invert_set);
341 __PINT(INVERT_CLEAR, invert_clear);
342 __PINT(PINSTATE, pinstate);
343 __PINT(LATCH, latch);
344}
345#define PINT(num) bfin_debug_mmrs_pint(parent, PINT##num##_MASK_SET, num)
346#endif
347
348/*
299 * Port/GPIO 349 * Port/GPIO
300 */ 350 */
301#define bfin_gpio_regs gpio_port_t 351#define bfin_gpio_regs gpio_port_t
@@ -747,7 +797,7 @@ static int __init bfin_debug_mmrs_init(void)
747#endif 797#endif
748 798
749 parent = debugfs_create_dir("dmac", top); 799 parent = debugfs_create_dir("dmac", top);
750#ifdef DMA_TC_CNT 800#ifdef DMAC_TC_CNT
751 D16(DMAC_TC_CNT); 801 D16(DMAC_TC_CNT);
752 D16(DMAC_TC_PER); 802 D16(DMAC_TC_PER);
753#endif 803#endif
@@ -1005,29 +1055,19 @@ static int __init bfin_debug_mmrs_init(void)
1005#endif 1055#endif
1006 1056
1007 parent = debugfs_create_dir("gptimer", top); 1057 parent = debugfs_create_dir("gptimer", top);
1008#ifdef TIMER_DISABLE 1058#ifdef TIMER_ENABLE
1009 D16(TIMER_DISABLE); 1059 GPTIMER_GROUP(TIMER_ENABLE, -1);
1010 D16(TIMER_ENABLE);
1011 D32(TIMER_STATUS);
1012#endif 1060#endif
1013#ifdef TIMER_DISABLE0 1061#ifdef TIMER_ENABLE0
1014 D16(TIMER_DISABLE0); 1062 GPTIMER_GROUP(TIMER_ENABLE0, 0);
1015 D16(TIMER_ENABLE0);
1016 D32(TIMER_STATUS0);
1017#endif 1063#endif
1018#ifdef TIMER_DISABLE1 1064#ifdef TIMER_ENABLE1
1019 D16(TIMER_DISABLE1); 1065 GPTIMER_GROUP(TIMER_ENABLE1, 1);
1020 D16(TIMER_ENABLE1);
1021 D32(TIMER_STATUS1);
1022#endif 1066#endif
1023 /* XXX: Should convert BF561 MMR names */ 1067 /* XXX: Should convert BF561 MMR names */
1024#ifdef TMRS4_DISABLE 1068#ifdef TMRS4_DISABLE
1025 D16(TMRS4_DISABLE); 1069 GPTIMER_GROUP(TMRS4_ENABLE, 0);
1026 D16(TMRS4_ENABLE); 1070 GPTIMER_GROUP(TMRS8_ENABLE, 1);
1027 D32(TMRS4_STATUS);
1028 D16(TMRS8_DISABLE);
1029 D16(TMRS8_ENABLE);
1030 D32(TMRS8_STATUS);
1031#endif 1071#endif
1032 GPTIMER(0); 1072 GPTIMER(0);
1033 GPTIMER(1); 1073 GPTIMER(1);
@@ -1253,6 +1293,14 @@ static int __init bfin_debug_mmrs_init(void)
1253 D32(OTP_DATA3); 1293 D32(OTP_DATA3);
1254#endif 1294#endif
1255 1295
1296#ifdef PINT0_MASK_SET
1297 parent = debugfs_create_dir("pint", top);
1298 PINT(0);
1299 PINT(1);
1300 PINT(2);
1301 PINT(3);
1302#endif
1303
1256#ifdef PIXC_CTL 1304#ifdef PIXC_CTL
1257 parent = debugfs_create_dir("pixc", top); 1305 parent = debugfs_create_dir("pixc", top);
1258 D16(PIXC_CTL); 1306 D16(PIXC_CTL);
@@ -1816,7 +1864,6 @@ static int __init bfin_debug_mmrs_init(void)
1816 { 1864 {
1817 int num; 1865 int num;
1818 unsigned long base; 1866 unsigned long base;
1819 char *_buf, buf[32];
1820 1867
1821 base = PORTA_FER; 1868 base = PORTA_FER;
1822 for (num = 0; num < 10; ++num) { 1869 for (num = 0; num < 10; ++num) {
@@ -1824,24 +1871,6 @@ static int __init bfin_debug_mmrs_init(void)
1824 base += sizeof(struct bfin_gpio_regs); 1871 base += sizeof(struct bfin_gpio_regs);
1825 } 1872 }
1826 1873
1827#define __PINT(uname, lname) __REGS(pint, #uname, lname)
1828 parent = debugfs_create_dir("pint", top);
1829 base = PINT0_MASK_SET;
1830 for (num = 0; num < 4; ++num) {
1831 _buf = REGS_STR_PFX(buf, PINT, num);
1832 __PINT(MASK_SET, mask_set);
1833 __PINT(MASK_CLEAR, mask_clear);
1834 __PINT(IRQ, irq);
1835 __PINT(ASSIGN, assign);
1836 __PINT(EDGE_SET, edge_set);
1837 __PINT(EDGE_CLEAR, edge_clear);
1838 __PINT(INVERT_SET, invert_set);
1839 __PINT(INVERT_CLEAR, invert_clear);
1840 __PINT(PINSTATE, pinstate);
1841 __PINT(LATCH, latch);
1842 base += sizeof(struct bfin_pint_regs);
1843 }
1844
1845 } 1874 }
1846#endif /* BF54x */ 1875#endif /* BF54x */
1847 1876