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