sysregs.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #include <linux/io.h>
  19. extern void __iomem *sregs_base;
  20. #define HB_SREG_A9_PWR_REQ 0xf00
  21. #define HB_SREG_A9_BOOT_STAT 0xf04
  22. #define HB_SREG_A9_BOOT_DATA 0xf08
  23. #define HB_PWR_SUSPEND 0
  24. #define HB_PWR_SOFT_RESET 1
  25. #define HB_PWR_HARD_RESET 2
  26. #define HB_PWR_SHUTDOWN 3
  27. static inline void hignbank_set_pwr_suspend(void)
  28. {
  29. writel(HB_PWR_SUSPEND, sregs_base + HB_SREG_A9_PWR_REQ);
  30. }
  31. static inline void hignbank_set_pwr_shutdown(void)
  32. {
  33. writel(HB_PWR_SHUTDOWN, sregs_base + HB_SREG_A9_PWR_REQ);
  34. }
  35. static inline void hignbank_set_pwr_soft_reset(void)
  36. {
  37. writel(HB_PWR_SOFT_RESET, sregs_base + HB_SREG_A9_PWR_REQ);
  38. }
  39. static inline void hignbank_set_pwr_hard_reset(void)
  40. {
  41. writel(HB_PWR_HARD_RESET, sregs_base + HB_SREG_A9_PWR_REQ);
  42. }
  43. #endif