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 11 #define MAP_AARCH(aarch64) ((aarch64) ? 1 : 0) 12 #define MAP_HYP(hyp) ((hyp) ? 1 : 0) 13 #define MAP_THUMB(thumb) ((thumb) ? 1 : 0) 14 #define MAP_SECURE(secure) ((secure) ? 0 : 1) 15 16 #define MODE_AARCH64_SHIFT 1 17 #define MODE_HYP_SHIFT 2 18 #define MODE_THUMB_SHIFT 3 19 #define MODE_SECURE_SHIFT 4 20 21 #define PE_STATE(aarch64, hyp, thumb, secure) \ 22 (((MAP_AARCH(aarch64) & 0x1) << MODE_AARCH64_SHIFT) | \ 23 ((MAP_HYP(hyp) & 0x1) << MODE_HYP_SHIFT) | \ 24 ((MAP_THUMB(thumb) & 0x1) << MODE_THUMB_SHIFT) | \ 25 ((MAP_SECURE(secure) & 0x1) << MODE_SECURE_SHIFT)) 26 27 struct dm_amp_ops { 28 int (*cpu_on)(struct udevice *dev, bool this_cpu); 29 }; 30 31 struct dm_amp_uclass_platdata { 32 const char *desc; 33 const char *partition; 34 u32 cpu; /* cpu mpidr */ 35 u32 aarch64; 36 u32 hyp; 37 u32 thumb; 38 u32 secure; 39 u32 load; 40 u32 entry; 41 u32 reserved_mem[2]; /* [0]: start, [1]: size */ 42 bool linux_os; 43 }; 44 45 int amp_bind_children(struct udevice *dev, const char *drv_name); 46 int amp_cpus_on(void); 47 int amp_cpu_on(u32 cpu); 48 49 #endif /* _AMP_H_ */ 50 51