diff options
author | Fred Reitberger <reitbergerfred@gmail.com> | 2022-10-11 09:54:30 -0400 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-10-13 15:44:15 +0000 |
commit | b9dd2561f81f2fcefcf756a68c14cdf5cbad2317 (patch) | |
tree | d1d522c14287fb0833649300350ce18abeba9c80 /src | |
parent | 73d7f3e8378445141f87db95efbeecf76c0c3ab8 (diff) |
soc/amd/*/psp_verstage/svc: Make svc.h macros common
The psp_verstage/svc.h SVC_CALLx macros are virtually
identical between picasso/cezanne/mendocino, so move
to common.
TEST=timeless builds are identical
Signed-off-by: Fred Reitberger <reitbergerfred@gmail.com>
Change-Id: I86a8d9b043f68c01ee487f2cdbf7f61934b4a520
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68277
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/amd/cezanne/psp_verstage/svc.c | 3 | ||||
-rw-r--r-- | src/soc/amd/common/psp_verstage/include/svc_call.h (renamed from src/soc/amd/cezanne/psp_verstage/svc.h) | 6 | ||||
-rw-r--r-- | src/soc/amd/mendocino/psp_verstage/svc.c | 1 | ||||
-rw-r--r-- | src/soc/amd/mendocino/psp_verstage/svc.h | 51 | ||||
-rw-r--r-- | src/soc/amd/morgana/psp_verstage/svc.c | 1 | ||||
-rw-r--r-- | src/soc/amd/morgana/psp_verstage/svc.h | 51 | ||||
-rw-r--r-- | src/soc/amd/picasso/psp_verstage/svc.c | 3 | ||||
-rw-r--r-- | src/soc/amd/picasso/psp_verstage/svc.h | 57 |
8 files changed, 7 insertions, 166 deletions
diff --git a/src/soc/amd/cezanne/psp_verstage/svc.c b/src/soc/amd/cezanne/psp_verstage/svc.c index 12fccc38f7..17f9d5135a 100644 --- a/src/soc/amd/cezanne/psp_verstage/svc.c +++ b/src/soc/amd/cezanne/psp_verstage/svc.c @@ -1,11 +1,10 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#include "svc.h" - #include <assert.h> #include <bl_uapp/bl_syscall_public.h> #include <psp_verstage.h> #include <stddef.h> +#include <svc_call.h> void svc_exit(uint32_t status) { diff --git a/src/soc/amd/cezanne/psp_verstage/svc.h b/src/soc/amd/common/psp_verstage/include/svc_call.h index e44948e04b..5c35c48249 100644 --- a/src/soc/amd/cezanne/psp_verstage/svc.h +++ b/src/soc/amd/common/psp_verstage/include/svc_call.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef PSP_VERSTAGE_SVC_H -#define PSP_VERSTAGE_SVC_H +#ifndef PSP_VERSTAGE_SVC_CALL_H +#define PSP_VERSTAGE_SVC_CALL_H #define SVC_CALL4(SVC_ID, R0, R1, R2, R3, Ret) \ __asm__ __volatile__ ( \ @@ -54,4 +54,4 @@ : [id] "I" (SVC_ID) /* input(s) */ \ : "memory", "cc" /* list of clobbered registers */) -#endif /* PSP_VERSTAGE_SVC_H */ +#endif /* PSP_VERSTAGE_SVC_CALL_H */ diff --git a/src/soc/amd/mendocino/psp_verstage/svc.c b/src/soc/amd/mendocino/psp_verstage/svc.c index 99fcc5769e..931e670399 100644 --- a/src/soc/amd/mendocino/psp_verstage/svc.c +++ b/src/soc/amd/mendocino/psp_verstage/svc.c @@ -7,6 +7,7 @@ #include <psp_verstage.h> #include <stddef.h> #include <string.h> +#include <svc_call.h> void svc_exit(uint32_t status) { diff --git a/src/soc/amd/mendocino/psp_verstage/svc.h b/src/soc/amd/mendocino/psp_verstage/svc.h index 354d89a2aa..3feec3ebef 100644 --- a/src/soc/amd/mendocino/psp_verstage/svc.h +++ b/src/soc/amd/mendocino/psp_verstage/svc.h @@ -8,57 +8,6 @@ #include <bl_uapp/bl_syscall_public.h> #include <types.h> -#define SVC_CALL4(SVC_ID, R0, R1, R2, R3, Ret) \ - __asm__ __volatile__ ( \ - "mov r0, %[reg0]\n\t" \ - "mov r1, %[reg1]\n\t" \ - "mov r2, %[reg2]\n\t" \ - "mov r3, %[reg3]\n\t" \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "i" (SVC_ID), [reg0] "r" (R0), [reg1] "r" (R1), [reg2] "r" (R2), \ - [reg3] "r" (R3) /* input(s) */ \ - : "r0", "r1", "r2", "r3", "memory", "cc" /* list of clobbered registers */) - -#define SVC_CALL3(SVC_ID, R0, R1, R2, Ret) \ - __asm__ __volatile__ ( \ - "mov r0, %[reg0]\n\t" \ - "mov r1, %[reg1]\n\t" \ - "mov r2, %[reg2]\n\t" \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "i" (SVC_ID), [reg0] "r" (R0), [reg1] "r" (R1), [reg2] "r" (R2) \ - : "r0", "r1", "r2", "memory", "cc" /* list of clobbered registers */) - -#define SVC_CALL2(SVC_ID, R0, R1, Ret) \ - __asm__ __volatile__ ( \ - "mov r0, %[reg0]\n\t" \ - "mov r1, %[reg1]\n\t" \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "i" (SVC_ID), [reg0] "r" (R0), [reg1] "r" (R1)/* input(s) */ \ - : "r0", "r1", "memory", "cc" /* list of clobbered registers */) - -#define SVC_CALL1(SVC_ID, R0, Ret) \ - __asm__ __volatile__ ( \ - "mov r0, %[reg0]\n\t" \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "i" (SVC_ID), [reg0] "r" (R0) /* input(s) */ \ - : "r0", "memory", "cc" /* list of clobbered registers */) - -#define SVC_CALL0(SVC_ID, Ret) \ - __asm__ __volatile__ ( \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "I" (SVC_ID) /* input(s) */ \ - : "memory", "cc" /* list of clobbered registers */) - struct cmd_param_sha { struct sha_generic_data *ptr_sha_op; }; diff --git a/src/soc/amd/morgana/psp_verstage/svc.c b/src/soc/amd/morgana/psp_verstage/svc.c index 2fc29aae65..9517f97952 100644 --- a/src/soc/amd/morgana/psp_verstage/svc.c +++ b/src/soc/amd/morgana/psp_verstage/svc.c @@ -9,6 +9,7 @@ #include <psp_verstage.h> #include <stddef.h> #include <string.h> +#include <svc_call.h> void svc_exit(uint32_t status) { diff --git a/src/soc/amd/morgana/psp_verstage/svc.h b/src/soc/amd/morgana/psp_verstage/svc.h index 2507ee1dc2..3e5d53a312 100644 --- a/src/soc/amd/morgana/psp_verstage/svc.h +++ b/src/soc/amd/morgana/psp_verstage/svc.h @@ -9,57 +9,6 @@ #include <bl_uapp/bl_syscall_public.h> #include <types.h> -#define SVC_CALL4(SVC_ID, R0, R1, R2, R3, Ret) \ - __asm__ __volatile__ ( \ - "mov r0, %[reg0]\n\t" \ - "mov r1, %[reg1]\n\t" \ - "mov r2, %[reg2]\n\t" \ - "mov r3, %[reg3]\n\t" \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "i" (SVC_ID), [reg0] "r" (R0), [reg1] "r" (R1), [reg2] "r" (R2), \ - [reg3] "r" (R3) /* input(s) */ \ - : "r0", "r1", "r2", "r3", "memory", "cc" /* list of clobbered registers */) - -#define SVC_CALL3(SVC_ID, R0, R1, R2, Ret) \ - __asm__ __volatile__ ( \ - "mov r0, %[reg0]\n\t" \ - "mov r1, %[reg1]\n\t" \ - "mov r2, %[reg2]\n\t" \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "i" (SVC_ID), [reg0] "r" (R0), [reg1] "r" (R1), [reg2] "r" (R2) \ - : "r0", "r1", "r2", "memory", "cc" /* list of clobbered registers */) - -#define SVC_CALL2(SVC_ID, R0, R1, Ret) \ - __asm__ __volatile__ ( \ - "mov r0, %[reg0]\n\t" \ - "mov r1, %[reg1]\n\t" \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "i" (SVC_ID), [reg0] "r" (R0), [reg1] "r" (R1)/* input(s) */ \ - : "r0", "r1", "memory", "cc" /* list of clobbered registers */) - -#define SVC_CALL1(SVC_ID, R0, Ret) \ - __asm__ __volatile__ ( \ - "mov r0, %[reg0]\n\t" \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "i" (SVC_ID), [reg0] "r" (R0) /* input(s) */ \ - : "r0", "memory", "cc" /* list of clobbered registers */) - -#define SVC_CALL0(SVC_ID, Ret) \ - __asm__ __volatile__ ( \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "I" (SVC_ID) /* input(s) */ \ - : "memory", "cc" /* list of clobbered registers */) - struct cmd_param_sha { struct sha_generic_data *ptr_sha_op; }; diff --git a/src/soc/amd/picasso/psp_verstage/svc.c b/src/soc/amd/picasso/psp_verstage/svc.c index d94ec769da..c1af525d84 100644 --- a/src/soc/amd/picasso/psp_verstage/svc.c +++ b/src/soc/amd/picasso/psp_verstage/svc.c @@ -1,11 +1,10 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#include "svc.h" - #include <assert.h> #include <bl_uapp/bl_syscall_public.h> #include <psp_verstage.h> #include <stddef.h> +#include <svc_call.h> void svc_exit(uint32_t status) { diff --git a/src/soc/amd/picasso/psp_verstage/svc.h b/src/soc/amd/picasso/psp_verstage/svc.h deleted file mode 100644 index 03bae066e0..0000000000 --- a/src/soc/amd/picasso/psp_verstage/svc.h +++ /dev/null @@ -1,57 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#ifndef PSP_VERSTAGE_SVC_H -#define PSP_VERSTAGE_SVC_H - -#define SVC_CALL4(SVC_ID, R0, R1, R2, R3, Ret) \ - __asm__ __volatile__ ( \ - "mov r0, %[reg0]\n\t" \ - "mov r1, %[reg1]\n\t" \ - "mov r2, %[reg2]\n\t" \ - "mov r3, %[reg3]\n\t" \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "i" (SVC_ID), [reg0] "r" (R0), [reg1] "r" (R1), [reg2] "r" (R2), \ - [reg3] "r" (R3) /* input(s) */ \ - : "r0", "r1", "r2", "r3", "memory", "cc" /* list of clobbered registers */); - -#define SVC_CALL3(SVC_ID, R0, R1, R2, Ret) \ - __asm__ __volatile__ ( \ - "mov r0, %[reg0]\n\t" \ - "mov r1, %[reg1]\n\t" \ - "mov r2, %[reg2]\n\t" \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "i" (SVC_ID), [reg0] "r" (R0), [reg1] "r" (R1), [reg2] "r" (R2) \ - : "r0", "r1", "r2", "memory", "cc" /* list of clobbered registers */); - -#define SVC_CALL2(SVC_ID, R0, R1, Ret) \ - __asm__ __volatile__ ( \ - "mov r0, %[reg0]\n\t" \ - "mov r1, %[reg1]\n\t" \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "i" (SVC_ID), [reg0] "r" (R0), [reg1] "r" (R1)/* input(s) */ \ - : "r0", "r1", "memory", "cc" /* list of clobbered registers */); - -#define SVC_CALL1(SVC_ID, R0, Ret) \ - __asm__ __volatile__ ( \ - "mov r0, %[reg0]\n\t" \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "i" (SVC_ID), [reg0] "r" (R0) /* input(s) */ \ - : "r0", "memory", "cc" /* list of clobbered registers */); - -#define SVC_CALL0(SVC_ID, Ret) \ - __asm__ __volatile__ ( \ - "svc %[id]\n\t" \ - "mov %[result], r0\n\t" \ - : [result] "=r" (Ret) /* output */ \ - : [id] "I" (SVC_ID) /* input(s) */ \ - : "memory", "cc" /* list of clobbered registers */); - -#endif /* PSP_VERSTAGE_SVC_H */ |