board-dt.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 <asm/mach/arch.h>
  17. #include <asm/mach/map.h>
  18. #include <mach/bridge-regs.h>
  19. #include "common.h"
  20. static struct of_device_id kirkwood_dt_match_table[] __initdata = {
  21. { .compatible = "simple-bus", },
  22. { }
  23. };
  24. static void __init kirkwood_dt_init(void)
  25. {
  26. pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
  27. /*
  28. * Disable propagation of mbus errors to the CPU local bus,
  29. * as this causes mbus errors (which can occur for example
  30. * for PCI aborts) to throw CPU aborts, which we're not set
  31. * up to deal with.
  32. */
  33. writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
  34. kirkwood_setup_cpu_mbus();
  35. #ifdef CONFIG_CACHE_FEROCEON_L2
  36. kirkwood_l2_init();
  37. #endif
  38. /* Setup root of clk tree */
  39. kirkwood_clk_init();
  40. /* internal devices that every board has */
  41. kirkwood_wdt_init();
  42. kirkwood_xor0_init();
  43. kirkwood_xor1_init();
  44. kirkwood_crypto_init();
  45. #ifdef CONFIG_KEXEC
  46. kexec_reinit = kirkwood_enable_pcie;
  47. #endif
  48. if (of_machine_is_compatible("globalscale,dreamplug"))
  49. dreamplug_init();
  50. of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
  51. }
  52. static const char *kirkwood_dt_board_compat[] = {
  53. "globalscale,dreamplug",
  54. NULL
  55. };
  56. DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
  57. /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
  58. .map_io = kirkwood_map_io,
  59. .init_early = kirkwood_init_early,
  60. .init_irq = kirkwood_init_irq,
  61. .timer = &kirkwood_timer,
  62. .init_machine = kirkwood_dt_init,
  63. .restart = kirkwood_restart,
  64. .dt_compat = kirkwood_dt_board_compat,
  65. MACHINE_END