board-dt.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright 2012 (C), Thomas Petazzoni <[email protected]>
  4. *
  5. * arch/arm/mach-orion5x/board-dt.c
  6. *
  7. * Flattened Device Tree board initialization
  8. */
  9. #include <linux/kernel.h>
  10. #include <linux/init.h>
  11. #include <linux/of.h>
  12. #include <linux/of_platform.h>
  13. #include <linux/cpu.h>
  14. #include <linux/mbus.h>
  15. #include <linux/clocksource.h>
  16. #include <asm/system_misc.h>
  17. #include <asm/mach/arch.h>
  18. #include <asm/mach/map.h>
  19. #include <plat/irq.h>
  20. #include <plat/time.h>
  21. #include "orion5x.h"
  22. #include "bridge-regs.h"
  23. #include "common.h"
  24. static struct of_dev_auxdata orion5x_auxdata_lookup[] __initdata = {
  25. OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL),
  26. OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0",
  27. NULL),
  28. OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
  29. OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL),
  30. OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1090000, "mv_crypto", NULL),
  31. {},
  32. };
  33. static void __init orion5x_dt_init(void)
  34. {
  35. char *dev_name;
  36. u32 dev, rev;
  37. orion5x_id(&dev, &rev, &dev_name);
  38. printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk);
  39. BUG_ON(mvebu_mbus_dt_init(false));
  40. /*
  41. * Setup Orion address map
  42. */
  43. orion5x_setup_wins();
  44. /*
  45. * Don't issue "Wait for Interrupt" instruction if we are
  46. * running on D0 5281 silicon.
  47. */
  48. if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) {
  49. printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n");
  50. cpu_idle_poll_ctrl(true);
  51. }
  52. if (of_machine_is_compatible("maxtor,shared-storage-2"))
  53. mss2_init();
  54. if (of_machine_is_compatible("lacie,d2-network"))
  55. d2net_init();
  56. of_platform_default_populate(NULL, orion5x_auxdata_lookup, NULL);
  57. }
  58. static const char *orion5x_dt_compat[] = {
  59. "marvell,orion5x",
  60. NULL,
  61. };
  62. DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)")
  63. /* Maintainer: Thomas Petazzoni <[email protected]> */
  64. .map_io = orion5x_map_io,
  65. .init_machine = orion5x_dt_init,
  66. .restart = orion5x_restart,
  67. .dt_compat = orion5x_dt_compat,
  68. MACHINE_END