From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mx.groups.io with SMTP id smtpd.web12.8209.1621408568474144686 for ; Wed, 19 May 2021 00:16:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=WzkG5t5j; spf=pass (domain: linaro.org, ip: 209.85.128.50, mailfrom: etienne.carriere@linaro.org) Received: by mail-wm1-f50.google.com with SMTP id z130so6673323wmg.2 for ; Wed, 19 May 2021 00:16:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=4YH4JALJsA6ewo3Z/KkybBoO48yrg6M7Z7T57xqmyHc=; b=WzkG5t5jY1eAVaZFxkQrk2a3E2ii6IpTHgY0Zi+quon6yZHe3Hf2frZN55PebvILzF ygivldo5kzi3VBvjS9s+2EnpVy6UM38sNfb0FKp9u6oGGtCLD0sQnXlLF3w9CKLixOiV 9ip0VoYlB81MMoGAQDmEV0EvLCyEueccGSEBPuqpDhyBHs86513OLZ5LLKqidraj751T ZctaHHo/iEYZ3pVi/x1Gl/aP/4y5p8B5Yzi81pnsUoqvNlmf/bqYtY/0gfw6zed/OrS6 y3jL+XLOcKLbX8gj97CNur5SygZKgNvZVf2uZoWe75Wsh2VpU9Jyeb0O5OTQ/e/yiJIY keHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4YH4JALJsA6ewo3Z/KkybBoO48yrg6M7Z7T57xqmyHc=; b=i9Nq6JFobu8JLWMpXnrZv12mwIYKFtYz3ZoWxWC2zJzuK19Fg4yHFiOfO+/QPVK800 vDUYXIWrdTxROOUWPBSQgIhCRuGqcY2GawxPBD47ASsVZhAwNDw1SquGOFE+fMuWPYmJ LUYs3IpglSRRBNRx/jP4O07spAWCQdkTcP0955+ZvgC2MMW43CluAIkWHpfZRKaNOgbX ySXXWn1Sf/u1Js9L8vPe64UiV8JnxMKXoosBy79NKG/W81QeAymy9O+s2b+n0xwC38j9 lVGpqERvRxhDyh3D2QQsZ6et/Rk9D48V0grxc8kZ2jIjNJalSZb4+rnT8aI5FuVwlXMA eDCQ== X-Gm-Message-State: AOAM5337LM7XHNjoMa0xU/5GFX6iuOI0HcQvgAVdwIpT5VbJx0QY7PbL wvgWycNDhEoH556Nqzd+zKBYJsdEsPpcKG6j X-Google-Smtp-Source: ABdhPJyjSNVZg8plgcxXJhMFgVIJ9pQkB773Bp9Vh64pauftg17cn6JWUgqAyvBGr2pcIDaaHyrQ0A== X-Received: by 2002:a05:600c:4ecb:: with SMTP id g11mr10118434wmq.172.1621408566815; Wed, 19 May 2021 00:16:06 -0700 (PDT) Return-Path: Received: from lmecxl0524.lme.st.com (2a01cb058b850800452ff0effb46d5f4.ipv6.abo.wanadoo.fr. [2a01:cb05:8b85:800:452f:f0ef:fb46:d5f4]) by smtp.gmail.com with ESMTPSA id e26sm2481334wmh.39.2021.05.19.00.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 00:16:06 -0700 (PDT) From: "Etienne Carriere" To: devel@edk2.groups.io Cc: Achin Gupta , Ard Biesheuvel , Jiewen Yao , Leif Lindholm , Sami Mujawar , Sughosh Ganu , Etienne Carriere Subject: [PATCH v4 1/5] ArmPkg/IndustryStandard: 32b/64b agnostic FF-A, Mm SVC and Std SMC IDs Date: Wed, 19 May 2021 09:14:17 +0200 Message-Id: <20210519071421.16387-1-etienne.carriere@linaro.org> X-Mailer: git-send-email 2.17.1 Defines ARM_SVC_ID_FFA_* and ARM_SVC_ID_SP_* identifiers for 32bit function IDs as per SMCCC specification. Defines also generic ARM SVC identifier macros to wrap 32bit or 64bit identifiers upon target built architecture. Signed-off-by: Etienne Carriere Reviewed-by: Sami Mujawar --- Changes since v3: - Remove Cc tags and apply review tag. No change since v2 Changes since v1: - Define ARM_SMC_ID_MM_COMMUNICATE 32b/64b agnostic helper ID in ArmStdSmc.h, as expected by few following commits in this series. --- ArmPkg/Include/IndustryStandard/ArmFfaSvc.h | 12 ++++++++++++ ArmPkg/Include/IndustryStandard/ArmMmSvc.h | 15 +++++++++++++++ ArmPkg/Include/IndustryStandard/ArmStdSmc.h | 8 ++++++++ 3 files changed, 35 insertions(+) diff --git a/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h b/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h index 65b8343ade..ebcb54b28b 100644 --- a/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h +++ b/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h @@ -17,9 +17,21 @@ #define ARM_FFA_SVC_H_ #define ARM_SVC_ID_FFA_VERSION_AARCH32 0x84000063 +#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH32 0x8400006F +#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH32 0x84000070 #define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64 0xC400006F #define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64 0xC4000070 +/* Generic IDs when using AArch32 or AArch64 execution state */ +#ifdef MDE_CPU_AARCH64 +#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64 +#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64 +#endif +#ifdef MDE_CPU_ARM +#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH32 +#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH32 +#endif + #define SPM_MAJOR_VERSION_FFA 1 #define SPM_MINOR_VERSION_FFA 0 diff --git a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h index 33d60ccf17..deb3bc99d2 100644 --- a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h +++ b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h @@ -15,10 +15,25 @@ * privileged operations on its behalf. */ #define ARM_SVC_ID_SPM_VERSION_AARCH32 0x84000060 +#define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH32 0x84000061 +#define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH32 0x84000064 +#define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH32 0x84000065 #define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64 0xC4000061 #define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64 0xC4000064 #define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64 0xC4000065 +/* Generic IDs when using AArch32 or AArch64 execution state */ +#ifdef MDE_CPU_AARCH64 +#define ARM_SVC_ID_SP_EVENT_COMPLETE ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64 +#define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64 +#define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64 +#endif +#ifdef MDE_CPU_ARM +#define ARM_SVC_ID_SP_EVENT_COMPLETE ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH32 +#define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH32 +#define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH32 +#endif + #define SET_MEM_ATTR_DATA_PERM_MASK 0x3 #define SET_MEM_ATTR_DATA_PERM_SHIFT 0 #define SET_MEM_ATTR_DATA_PERM_NO_ACCESS 0 diff --git a/ArmPkg/Include/IndustryStandard/ArmStdSmc.h b/ArmPkg/Include/IndustryStandard/ArmStdSmc.h index 67afb0ea2d..9116a291da 100644 --- a/ArmPkg/Include/IndustryStandard/ArmStdSmc.h +++ b/ArmPkg/Include/IndustryStandard/ArmStdSmc.h @@ -49,6 +49,14 @@ #define ARM_SMC_ID_MM_COMMUNICATE_AARCH32 0x84000041 #define ARM_SMC_ID_MM_COMMUNICATE_AARCH64 0xC4000041 +/* Generic ID when using AArch32 or AArch64 execution state */ +#ifdef MDE_CPU_AARCH64 +#define ARM_SMC_ID_MM_COMMUNICATE ARM_SMC_ID_MM_COMMUNICATE_AARCH64 +#endif +#ifdef MDE_CPU_ARM +#define ARM_SMC_ID_MM_COMMUNICATE ARM_SMC_ID_MM_COMMUNICATE_AARCH32 +#endif + /* MM return error codes */ #define ARM_SMC_MM_RET_SUCCESS 0 #define ARM_SMC_MM_RET_NOT_SUPPORTED -1 -- 2.17.1