1*220e6cf7SRob Herring /* 2*220e6cf7SRob Herring * Copyright 2011 Calxeda, Inc. 3*220e6cf7SRob Herring * 4*220e6cf7SRob Herring * This program is free software; you can redistribute it and/or modify it 5*220e6cf7SRob Herring * under the terms and conditions of the GNU General Public License, 6*220e6cf7SRob Herring * version 2, as published by the Free Software Foundation. 7*220e6cf7SRob Herring * 8*220e6cf7SRob Herring * This program is distributed in the hope it will be useful, but WITHOUT 9*220e6cf7SRob Herring * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10*220e6cf7SRob Herring * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11*220e6cf7SRob Herring * more details. 12*220e6cf7SRob Herring * 13*220e6cf7SRob Herring * You should have received a copy of the GNU General Public License along with 14*220e6cf7SRob Herring * this program. If not, see <http://www.gnu.org/licenses/>. 15*220e6cf7SRob Herring */ 16*220e6cf7SRob Herring #ifndef _MACH_HIGHBANK__SYSREGS_H_ 17*220e6cf7SRob Herring #define _MACH_HIGHBANK__SYSREGS_H_ 18*220e6cf7SRob Herring 19*220e6cf7SRob Herring #include <linux/io.h> 20*220e6cf7SRob Herring 21*220e6cf7SRob Herring extern void __iomem *sregs_base; 22*220e6cf7SRob Herring 23*220e6cf7SRob Herring #define HB_SREG_A9_PWR_REQ 0xf00 24*220e6cf7SRob Herring #define HB_SREG_A9_BOOT_STAT 0xf04 25*220e6cf7SRob Herring #define HB_SREG_A9_BOOT_DATA 0xf08 26*220e6cf7SRob Herring 27*220e6cf7SRob Herring #define HB_PWR_SUSPEND 0 28*220e6cf7SRob Herring #define HB_PWR_SOFT_RESET 1 29*220e6cf7SRob Herring #define HB_PWR_HARD_RESET 2 30*220e6cf7SRob Herring #define HB_PWR_SHUTDOWN 3 31*220e6cf7SRob Herring 32*220e6cf7SRob Herring static inline void hignbank_set_pwr_suspend(void) 33*220e6cf7SRob Herring { 34*220e6cf7SRob Herring writel(HB_PWR_SUSPEND, sregs_base + HB_SREG_A9_PWR_REQ); 35*220e6cf7SRob Herring } 36*220e6cf7SRob Herring 37*220e6cf7SRob Herring static inline void hignbank_set_pwr_shutdown(void) 38*220e6cf7SRob Herring { 39*220e6cf7SRob Herring writel(HB_PWR_SHUTDOWN, sregs_base + HB_SREG_A9_PWR_REQ); 40*220e6cf7SRob Herring } 41*220e6cf7SRob Herring 42*220e6cf7SRob Herring static inline void hignbank_set_pwr_soft_reset(void) 43*220e6cf7SRob Herring { 44*220e6cf7SRob Herring writel(HB_PWR_SOFT_RESET, sregs_base + HB_SREG_A9_PWR_REQ); 45*220e6cf7SRob Herring } 46*220e6cf7SRob Herring 47*220e6cf7SRob Herring static inline void hignbank_set_pwr_hard_reset(void) 48*220e6cf7SRob Herring { 49*220e6cf7SRob Herring writel(HB_PWR_HARD_RESET, sregs_base + HB_SREG_A9_PWR_REQ); 50*220e6cf7SRob Herring } 51*220e6cf7SRob Herring 52*220e6cf7SRob Herring #endif 53