board-dt.c 2.2 KB

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