Lines Matching +full:sun9i +full:- +full:a80 +full:- +full:ccu
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2018 Chen-Yu Tsai
5 * Chen-Yu Tsai <wens@csie.org>
7 * arch/arm/mach-sunxi/mc_smp.c
9 * Based on Allwinner code, arch/arm/mach-exynos/mcpm-exynos.c, and
10 * arch/arm/mach-hisi/platmcpm.c
14 #include <linux/arm-cci.h>
19 #include <linux/irqchip/arm-gic.h>
63 /* The power off register for clusters are different from a80 and a83t */
70 /* R_CPUCFG registers, specific to sun8i-a83t */
110 is_compatible = of_device_is_compatible(node, "arm,cortex-a15"); in sunxi_core_is_cortex_a15()
120 /* control sequence from Allwinner A80 user manual v1.2 PRCM section */ in sunxi_cpu_power_switch_set()
164 return -EINVAL; in sunxi_cpu_powerup()
170 /* assert processor power-on reset */ in sunxi_cpu_powerup()
176 /* assert cpu power-on reset */ in sunxi_cpu_powerup()
185 /* Cortex-A7: hold L1 reset disable signal low */ in sunxi_cpu_powerup()
198 * to ARM manuals, asserting power-on reset is sufficient. in sunxi_cpu_powerup()
226 /* de-assert processor power-on reset */ in sunxi_cpu_powerup()
240 /* de-assert all processor resets */ in sunxi_cpu_powerup()
259 return -EINVAL; in sunxi_cluster_powerup()
274 /* assert cluster processor power-on resets */ in sunxi_cluster_powerup()
298 * to ARM manuals, asserting power-on reset is sufficient. in sunxi_cluster_powerup()
308 /* Cortex-A15: hold L2RSTDISABLE low */ in sunxi_cluster_powerup()
311 /* Cortex-A7: hold L1RSTDISABLE and L2RSTDISABLE low */ in sunxi_cluster_powerup()
326 /* de-assert cluster resets */ in sunxi_cluster_powerup()
333 /* de-assert ACINACTM */ in sunxi_cluster_powerup()
343 * enable CCI-400 and proper cluster cache disable before power down.
349 * On the Cortex-A15 we need to disable in sunxi_cluster_cache_disable_without_axi()
363 * Disable cluster-level coherency by masking in sunxi_cluster_cache_disable_without_axi()
400 return -ENODEV; in sunxi_mc_smp_boot_secondary()
402 return -EINVAL; in sunxi_mc_smp_boot_secondary()
454 sunxi_mc_smp_cpu_table[cluster][cpu]--; in sunxi_mc_smp_cpu_die()
487 return -EINVAL; in sunxi_cpu_powerdown()
510 return -EINVAL; in sunxi_cluster_powerdown()
610 /* CPU0 hotplug not handled for sun8i-a83t */ in sunxi_mc_smp_cpu_can_disable()
647 * We need the trampoline code to enable CCI-400 on the first cluster
668 * We're going to soft-restart the current CPU through the in sunxi_mc_smp_loopback()
669 * low-level MCPM code by leveraging the suspend/resume in sunxi_mc_smp_loopback()
699 /* This structure holds SoC-specific bits tied to an enable-method string. */
708 of_node_put(nodes->prcm_node); in sunxi_mc_smp_put_nodes()
709 of_node_put(nodes->cpucfg_node); in sunxi_mc_smp_put_nodes()
710 of_node_put(nodes->sram_node); in sunxi_mc_smp_put_nodes()
711 of_node_put(nodes->r_cpucfg_node); in sunxi_mc_smp_put_nodes()
717 nodes->prcm_node = of_find_compatible_node(NULL, NULL, in sun9i_a80_get_smp_nodes()
718 "allwinner,sun9i-a80-prcm"); in sun9i_a80_get_smp_nodes()
719 if (!nodes->prcm_node) { in sun9i_a80_get_smp_nodes()
721 return -ENODEV; in sun9i_a80_get_smp_nodes()
724 nodes->cpucfg_node = of_find_compatible_node(NULL, NULL, in sun9i_a80_get_smp_nodes()
725 "allwinner,sun9i-a80-cpucfg"); in sun9i_a80_get_smp_nodes()
726 if (!nodes->cpucfg_node) { in sun9i_a80_get_smp_nodes()
728 return -ENODEV; in sun9i_a80_get_smp_nodes()
731 nodes->sram_node = of_find_compatible_node(NULL, NULL, in sun9i_a80_get_smp_nodes()
732 "allwinner,sun9i-a80-smp-sram"); in sun9i_a80_get_smp_nodes()
733 if (!nodes->sram_node) { in sun9i_a80_get_smp_nodes()
735 return -ENODEV; in sun9i_a80_get_smp_nodes()
743 nodes->prcm_node = of_find_compatible_node(NULL, NULL, in sun8i_a83t_get_smp_nodes()
744 "allwinner,sun8i-a83t-r-ccu"); in sun8i_a83t_get_smp_nodes()
745 if (!nodes->prcm_node) { in sun8i_a83t_get_smp_nodes()
747 return -ENODEV; in sun8i_a83t_get_smp_nodes()
750 nodes->cpucfg_node = of_find_compatible_node(NULL, NULL, in sun8i_a83t_get_smp_nodes()
751 "allwinner,sun8i-a83t-cpucfg"); in sun8i_a83t_get_smp_nodes()
752 if (!nodes->cpucfg_node) { in sun8i_a83t_get_smp_nodes()
754 return -ENODEV; in sun8i_a83t_get_smp_nodes()
757 nodes->r_cpucfg_node = of_find_compatible_node(NULL, NULL, in sun8i_a83t_get_smp_nodes()
758 "allwinner,sun8i-a83t-r-cpucfg"); in sun8i_a83t_get_smp_nodes()
759 if (!nodes->r_cpucfg_node) { in sun8i_a83t_get_smp_nodes()
761 return -ENODEV; in sun8i_a83t_get_smp_nodes()
769 .enable_method = "allwinner,sun9i-a80-smp",
773 .enable_method = "allwinner,sun8i-a83t-smp",
788 * Don't bother checking the "cpus" node, as an enable-method in sunxi_mc_smp_init()
793 return -ENODEV; in sunxi_mc_smp_init()
796 * We can't actually use the enable-method magic in the kernel. in sunxi_mc_smp_init()
804 ret = of_property_match_string(node, "enable-method", in sunxi_mc_smp_init()
812 return -ENODEV; in sunxi_mc_smp_init()
817 return -EINVAL; in sunxi_mc_smp_init()
820 pr_err("%s: CCI-400 not available\n", __func__); in sunxi_mc_smp_init()
821 return -ENODEV; in sunxi_mc_smp_init()
836 ret = -ENOMEM; in sunxi_mc_smp_init()
841 "sunxi-mc-smp"); in sunxi_mc_smp_init()
851 0, "sunxi-mc-smp"); in sunxi_mc_smp_init()
854 pr_err("%s: failed to map R-CPUCFG registers\n", in sunxi_mc_smp_init()
860 "sunxi-mc-smp"); in sunxi_mc_smp_init()
868 /* Configure CCI-400 for boot cluster */ in sunxi_mc_smp_init()