board-dt.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Gemini Device Tree boot support
  3. */
  4. #include <linux/kernel.h>
  5. #include <linux/init.h>
  6. #include <linux/io.h>
  7. #include <asm/mach/arch.h>
  8. #include <asm/mach/map.h>
  9. #include <asm/system_misc.h>
  10. #include <asm/proc-fns.h>
  11. #ifdef CONFIG_DEBUG_GEMINI
  12. /* This is needed for LL-debug/earlyprintk/debug-macro.S */
  13. static struct map_desc gemini_io_desc[] __initdata = {
  14. {
  15. .virtual = CONFIG_DEBUG_UART_VIRT,
  16. .pfn = __phys_to_pfn(CONFIG_DEBUG_UART_PHYS),
  17. .length = SZ_4K,
  18. .type = MT_DEVICE,
  19. },
  20. };
  21. static void __init gemini_map_io(void)
  22. {
  23. iotable_init(gemini_io_desc, ARRAY_SIZE(gemini_io_desc));
  24. }
  25. #else
  26. #define gemini_map_io NULL
  27. #endif
  28. static void gemini_idle(void)
  29. {
  30. /*
  31. * Because of broken hardware we have to enable interrupts or the CPU
  32. * will never wakeup... Acctualy it is not very good to enable
  33. * interrupts first since scheduler can miss a tick, but there is
  34. * no other way around this. Platforms that needs it for power saving
  35. * should enable it in init code, since by default it is
  36. * disabled.
  37. */
  38. /* FIXME: Enabling interrupts here is racy! */
  39. local_irq_enable();
  40. cpu_do_idle();
  41. }
  42. static void __init gemini_init_machine(void)
  43. {
  44. arm_pm_idle = gemini_idle;
  45. }
  46. static const char *gemini_board_compat[] = {
  47. "cortina,gemini",
  48. NULL,
  49. };
  50. DT_MACHINE_START(GEMINI_DT, "Gemini (Device Tree)")
  51. .map_io = gemini_map_io,
  52. .init_machine = gemini_init_machine,
  53. .dt_compat = gemini_board_compat,
  54. MACHINE_END