diff options
Diffstat (limited to 'arch/sparc/kernel/leon_kernel.c')
-rw-r--r-- | arch/sparc/kernel/leon_kernel.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/arch/sparc/kernel/leon_kernel.c b/arch/sparc/kernel/leon_kernel.c index 33cd171d933e..afcdd5e4f43f 100644 --- a/arch/sparc/kernel/leon_kernel.c +++ b/arch/sparc/kernel/leon_kernel.c | |||
@@ -349,37 +349,37 @@ void __init leon_init_timers(void) | |||
349 | 349 | ||
350 | /* Find GPTIMER Timer Registers base address otherwise bail out. */ | 350 | /* Find GPTIMER Timer Registers base address otherwise bail out. */ |
351 | nnp = rootnp; | 351 | nnp = rootnp; |
352 | do { | ||
353 | np = of_find_node_by_name(nnp, "GAISLER_GPTIMER"); | ||
354 | if (!np) { | ||
355 | np = of_find_node_by_name(nnp, "01_011"); | ||
356 | if (!np) | ||
357 | goto bad; | ||
358 | } | ||
359 | 352 | ||
360 | ampopts = 0; | 353 | retry: |
361 | pp = of_find_property(np, "ampopts", &len); | 354 | np = of_find_node_by_name(nnp, "GAISLER_GPTIMER"); |
362 | if (pp) { | 355 | if (!np) { |
363 | ampopts = *(int *)pp->value; | 356 | np = of_find_node_by_name(nnp, "01_011"); |
364 | if (ampopts == 0) { | 357 | if (!np) |
365 | /* Skip this instance, resource already | 358 | goto bad; |
366 | * allocated by other OS */ | 359 | } |
367 | nnp = np; | 360 | |
368 | continue; | 361 | ampopts = 0; |
369 | } | 362 | pp = of_find_property(np, "ampopts", &len); |
363 | if (pp) { | ||
364 | ampopts = *(int *)pp->value; | ||
365 | if (ampopts == 0) { | ||
366 | /* Skip this instance, resource already | ||
367 | * allocated by other OS */ | ||
368 | nnp = np; | ||
369 | goto retry; | ||
370 | } | 370 | } |
371 | } | ||
372 | |||
373 | /* Select Timer-Instance on Timer Core. Default is zero */ | ||
374 | leon3_gptimer_idx = ampopts & 0x7; | ||
371 | 375 | ||
372 | /* Select Timer-Instance on Timer Core. Default is zero */ | 376 | pp = of_find_property(np, "reg", &len); |
373 | leon3_gptimer_idx = ampopts & 0x7; | 377 | if (pp) |
374 | 378 | leon3_gptimer_regs = *(struct leon3_gptimer_regs_map **) | |
375 | pp = of_find_property(np, "reg", &len); | 379 | pp->value; |
376 | if (pp) | 380 | pp = of_find_property(np, "interrupts", &len); |
377 | leon3_gptimer_regs = *(struct leon3_gptimer_regs_map **) | 381 | if (pp) |
378 | pp->value; | 382 | leon3_gptimer_irq = *(unsigned int *)pp->value; |
379 | pp = of_find_property(np, "interrupts", &len); | ||
380 | if (pp) | ||
381 | leon3_gptimer_irq = *(unsigned int *)pp->value; | ||
382 | } while (0); | ||
383 | 383 | ||
384 | if (!(leon3_gptimer_regs && leon3_irqctrl_regs && leon3_gptimer_irq)) | 384 | if (!(leon3_gptimer_regs && leon3_irqctrl_regs && leon3_gptimer_irq)) |
385 | goto bad; | 385 | goto bad; |