/* * arch/arm/mach-sunxi/include/mach/sun8i/platsmp.h * * Copyright(c) 2013-2015 Allwinnertech Co., Ltd. * http://www.allwinnertech.com * * Author: liugang * * sun8i smp ops header file * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #ifndef __SUN8I_PLAT_SMP_H #define __SUN8I_PLAT_SMP_H #ifdef CONFIG_ARCH_SUN8IW6P1 #include #include static inline void enable_cpu(int cpu_nr) { unsigned int cluster; unsigned int cpu; unsigned int mpidr; unsigned int value; mpidr = cpu_logical_map(cpu_nr); cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); /* step1: power switch on */ sunxi_smc_writel(0x00, SUNXI_R_PRCM_VBASE + SUNXI_CPU_PWR_CLAMP(cluster, cpu)); while (0x00 != sunxi_smc_readl(SUNXI_R_PRCM_VBASE + SUNXI_CPU_PWR_CLAMP(cluster, cpu))) ; mdelay(5); /* step2: power gating off */ value = sunxi_smc_readl(SUNXI_R_PRCM_VBASE + SUNXI_CLUSTER_PWROFF_GATING(cluster)); value &= (~(0x1<