board-dt.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
  3. *
  4. * arch/arm/mach-kirkwood/board-dt.c
  5. *
  6. * Flattened Device Tree board initialization
  7. *
  8. * This file is licensed under the terms of the GNU General Public
  9. * License version 2. This program is licensed "as is" without any
  10. * warranty of any kind, whether express or implied.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/of.h>
  15. #include <linux/of_platform.h>
  16. #include <linux/kexec.h>
  17. #include <asm/mach/arch.h>
  18. #include <asm/mach/map.h>
  19. #include <mach/bridge-regs.h>
  20. #include "common.h"
  21. static struct of_device_id kirkwood_dt_match_table[] __initdata = {
  22. { .compatible = "simple-bus", },
  23. { }
  24. };
  25. static void __init kirkwood_dt_init(void)
  26. {
  27. pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
  28. /*
  29. * Disable propagation of mbus errors to the CPU local bus,
  30. * as this causes mbus errors (which can occur for example
  31. * for PCI aborts) to throw CPU aborts, which we're not set
  32. * up to deal with.
  33. */
  34. writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
  35. kirkwood_setup_cpu_mbus();
  36. #ifdef CONFIG_CACHE_FEROCEON_L2
  37. kirkwood_l2_init();
  38. #endif
  39. /* internal devices that every board has */
  40. kirkwood_wdt_init();
  41. kirkwood_xor0_init();
  42. kirkwood_xor1_init();
  43. kirkwood_crypto_init();
  44. #ifdef CONFIG_KEXEC
  45. kexec_reinit = kirkwood_enable_pcie;
  46. #endif
  47. if (of_machine_is_compatible("globalscale,dreamplug"))
  48. dreamplug_init();
  49. of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
  50. }
  51. static const char *kirkwood_dt_board_compat[] = {
  52. "globalscale,dreamplug",
  53. NULL
  54. };
  55. DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
  56. /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
  57. .map_io = kirkwood_map_io,
  58. .init_early = kirkwood_init_early,
  59. .init_irq = kirkwood_init_irq,
  60. .timer = &kirkwood_timer,
  61. .init_machine = kirkwood_dt_init,
  62. .restart = kirkwood_restart,
  63. .dt_compat = kirkwood_dt_board_compat,
  64. MACHINE_END