board-dt.c 2.2 KB

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