board-dt.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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,mv64xxx-i2c", 0xf1011100, "mv64xxx_i2c.1",
  31. NULL),
  32. OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
  33. OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL),
  34. OF_DEV_AUXDATA("marvell,orion-nand", 0xf4000000, "orion_nand", NULL),
  35. OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1030000, "mv_crypto", NULL),
  36. {},
  37. };
  38. static void __init kirkwood_dt_init(void)
  39. {
  40. pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
  41. /*
  42. * Disable propagation of mbus errors to the CPU local bus,
  43. * as this causes mbus errors (which can occur for example
  44. * for PCI aborts) to throw CPU aborts, which we're not set
  45. * up to deal with.
  46. */
  47. writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
  48. kirkwood_setup_cpu_mbus();
  49. kirkwood_l2_init();
  50. /* Setup root of clk tree */
  51. kirkwood_clk_init();
  52. /* internal devices that every board has */
  53. kirkwood_xor0_init();
  54. kirkwood_xor1_init();
  55. #ifdef CONFIG_KEXEC
  56. kexec_reinit = kirkwood_enable_pcie;
  57. #endif
  58. if (of_machine_is_compatible("globalscale,dreamplug"))
  59. dreamplug_init();
  60. if (of_machine_is_compatible("dlink,dns-kirkwood"))
  61. dnskw_init();
  62. if (of_machine_is_compatible("iom,iconnect"))
  63. iconnect_init();
  64. if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
  65. ib62x0_init();
  66. if (of_machine_is_compatible("qnap,ts219"))
  67. qnap_dt_ts219_init();
  68. if (of_machine_is_compatible("seagate,dockstar"))
  69. dockstar_dt_init();
  70. if (of_machine_is_compatible("seagate,goflexnet"))
  71. goflexnet_init();
  72. if (of_machine_is_compatible("buffalo,lsxl"))
  73. lsxl_init();
  74. if (of_machine_is_compatible("iom,ix2-200"))
  75. iomega_ix2_200_init();
  76. if (of_machine_is_compatible("keymile,km_kirkwood"))
  77. km_kirkwood_init();
  78. of_platform_populate(NULL, kirkwood_dt_match_table,
  79. kirkwood_auxdata_lookup, NULL);
  80. }
  81. static const char *kirkwood_dt_board_compat[] = {
  82. "globalscale,dreamplug",
  83. "dlink,dns-320",
  84. "dlink,dns-325",
  85. "iom,iconnect",
  86. "raidsonic,ib-nas62x0",
  87. "qnap,ts219",
  88. "seagate,dockstar",
  89. "seagate,goflexnet",
  90. "buffalo,lsxl",
  91. "iom,ix2-200",
  92. "keymile,km_kirkwood",
  93. NULL
  94. };
  95. DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
  96. /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
  97. .map_io = kirkwood_map_io,
  98. .init_early = kirkwood_init_early,
  99. .init_irq = orion_dt_init_irq,
  100. .timer = &kirkwood_timer,
  101. .init_machine = kirkwood_dt_init,
  102. .restart = kirkwood_restart,
  103. .dt_compat = kirkwood_dt_board_compat,
  104. MACHINE_END