Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 1 | /* |
Soby Mathew | a0fedc4 | 2016-06-16 14:52:04 +0100 | [diff] [blame] | 2 | * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved. |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions are met: |
| 6 | * |
| 7 | * Redistributions of source code must retain the above copyright notice, this |
| 8 | * list of conditions and the following disclaimer. |
| 9 | * |
| 10 | * Redistributions in binary form must reproduce the above copyright notice, |
| 11 | * this list of conditions and the following disclaimer in the documentation |
| 12 | * and/or other materials provided with the distribution. |
| 13 | * |
| 14 | * Neither the name of ARM nor the names of its contributors may be used |
| 15 | * to endorse or promote products derived from this software without specific |
| 16 | * prior written permission. |
| 17 | * |
| 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 28 | * POSSIBILITY OF SUCH DAMAGE. |
| 29 | */ |
| 30 | |
| 31 | #ifndef __FVP_PWRC_H__ |
| 32 | #define __FVP_PWRC_H__ |
| 33 | |
| 34 | /* FVP Power controller register offset etc */ |
| 35 | #define PPOFFR_OFF 0x0 |
| 36 | #define PPONR_OFF 0x4 |
| 37 | #define PCOFFR_OFF 0x8 |
| 38 | #define PWKUPR_OFF 0xc |
| 39 | #define PSYSR_OFF 0x10 |
| 40 | |
| 41 | #define PWKUPR_WEN (1ull << 31) |
| 42 | |
| 43 | #define PSYSR_AFF_L2 (1 << 31) |
| 44 | #define PSYSR_AFF_L1 (1 << 30) |
| 45 | #define PSYSR_AFF_L0 (1 << 29) |
| 46 | #define PSYSR_WEN (1 << 28) |
| 47 | #define PSYSR_PC (1 << 27) |
| 48 | #define PSYSR_PP (1 << 26) |
| 49 | |
| 50 | #define PSYSR_WK_SHIFT 24 |
Soby Mathew | 2ae2319 | 2015-04-30 12:27:41 +0100 | [diff] [blame] | 51 | #define PSYSR_WK_WIDTH 0x2 |
| 52 | #define PSYSR_WK_MASK ((1 << PSYSR_WK_WIDTH) - 1) |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 53 | #define PSYSR_WK(x) (x >> PSYSR_WK_SHIFT) & PSYSR_WK_MASK |
| 54 | |
| 55 | #define WKUP_COLD 0x0 |
| 56 | #define WKUP_RESET 0x1 |
| 57 | #define WKUP_PPONR 0x2 |
| 58 | #define WKUP_GICREQ 0x3 |
| 59 | |
| 60 | #define PSYSR_INVALID 0xffffffff |
| 61 | |
| 62 | #ifndef __ASSEMBLY__ |
| 63 | |
| 64 | /******************************************************************************* |
| 65 | * Function & variable prototypes |
| 66 | ******************************************************************************/ |
Soby Mathew | a0fedc4 | 2016-06-16 14:52:04 +0100 | [diff] [blame] | 67 | void fvp_pwrc_write_pcoffr(u_register_t); |
| 68 | void fvp_pwrc_write_ppoffr(u_register_t); |
| 69 | void fvp_pwrc_write_pponr(u_register_t); |
| 70 | void fvp_pwrc_set_wen(u_register_t); |
| 71 | void fvp_pwrc_clr_wen(u_register_t); |
| 72 | unsigned int fvp_pwrc_read_psysr(u_register_t); |
| 73 | unsigned int fvp_pwrc_get_cpu_wkr(u_register_t); |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 74 | |
| 75 | #endif /*__ASSEMBLY__*/ |
| 76 | |
| 77 | #endif /* __FVP_PWRC_H__ */ |