diff options
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/kernel/debug-mmrs.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/arch/blackfin/kernel/debug-mmrs.c b/arch/blackfin/kernel/debug-mmrs.c index 94b1d8a0256a..aa201be49a1e 100644 --- a/arch/blackfin/kernel/debug-mmrs.c +++ b/arch/blackfin/kernel/debug-mmrs.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <asm/blackfin.h> | 14 | #include <asm/blackfin.h> |
15 | #include <asm/gpio.h> | 15 | #include <asm/gpio.h> |
16 | #include <asm/gptimers.h> | ||
16 | #include <asm/bfin_can.h> | 17 | #include <asm/bfin_can.h> |
17 | #include <asm/bfin_dma.h> | 18 | #include <asm/bfin_dma.h> |
18 | #include <asm/bfin_ppi.h> | 19 | #include <asm/bfin_ppi.h> |
@@ -230,8 +231,8 @@ bfin_debug_mmrs_dma(struct dentry *parent, unsigned long base, int num, char mdm | |||
230 | #define DMA(num) _DMA(num, DMA##num##_NEXT_DESC_PTR, 0, "") | 231 | #define DMA(num) _DMA(num, DMA##num##_NEXT_DESC_PTR, 0, "") |
231 | #define _MDMA(num, x) \ | 232 | #define _MDMA(num, x) \ |
232 | do { \ | 233 | do { \ |
233 | _DMA(num, x##DMA_D##num##_CONFIG, 'D', #x); \ | 234 | _DMA(num, x##DMA_D##num##_NEXT_DESC_PTR, 'D', #x); \ |
234 | _DMA(num, x##DMA_S##num##_CONFIG, 'S', #x); \ | 235 | _DMA(num, x##DMA_S##num##_NEXT_DESC_PTR, 'S', #x); \ |
235 | } while (0) | 236 | } while (0) |
236 | #define MDMA(num) _MDMA(num, M) | 237 | #define MDMA(num) _MDMA(num, M) |
237 | #define IMDMA(num) _MDMA(num, IM) | 238 | #define IMDMA(num) _MDMA(num, IM) |
@@ -264,20 +265,15 @@ bfin_debug_mmrs_eppi(struct dentry *parent, unsigned long base, int num) | |||
264 | /* | 265 | /* |
265 | * General Purpose Timers | 266 | * General Purpose Timers |
266 | */ | 267 | */ |
267 | #define GPTIMER_OFF(mmr) (TIMER0_##mmr - TIMER0_CONFIG) | 268 | #define __GPTIMER(uname, lname) __REGS(gptimer, #uname, lname) |
268 | #define __GPTIMER(name) \ | ||
269 | do { \ | ||
270 | strcpy(_buf, #name); \ | ||
271 | debugfs_create_x16(buf, S_IRUSR|S_IWUSR, parent, (u16 *)(base + GPTIMER_OFF(name))); \ | ||
272 | } while (0) | ||
273 | static void __init __maybe_unused | 269 | static void __init __maybe_unused |
274 | bfin_debug_mmrs_gptimer(struct dentry *parent, unsigned long base, int num) | 270 | bfin_debug_mmrs_gptimer(struct dentry *parent, unsigned long base, int num) |
275 | { | 271 | { |
276 | char buf[32], *_buf = REGS_STR_PFX(buf, TIMER, num); | 272 | char buf[32], *_buf = REGS_STR_PFX(buf, TIMER, num); |
277 | __GPTIMER(CONFIG); | 273 | __GPTIMER(CONFIG, config); |
278 | __GPTIMER(COUNTER); | 274 | __GPTIMER(COUNTER, counter); |
279 | __GPTIMER(PERIOD); | 275 | __GPTIMER(PERIOD, period); |
280 | __GPTIMER(WIDTH); | 276 | __GPTIMER(WIDTH, width); |
281 | } | 277 | } |
282 | #define GPTIMER(num) bfin_debug_mmrs_gptimer(parent, TIMER##num##_CONFIG, num) | 278 | #define GPTIMER(num) bfin_debug_mmrs_gptimer(parent, TIMER##num##_CONFIG, num) |
283 | 279 | ||
@@ -355,7 +351,7 @@ bfin_debug_mmrs_ppi(struct dentry *parent, unsigned long base, int num) | |||
355 | __PPI(DELAY, delay); | 351 | __PPI(DELAY, delay); |
356 | __PPI(FRAME, frame); | 352 | __PPI(FRAME, frame); |
357 | } | 353 | } |
358 | #define PPI(num) bfin_debug_mmrs_ppi(parent, PPI##num##_STATUS, num) | 354 | #define PPI(num) bfin_debug_mmrs_ppi(parent, PPI##num##_CONTROL, num) |
359 | 355 | ||
360 | /* | 356 | /* |
361 | * SPI | 357 | * SPI |
@@ -1288,15 +1284,15 @@ static int __init bfin_debug_mmrs_init(void) | |||
1288 | D16(VR_CTL); | 1284 | D16(VR_CTL); |
1289 | D32(CHIPID); /* it's part of this hardware block */ | 1285 | D32(CHIPID); /* it's part of this hardware block */ |
1290 | 1286 | ||
1291 | #if defined(PPI_STATUS) || defined(PPI0_STATUS) || defined(PPI1_STATUS) | 1287 | #if defined(PPI_CONTROL) || defined(PPI0_CONTROL) || defined(PPI1_CONTROL) |
1292 | parent = debugfs_create_dir("ppi", top); | 1288 | parent = debugfs_create_dir("ppi", top); |
1293 | # ifdef PPI_STATUS | 1289 | # ifdef PPI_CONTROL |
1294 | bfin_debug_mmrs_ppi(parent, PPI_STATUS, -1); | 1290 | bfin_debug_mmrs_ppi(parent, PPI_CONTROL, -1); |
1295 | # endif | 1291 | # endif |
1296 | # ifdef PPI0_STATUS | 1292 | # ifdef PPI0_CONTROL |
1297 | PPI(0); | 1293 | PPI(0); |
1298 | # endif | 1294 | # endif |
1299 | # ifdef PPI1_STATUS | 1295 | # ifdef PPI1_CONTROL |
1300 | PPI(1); | 1296 | PPI(1); |
1301 | # endif | 1297 | # endif |
1302 | #endif | 1298 | #endif |