1 /* SPDX-License-Identifier: GPL-2.0+ */ 2 /* 3 * (C) Copyright 2019 Rockchip Electronics Co., Ltd 4 */ 5 6 #ifndef _AMP_H_ 7 #define _AMP_H_ 8 9 #include <dm.h> 10 #include <image.h> 11 12 #define AMP_I(fmt, args...) printf("AMP: "fmt, ##args) 13 #define AMP_E(fmt, args...) printf("AMP Error: "fmt, ##args) 14 15 #define MAP_AARCH(aarch64) ((aarch64) ? 1 : 0) 16 #define MAP_HYP(hyp) ((hyp) ? 1 : 0) 17 #define MAP_THUMB(thumb) ((thumb) ? 1 : 0) 18 #define MAP_SECURE(secure) ((secure) ? 0 : 1) 19 20 #define MODE_AARCH64_SHIFT 1 21 #define MODE_HYP_SHIFT 2 22 #define MODE_THUMB_SHIFT 3 23 #define MODE_SECURE_SHIFT 4 24 25 #define PE_STATE(aarch64, hyp, thumb, secure) \ 26 (((MAP_AARCH(aarch64) & 0x1) << MODE_AARCH64_SHIFT) | \ 27 ((MAP_HYP(hyp) & 0x1) << MODE_HYP_SHIFT) | \ 28 ((MAP_THUMB(thumb) & 0x1) << MODE_THUMB_SHIFT) | \ 29 ((MAP_SECURE(secure) & 0x1) << MODE_SECURE_SHIFT)) 30 31 int amp_cpus_on(void); 32 int arm64_switch_amp_pe(bootm_headers_t *images); 33 34 #endif /* _AMP_H_ */ 35 36