/* * arch/arm/mach-sunxi/platsmp-v3.h * * Copyright(c) 2013-2015 Allwinnertech Co., Ltd. * http://www.allwinnertech.com * * Author: zhuxianbin * * sunxi smp ops header file for platform v1 * * 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 __PLATSMP_V3_H__ #define __PLATSMP_V3_H__ #define SUNXI_R_PRCM_PBASE (0x01f01400) #define SUNXI_R_CPUCFG_PBASE (0x01f01c00) #define SUNXI_R_CPUCFG_VBASE IO_ADDRESS(SUNXI_R_CPUCFG_PBASE) #define SUNXI_R_PRCM_VBASE IO_ADDRESS(SUNXI_R_PRCM_PBASE) static inline int sunxi_is_wfi_mode(int cpu) { u32 r_cpucfg_vbase = (u32)SUNXI_R_CPUCFG_VBASE; return (readl((void *)(r_cpucfg_vbase + CPUCFG_CPU_STATUS_REG(cpu))) & (1<<2)); } static inline void sunxi_enable_cpu(int cpu) { u32 pwr_reg; u32 r_prcm_v; u32 r_cpucfg_v; r_prcm_v = (u32)SUNXI_R_PRCM_VBASE; r_cpucfg_v = (u32)SUNXI_R_CPUCFG_VBASE; /* step1: Assert nCOREPORESET LOW and hold L1RSTDISABLE LOW. * Ensure DBGPWRDUP is held LOW to prevent any external * debug access to the processor. */ /* assert cpu core reset */ writel(0, (void *)(r_cpucfg_v + CPUCFG_CPU_RST_CTRL_REG(cpu))); /* L1RSTDISABLE hold low */ pwr_reg = readl((void *)(r_cpucfg_v + CPUCFG_GEN_CTRL_REG)); pwr_reg &= ~(1<