1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2012-2013 Freescale Semiconductor, Inc.
6 #include <linux/of_address.h>
7 #include <linux/of_platform.h>
10 #include <linux/irqchip.h>
11 #include <asm/mach/arch.h>
12 #include <asm/hardware/cache-l2x0.h>
17 #define MSCM_CPxCOUNT 0x00c
18 #define MSCM_CPxCFG1 0x014
20 static void __init
vf610_detect_cpu(void)
22 struct device_node
*np
;
23 u32 cpxcount
, cpxcfg1
;
24 unsigned int cpu_type
;
27 np
= of_find_compatible_node(NULL
, NULL
, "fsl,vf610-mscm-cpucfg");
31 mscm
= of_iomap(np
, 0);
37 cpxcount
= readl_relaxed(mscm
+ MSCM_CPxCOUNT
);
38 cpxcfg1
= readl_relaxed(mscm
+ MSCM_CPxCFG1
);
42 cpu_type
= cpxcount
? MXC_CPU_VF600
: MXC_CPU_VF500
;
45 cpu_type
|= MXC_CPU_VFx10
;
47 mxc_set_cpu_type(cpu_type
);
50 static void __init
vf610_init_machine(void)
54 of_platform_default_populate(NULL
, NULL
, NULL
);
57 static const char * const vf610_dt_compat
[] __initconst
= {
66 DT_MACHINE_START(VYBRID_VF610
, "Freescale Vybrid VF5xx/VF6xx (Device Tree)")
69 .init_machine
= vf610_init_machine
,
70 .dt_compat
= vf610_dt_compat
,