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