board-dt.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 <plat/irq.h>
  21. #include "common.h"
  22. static struct of_device_id kirkwood_dt_match_table[] __initdata = {
  23. { .compatible = "simple-bus", },
  24. { }
  25. };
  26. struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = {
  27. OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL),
  28. OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0",
  29. NULL),
  30. OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
  31. OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL),
  32. {},
  33. };
  34. static void __init kirkwood_dt_init(void)
  35. {
  36. pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
  37. /*
  38. * Disable propagation of mbus errors to the CPU local bus,
  39. * as this causes mbus errors (which can occur for example
  40. * for PCI aborts) to throw CPU aborts, which we're not set
  41. * up to deal with.
  42. */
  43. writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
  44. kirkwood_setup_cpu_mbus();
  45. #ifdef CONFIG_CACHE_FEROCEON_L2
  46. kirkwood_l2_init();
  47. #endif
  48. /* Setup root of clk tree */
  49. kirkwood_clk_init();
  50. /* internal devices that every board has */
  51. kirkwood_xor0_init();
  52. kirkwood_xor1_init();
  53. kirkwood_crypto_init();
  54. #ifdef CONFIG_KEXEC
  55. kexec_reinit = kirkwood_enable_pcie;
  56. #endif
  57. if (of_machine_is_compatible("globalscale,dreamplug"))
  58. dreamplug_init();
  59. if (of_machine_is_compatible("dlink,dns-kirkwood"))
  60. dnskw_init();
  61. if (of_machine_is_compatible("iom,iconnect"))
  62. iconnect_init();
  63. if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
  64. ib62x0_init();
  65. of_platform_populate(NULL, kirkwood_dt_match_table,
  66. kirkwood_auxdata_lookup, NULL);
  67. }
  68. static const char *kirkwood_dt_board_compat[] = {
  69. "globalscale,dreamplug",
  70. "dlink,dns-320",
  71. "dlink,dns-325",
  72. "iom,iconnect",
  73. "raidsonic,ib-nas62x0",
  74. NULL
  75. };
  76. DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
  77. /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
  78. .map_io = kirkwood_map_io,
  79. .init_early = kirkwood_init_early,
  80. .init_irq = orion_dt_init_irq,
  81. .timer = &kirkwood_timer,
  82. .init_machine = kirkwood_dt_init,
  83. .restart = kirkwood_restart,
  84. .dt_compat = kirkwood_dt_board_compat,
  85. MACHINE_END