2019-05-27 14:55:01 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2013-05-28 17:12:21 +08:00
|
|
|
/*
|
|
|
|
* Copyright 2012-2013 Freescale Semiconductor, Inc.
|
|
|
|
*/
|
|
|
|
|
2020-03-27 01:42:32 +08:00
|
|
|
#include <linux/of_address.h>
|
2013-05-28 17:12:21 +08:00
|
|
|
#include <linux/of_platform.h>
|
2020-03-27 01:42:32 +08:00
|
|
|
#include <linux/io.h>
|
|
|
|
|
2013-05-28 17:12:21 +08:00
|
|
|
#include <linux/irqchip.h>
|
|
|
|
#include <asm/mach/arch.h>
|
|
|
|
#include <asm/hardware/cache-l2x0.h>
|
|
|
|
|
2020-03-27 01:42:32 +08:00
|
|
|
#include "common.h"
|
|
|
|
#include "hardware.h"
|
|
|
|
|
|
|
|
#define MSCM_CPxCOUNT 0x00c
|
|
|
|
#define MSCM_CPxCFG1 0x014
|
|
|
|
|
|
|
|
static void __init vf610_detect_cpu(void)
|
|
|
|
{
|
|
|
|
struct device_node *np;
|
|
|
|
u32 cpxcount, cpxcfg1;
|
|
|
|
unsigned int cpu_type;
|
|
|
|
void __iomem *mscm;
|
|
|
|
|
|
|
|
np = of_find_compatible_node(NULL, NULL, "fsl,vf610-mscm-cpucfg");
|
|
|
|
if (WARN_ON(!np))
|
|
|
|
return;
|
|
|
|
|
|
|
|
mscm = of_iomap(np, 0);
|
|
|
|
of_node_put(np);
|
|
|
|
|
|
|
|
if (WARN_ON(!mscm))
|
|
|
|
return;
|
|
|
|
|
|
|
|
cpxcount = readl_relaxed(mscm + MSCM_CPxCOUNT);
|
|
|
|
cpxcfg1 = readl_relaxed(mscm + MSCM_CPxCFG1);
|
|
|
|
|
|
|
|
iounmap(mscm);
|
|
|
|
|
|
|
|
cpu_type = cpxcount ? MXC_CPU_VF600 : MXC_CPU_VF500;
|
|
|
|
|
|
|
|
if (cpxcfg1)
|
|
|
|
cpu_type |= MXC_CPU_VFx10;
|
|
|
|
|
|
|
|
mxc_set_cpu_type(cpu_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void __init vf610_init_machine(void)
|
|
|
|
{
|
|
|
|
vf610_detect_cpu();
|
|
|
|
|
2020-05-20 13:51:27 +08:00
|
|
|
of_platform_default_populate(NULL, NULL, NULL);
|
2020-03-27 01:42:32 +08:00
|
|
|
}
|
|
|
|
|
2014-07-01 16:03:00 +08:00
|
|
|
static const char * const vf610_dt_compat[] __initconst = {
|
2014-11-28 07:27:05 +08:00
|
|
|
"fsl,vf500",
|
|
|
|
"fsl,vf510",
|
|
|
|
"fsl,vf600",
|
2013-05-28 17:12:21 +08:00
|
|
|
"fsl,vf610",
|
2015-05-20 06:03:52 +08:00
|
|
|
"fsl,vf610m4",
|
2013-05-28 17:12:21 +08:00
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
|
2014-11-28 07:27:05 +08:00
|
|
|
DT_MACHINE_START(VYBRID_VF610, "Freescale Vybrid VF5xx/VF6xx (Device Tree)")
|
2014-04-28 22:48:14 +08:00
|
|
|
.l2c_aux_val = 0,
|
|
|
|
.l2c_aux_mask = ~0,
|
2020-03-27 01:42:32 +08:00
|
|
|
.init_machine = vf610_init_machine,
|
2013-05-28 17:12:21 +08:00
|
|
|
.dt_compat = vf610_dt_compat,
|
|
|
|
MACHINE_END
|