board-dt.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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/clk-provider.h>
  10. #include <linux/clocksource.h>
  11. #include <linux/irq.h>
  12. #include <asm/hardware/cache-l2x0.h>
  13. #include <asm/mach/arch.h>
  14. #include "smp.h"
  15. void __init stih41x_l2x0_init(void)
  16. {
  17. u32 way_size = 0x4;
  18. u32 aux_ctrl;
  19. /* may be this can be encoded in macros like BIT*() */
  20. aux_ctrl = (0x1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) |
  21. (0x1 << L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT) |
  22. (0x1 << L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT) |
  23. (way_size << L2X0_AUX_CTRL_WAY_SIZE_SHIFT);
  24. l2x0_of_init(aux_ctrl, L2X0_AUX_CTRL_MASK);
  25. }
  26. static void __init stih41x_timer_init(void)
  27. {
  28. of_clk_init(NULL);
  29. clocksource_of_init();
  30. stih41x_l2x0_init();
  31. }
  32. static const char *stih41x_dt_match[] __initdata = {
  33. "st,stih415",
  34. "st,stih416",
  35. NULL
  36. };
  37. DT_MACHINE_START(STM, "STiH415/416 SoC with Flattened Device Tree")
  38. .init_time = stih41x_timer_init,
  39. .smp = smp_ops(sti_smp_ops),
  40. .dt_compat = stih41x_dt_match,
  41. MACHINE_END