board-dt.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Copyright 2012 (C), Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. *
  4. * arch/arm/mach-orion5x/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/system_misc.h>
  17. #include <asm/mach/arch.h>
  18. #include <mach/orion5x.h>
  19. #include <plat/irq.h>
  20. #include "common.h"
  21. struct of_dev_auxdata orion5x_auxdata_lookup[] __initdata = {
  22. OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL),
  23. OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0",
  24. NULL),
  25. OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
  26. OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL),
  27. OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1090000, "mv_crypto", NULL),
  28. {},
  29. };
  30. static void __init orion5x_dt_init(void)
  31. {
  32. char *dev_name;
  33. u32 dev, rev;
  34. orion5x_id(&dev, &rev, &dev_name);
  35. printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk);
  36. /*
  37. * Setup Orion address map
  38. */
  39. orion5x_setup_cpu_mbus_bridge();
  40. /* Setup root of clk tree */
  41. clk_init();
  42. /*
  43. * Don't issue "Wait for Interrupt" instruction if we are
  44. * running on D0 5281 silicon.
  45. */
  46. if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) {
  47. printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n");
  48. disable_hlt();
  49. }
  50. if (of_machine_is_compatible("lacie,ethernet-disk-mini-v2"))
  51. edmini_v2_init();
  52. of_platform_populate(NULL, of_default_bus_match_table,
  53. orion5x_auxdata_lookup, NULL);
  54. }
  55. static const char *orion5x_dt_compat[] = {
  56. "marvell,orion5x",
  57. NULL,
  58. };
  59. DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)")
  60. /* Maintainer: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> */
  61. .map_io = orion5x_map_io,
  62. .init_early = orion5x_init_early,
  63. .init_irq = orion_dt_init_irq,
  64. .init_time = orion5x_timer_init,
  65. .init_machine = orion5x_dt_init,
  66. .restart = orion5x_restart,
  67. .dt_compat = orion5x_dt_compat,
  68. MACHINE_END