mach-vf610.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Copyright 2012-2013 Freescale Semiconductor, Inc.
  4. */
  5. #include <linux/of_address.h>
  6. #include <linux/of_platform.h>
  7. #include <linux/io.h>
  8. #include <linux/irqchip.h>
  9. #include <asm/mach/arch.h>
  10. #include <asm/hardware/cache-l2x0.h>
  11. #include "common.h"
  12. #include "hardware.h"
  13. #define MSCM_CPxCOUNT 0x00c
  14. #define MSCM_CPxCFG1 0x014
  15. static void __init vf610_detect_cpu(void)
  16. {
  17. struct device_node *np;
  18. u32 cpxcount, cpxcfg1;
  19. unsigned int cpu_type;
  20. void __iomem *mscm;
  21. np = of_find_compatible_node(NULL, NULL, "fsl,vf610-mscm-cpucfg");
  22. if (WARN_ON(!np))
  23. return;
  24. mscm = of_iomap(np, 0);
  25. of_node_put(np);
  26. if (WARN_ON(!mscm))
  27. return;
  28. cpxcount = readl_relaxed(mscm + MSCM_CPxCOUNT);
  29. cpxcfg1 = readl_relaxed(mscm + MSCM_CPxCFG1);
  30. iounmap(mscm);
  31. cpu_type = cpxcount ? MXC_CPU_VF600 : MXC_CPU_VF500;
  32. if (cpxcfg1)
  33. cpu_type |= MXC_CPU_VFx10;
  34. mxc_set_cpu_type(cpu_type);
  35. }
  36. static void __init vf610_init_machine(void)
  37. {
  38. vf610_detect_cpu();
  39. of_platform_default_populate(NULL, NULL, NULL);
  40. }
  41. static const char * const vf610_dt_compat[] __initconst = {
  42. "fsl,vf500",
  43. "fsl,vf510",
  44. "fsl,vf600",
  45. "fsl,vf610",
  46. "fsl,vf610m4",
  47. NULL,
  48. };
  49. DT_MACHINE_START(VYBRID_VF610, "Freescale Vybrid VF5xx/VF6xx (Device Tree)")
  50. .l2c_aux_val = 0,
  51. .l2c_aux_mask = ~0,
  52. .init_machine = vf610_init_machine,
  53. .dt_compat = vf610_dt_compat,
  54. MACHINE_END