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>
64 /* The power off register for clusters are different from a80 and a83t */
71 /* R_CPUCFG registers, specific to sun8i-a83t */
111 is_compatible = of_device_is_compatible(node, "arm,cortex-a15"); in sunxi_core_is_cortex_a15()
121 /* control sequence from Allwinner A80 user manual v1.2 PRCM section */ in sunxi_cpu_power_switch_set()
165 return -EINVAL; in sunxi_cpu_powerup()
171 /* assert processor power-on reset */ in sunxi_cpu_powerup()
177 /* assert cpu power-on reset */ in sunxi_cpu_powerup()
186 /* Cortex-A7: hold L1 reset disable signal low */ in sunxi_cpu_powerup()
199 * to ARM manuals, asserting power-on reset is sufficient. in sunxi_cpu_powerup()
227 /* de-assert processor power-on reset */ in sunxi_cpu_powerup()
241 /* de-assert all processor resets */ in sunxi_cpu_powerup()
260 return -EINVAL; in sunxi_cluster_powerup()
275 /* assert cluster processor power-on resets */ in sunxi_cluster_powerup()
299 * to ARM manuals, asserting power-on reset is sufficient. in sunxi_cluster_powerup()
309 /* Cortex-A15: hold L2RSTDISABLE low */ in sunxi_cluster_powerup()
312 /* Cortex-A7: hold L1RSTDISABLE and L2RSTDISABLE low */ in sunxi_cluster_powerup()
327 /* de-assert cluster resets */ in sunxi_cluster_powerup()
334 /* de-assert ACINACTM */ in sunxi_cluster_powerup()
344 * enable CCI-400 and proper cluster cache disable before power down.
350 * On the Cortex-A15 we need to disable in sunxi_cluster_cache_disable_without_axi()
364 * Disable cluster-level coherency by masking in sunxi_cluster_cache_disable_without_axi()
401 return -ENODEV; in sunxi_mc_smp_boot_secondary()
403 return -EINVAL; in sunxi_mc_smp_boot_secondary()
455 sunxi_mc_smp_cpu_table[cluster][cpu]--; in sunxi_mc_smp_cpu_die()
488 return -EINVAL; in sunxi_cpu_powerdown()
511 return -EINVAL; in sunxi_cluster_powerdown()
611 /* CPU0 hotplug not handled for sun8i-a83t */ in sunxi_mc_smp_cpu_can_disable()
648 * We need the trampoline code to enable CCI-400 on the first cluster
669 * We're going to soft-restart the current CPU through the in sunxi_mc_smp_loopback()
670 * low-level MCPM code by leveraging the suspend/resume in sunxi_mc_smp_loopback()
700 /* This structure holds SoC-specific bits tied to an enable-method string. */
709 of_node_put(nodes->prcm_node); in sunxi_mc_smp_put_nodes()
710 of_node_put(nodes->cpucfg_node); in sunxi_mc_smp_put_nodes()
711 of_node_put(nodes->sram_node); in sunxi_mc_smp_put_nodes()
712 of_node_put(nodes->r_cpucfg_node); in sunxi_mc_smp_put_nodes()
718 nodes->prcm_node = of_find_compatible_node(NULL, NULL, in sun9i_a80_get_smp_nodes()
719 "allwinner,sun9i-a80-prcm"); in sun9i_a80_get_smp_nodes()
720 if (!nodes->prcm_node) { in sun9i_a80_get_smp_nodes()
722 return -ENODEV; in sun9i_a80_get_smp_nodes()
725 nodes->cpucfg_node = of_find_compatible_node(NULL, NULL, in sun9i_a80_get_smp_nodes()
726 "allwinner,sun9i-a80-cpucfg"); in sun9i_a80_get_smp_nodes()
727 if (!nodes->cpucfg_node) { in sun9i_a80_get_smp_nodes()
729 return -ENODEV; in sun9i_a80_get_smp_nodes()
732 nodes->sram_node = of_find_compatible_node(NULL, NULL, in sun9i_a80_get_smp_nodes()
733 "allwinner,sun9i-a80-smp-sram"); in sun9i_a80_get_smp_nodes()
734 if (!nodes->sram_node) { in sun9i_a80_get_smp_nodes()
736 return -ENODEV; in sun9i_a80_get_smp_nodes()
744 nodes->prcm_node = of_find_compatible_node(NULL, NULL, in sun8i_a83t_get_smp_nodes()
745 "allwinner,sun8i-a83t-r-ccu"); in sun8i_a83t_get_smp_nodes()
746 if (!nodes->prcm_node) { in sun8i_a83t_get_smp_nodes()
748 return -ENODEV; in sun8i_a83t_get_smp_nodes()
751 nodes->cpucfg_node = of_find_compatible_node(NULL, NULL, in sun8i_a83t_get_smp_nodes()
752 "allwinner,sun8i-a83t-cpucfg"); in sun8i_a83t_get_smp_nodes()
753 if (!nodes->cpucfg_node) { in sun8i_a83t_get_smp_nodes()
755 return -ENODEV; in sun8i_a83t_get_smp_nodes()
758 nodes->r_cpucfg_node = of_find_compatible_node(NULL, NULL, in sun8i_a83t_get_smp_nodes()
759 "allwinner,sun8i-a83t-r-cpucfg"); in sun8i_a83t_get_smp_nodes()
760 if (!nodes->r_cpucfg_node) { in sun8i_a83t_get_smp_nodes()
762 return -ENODEV; in sun8i_a83t_get_smp_nodes()
770 .enable_method = "allwinner,sun9i-a80-smp",
774 .enable_method = "allwinner,sun8i-a83t-smp",
789 * Don't bother checking the "cpus" node, as an enable-method in sunxi_mc_smp_init()
794 return -ENODEV; in sunxi_mc_smp_init()
797 * We can't actually use the enable-method magic in the kernel. in sunxi_mc_smp_init()
805 ret = of_property_match_string(node, "enable-method", in sunxi_mc_smp_init()
815 return -ENODEV; in sunxi_mc_smp_init()
818 return -EINVAL; in sunxi_mc_smp_init()
821 pr_err("%s: CCI-400 not available\n", __func__); in sunxi_mc_smp_init()
822 return -ENODEV; in sunxi_mc_smp_init()
837 ret = -ENOMEM; in sunxi_mc_smp_init()
842 "sunxi-mc-smp"); in sunxi_mc_smp_init()
852 0, "sunxi-mc-smp"); in sunxi_mc_smp_init()
855 pr_err("%s: failed to map R-CPUCFG registers\n", in sunxi_mc_smp_init()
861 "sunxi-mc-smp"); in sunxi_mc_smp_init()
869 /* Configure CCI-400 for boot cluster */ in sunxi_mc_smp_init()