board-dt.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2013 STMicroelectronics (R&D) Limited.
  3. * Author(s): Srinivas Kandagatla <srinivas.kandagatla@st.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #include <linux/irq.h>
  10. #include <linux/of_platform.h>
  11. #include <asm/hardware/cache-l2x0.h>
  12. #include <asm/mach/arch.h>
  13. #include "smp.h"
  14. void __init stih41x_l2x0_init(void)
  15. {
  16. u32 way_size = 0x4;
  17. u32 aux_ctrl;
  18. /* may be this can be encoded in macros like BIT*() */
  19. aux_ctrl = (0x1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) |
  20. (0x1 << L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT) |
  21. (0x1 << L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT) |
  22. (way_size << L2X0_AUX_CTRL_WAY_SIZE_SHIFT);
  23. l2x0_of_init(aux_ctrl, L2X0_AUX_CTRL_MASK);
  24. }
  25. static void __init stih41x_machine_init(void)
  26. {
  27. stih41x_l2x0_init();
  28. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  29. }
  30. static const char *stih41x_dt_match[] __initdata = {
  31. "st,stih415",
  32. "st,stih416",
  33. NULL
  34. };
  35. DT_MACHINE_START(STM, "STiH415/416 SoC with Flattened Device Tree")
  36. .init_machine = stih41x_machine_init,
  37. .smp = smp_ops(sti_smp_ops),
  38. .dt_compat = stih41x_dt_match,
  39. MACHINE_END