Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21dbf0b3 authored by Olof Johansson's avatar Olof Johansson
Browse files

Merge tag 'vexpress-fixes-4.10' of...

Merge tag 'vexpress-fixes-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into next/soc

ARMv7 Vexpress fixes for v4.10

Couple of fixes to MCPM/CCI drivers to check and ensure that the kernel
is actually allowed to take control over CCI ports(i.e. running in
secure mode) before enabling MCPM.

This is needed to boot Linux in HYP mode (very useful for development
on virtualization) with CONFIG_MCPM enabled kernel.

* tag 'vexpress-fixes-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux

:
  drivers: cci: add missing CCI port availability firmware check
  ARM: vexpress: refine MCPM smp operations override criteria

Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 07d9a380 801f33be
Loading
Loading
Loading
Loading
+26 −8
Original line number Diff line number Diff line
@@ -26,19 +26,37 @@
bool __init vexpress_smp_init_ops(void)
{
#ifdef CONFIG_MCPM
	int cpu;
	struct device_node *cpu_node, *cci_node;

	/*
	 * The best way to detect a multi-cluster configuration at the moment
	 * is to look for the presence of a CCI in the system.
	 * The best way to detect a multi-cluster configuration
	 * is to detect if the kernel can take over CCI ports
	 * control. Loop over possible CPUs and check if CCI
	 * port control is available.
	 * Override the default vexpress_smp_ops if so.
	 */
	struct device_node *node;
	node = of_find_compatible_node(NULL, NULL, "arm,cci-400");
	if (node && of_device_is_available(node)) {
	for_each_possible_cpu(cpu) {
		bool available;

		cpu_node = of_get_cpu_node(cpu, NULL);
		if (WARN(!cpu_node, "Missing cpu device node!"))
			return false;

		cci_node = of_parse_phandle(cpu_node, "cci-control-port", 0);
		available = cci_node && of_device_is_available(cci_node);
		of_node_put(cci_node);
		of_node_put(cpu_node);

		if (!available)
			return false;
	}

	mcpm_smp_set_ops();
	return true;
	}
#endif
#else
	return false;
#endif
}

static const struct of_device_id vexpress_smp_dt_scu_match[] __initconst = {
+10 −0
Original line number Diff line number Diff line
@@ -2190,6 +2190,9 @@ static int cci_probe_ports(struct device_node *np)
		if (!of_match_node(arm_cci_ctrl_if_matches, cp))
			continue;

		if (!of_device_is_available(cp))
			continue;

		i = nb_ace + nb_ace_lite;

		if (i >= nb_cci_ports)
@@ -2232,6 +2235,13 @@ static int cci_probe_ports(struct device_node *np)
		ports[i].dn = cp;
	}

	/*
	 * If there is no CCI port that is under kernel control
	 * return early and report probe status.
	 */
	if (!nb_ace && !nb_ace_lite)
		return -ENODEV;

	 /* initialize a stashed array of ACE ports to speed-up look-up */
	cci_ace_init_ports();