* [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB definition for NVMe
[not found] <cover.1675319448.git.weipu.zhu@intel.com>
@ 2023-02-02 6:41 ` Weipu Zhu
2023-02-06 5:17 ` Wu, Hao A
2023-02-02 6:41 ` [PATCH v2 2/2] MdePkg: Add NVMe boot partition header definition Weipu Zhu
1 sibling, 1 reply; 7+ messages in thread
From: Weipu Zhu @ 2023-02-02 6:41 UTC (permalink / raw)
To: devel; +Cc: Weipu Zhu, Hao Wu, Michael D Kinney, Liming Gao, Zhiguang Liu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4303
Add RPMB(Replay Protected Memory Block) access commands,
result and DCB(Device Configuration Block) definition for
NVMe according to the NVMe spec 2.0.
Signed-off-by: Weipu Zhu <weipu.zhu@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
---
MdePkg/Include/IndustryStandard/Nvme.h | 46 +++++++++++++++++++++++++-
1 file changed, 45 insertions(+), 1 deletion(-)
diff --git a/MdePkg/Include/IndustryStandard/Nvme.h b/MdePkg/Include/IndustryStandard/Nvme.h
index 4a1d92c45d..3b4e9fe67c 100644
--- a/MdePkg/Include/IndustryStandard/Nvme.h
+++ b/MdePkg/Include/IndustryStandard/Nvme.h
@@ -2,12 +2,13 @@
Definitions based on NVMe spec. version 1.1.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
- Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@par Specification Reference:
NVMe Specification 1.1
NVMe Specification 1.4
+ NVMe Specification 2.0
**/
@@ -502,6 +503,49 @@ typedef struct {
// UINT8 *Data; /* Data to be written or read by signed access where M = 512 * Sector Count. */
} NVME_RPMB_DATA_FRAME;
+//
+// RPMB Device Configuration Block Data Structure.
+// (ref. NVMe Base spec. v2.0 Figure 460).
+//
+typedef struct {
+ UINT8 BPPEnable; /* Boot Partition Protection Enabled */
+ UINT8 BPLock; /* Boot Partition Lock */
+ UINT8 NameSpaceWrP; /* Namespace Write Protection */
+ UINT8 Rsvd1[509]; /* Reserved as of Nvm Express 2.0 Spec */
+} NVME_RPMB_DCB;
+
+//
+// RPMB Request and Response Message Types.
+// (ref. NVMe Base spec. v2.0 Figure 461).
+//
+#define NVME_RPMB_AUTHKEY_PROGRAM 0x0001
+#define NVME_RPMB_COUNTER_READ 0x0002
+#define NVME_RPMB_AUTHDATA_WRITE 0x0003
+#define NVME_RPMB_AUTHDATA_READ 0x0004
+#define NVME_RPMB_RESULT_READ 0x0005
+#define NVME_RPMB_DCB_WRITE 0x0006
+#define NVME_RPMB_DCB_READ 0x0007
+#define NVME_RPMB_AUTHKEY_PROGRAM_RESPONSE 0x0100
+#define NVME_RPMB_COUNTER_READ_RESPONSE 0x0200
+#define NVME_RPMB_AUTHDATA_WRITE_RESPONSE 0x0300
+#define NVME_RPMB_AUTHDATA_READ_RESPONSE 0x0400
+#define NVME_RPMB_DCB_WRITE_RESPONSE 0x0600
+#define NVME_RPMB_DCB_READ_RESPONSE 0x0700
+
+//
+// RPMB Operation Result.
+// (ref. NVMe Base spec. v2.0 Figure 462).
+//
+#define NVME_RPMB_RESULT_SUCCESS 0x00
+#define NVME_RPMB_RESULT_GENERAL_FAILURE 0x01
+#define NVME_RPMB_RESULT_AHTHENTICATION_FAILURE 0x02
+#define NVME_RPMB_RESULT_COUNTER_FAILURE 0x03
+#define NVME_RPMB_RESULT_ADDRESS_FAILURE 0x04
+#define NVME_RPMB_RESULT_WRITE_FAILURE 0x05
+#define NVME_RPMB_RESULT_READ_FAILURE 0x06
+#define NVME_RPMB_RESULT_AUTHKEY_NOT_PROGRAMMED 0x07
+#define NVME_RPMB_RESULT_INVALID_DCB 0x08
+
//
// NvmExpress Admin Identify Cmd
//
--
2.37.1.windows.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/2] MdePkg: Add NVMe boot partition header definition
[not found] <cover.1675319448.git.weipu.zhu@intel.com>
2023-02-02 6:41 ` [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB definition for NVMe Weipu Zhu
@ 2023-02-02 6:41 ` Weipu Zhu
2023-02-06 5:17 ` Wu, Hao A
1 sibling, 1 reply; 7+ messages in thread
From: Weipu Zhu @ 2023-02-02 6:41 UTC (permalink / raw)
To: devel; +Cc: Weipu Zhu, Hao Wu, Michael D Kinney, Liming Gao, Zhiguang Liu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4304
Add NVMe boot partition header definition to NVMe.h
according to NVMe spec 2.0.
Signed-off-by: Weipu Zhu <weipu.zhu@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
---
MdePkg/Include/IndustryStandard/Nvme.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/MdePkg/Include/IndustryStandard/Nvme.h b/MdePkg/Include/IndustryStandard/Nvme.h
index 3b4e9fe67c..8b8a1bb7f3 100644
--- a/MdePkg/Include/IndustryStandard/Nvme.h
+++ b/MdePkg/Include/IndustryStandard/Nvme.h
@@ -546,6 +546,19 @@ typedef struct {
#define NVME_RPMB_RESULT_AUTHKEY_NOT_PROGRAMMED 0x07
#define NVME_RPMB_RESULT_INVALID_DCB 0x08
+//
+// Get Log Page - Boot Partition Log Header.
+// (ref. NVMe Base spec. v2.0 Figure 262).
+//
+typedef struct {
+ UINT8 LogIdentifier; /* Log Identifier, shall be set to 15h */
+ UINT8 Rsvd1[3];
+ UINT32 Bpsz : 15; /* Boot Partition Size */
+ UINT32 Rsvd2 : 16;
+ UINT32 Abpid : 1; /* Active Boot Partition ID */
+ UINT8 Rsvd3[8];
+} NVME_BOOT_PARTITION_HEADER;
+
//
// NvmExpress Admin Identify Cmd
//
--
2.37.1.windows.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB definition for NVMe
2023-02-02 6:41 ` [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB definition for NVMe Weipu Zhu
@ 2023-02-06 5:17 ` Wu, Hao A
2023-02-10 0:39 ` Michael D Kinney
0 siblings, 1 reply; 7+ messages in thread
From: Wu, Hao A @ 2023-02-06 5:17 UTC (permalink / raw)
To: Zhu, Weipu, devel@edk2.groups.io
Cc: Kinney, Michael D, Gao, Liming, Liu, Zhiguang
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Best Regards,
Hao Wu
> -----Original Message-----
> From: Zhu, Weipu <weipu.zhu@intel.com>
> Sent: Thursday, February 2, 2023 2:42 PM
> To: devel@edk2.groups.io
> Cc: Zhu, Weipu <weipu.zhu@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
> Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>
> Subject: [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB
> definition for NVMe
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4303
>
>
>
> Add RPMB(Replay Protected Memory Block) access commands,
>
> result and DCB(Device Configuration Block) definition for
>
> NVMe according to the NVMe spec 2.0.
>
>
>
> Signed-off-by: Weipu Zhu <weipu.zhu@intel.com>
>
> Cc: Hao Wu <hao.a.wu@intel.com>
>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
>
> ---
>
> MdePkg/Include/IndustryStandard/Nvme.h | 46
> +++++++++++++++++++++++++-
>
> 1 file changed, 45 insertions(+), 1 deletion(-)
>
>
>
> diff --git a/MdePkg/Include/IndustryStandard/Nvme.h
> b/MdePkg/Include/IndustryStandard/Nvme.h
>
> index 4a1d92c45d..3b4e9fe67c 100644
>
> --- a/MdePkg/Include/IndustryStandard/Nvme.h
>
> +++ b/MdePkg/Include/IndustryStandard/Nvme.h
>
> @@ -2,12 +2,13 @@
>
> Definitions based on NVMe spec. version 1.1.
>
>
>
> (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
>
> - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
>
> + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR>
>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
>
>
> @par Specification Reference:
>
> NVMe Specification 1.1
>
> NVMe Specification 1.4
>
> + NVMe Specification 2.0
>
>
>
> **/
>
>
>
> @@ -502,6 +503,49 @@ typedef struct {
>
> // UINT8 *Data; /* Data to be written or read by signed
> access where M = 512 * Sector Count. */
>
> } NVME_RPMB_DATA_FRAME;
>
>
>
> +//
>
> +// RPMB Device Configuration Block Data Structure.
>
> +// (ref. NVMe Base spec. v2.0 Figure 460).
>
> +//
>
> +typedef struct {
>
> + UINT8 BPPEnable; /* Boot Partition Protection Enabled */
>
> + UINT8 BPLock; /* Boot Partition Lock */
>
> + UINT8 NameSpaceWrP; /* Namespace Write Protection */
>
> + UINT8 Rsvd1[509]; /* Reserved as of Nvm Express 2.0 Spec */
>
> +} NVME_RPMB_DCB;
>
> +
>
> +//
>
> +// RPMB Request and Response Message Types.
>
> +// (ref. NVMe Base spec. v2.0 Figure 461).
>
> +//
>
> +#define NVME_RPMB_AUTHKEY_PROGRAM 0x0001
>
> +#define NVME_RPMB_COUNTER_READ 0x0002
>
> +#define NVME_RPMB_AUTHDATA_WRITE 0x0003
>
> +#define NVME_RPMB_AUTHDATA_READ 0x0004
>
> +#define NVME_RPMB_RESULT_READ 0x0005
>
> +#define NVME_RPMB_DCB_WRITE 0x0006
>
> +#define NVME_RPMB_DCB_READ 0x0007
>
> +#define NVME_RPMB_AUTHKEY_PROGRAM_RESPONSE 0x0100
>
> +#define NVME_RPMB_COUNTER_READ_RESPONSE 0x0200
>
> +#define NVME_RPMB_AUTHDATA_WRITE_RESPONSE 0x0300
>
> +#define NVME_RPMB_AUTHDATA_READ_RESPONSE 0x0400
>
> +#define NVME_RPMB_DCB_WRITE_RESPONSE 0x0600
>
> +#define NVME_RPMB_DCB_READ_RESPONSE 0x0700
>
> +
>
> +//
>
> +// RPMB Operation Result.
>
> +// (ref. NVMe Base spec. v2.0 Figure 462).
>
> +//
>
> +#define NVME_RPMB_RESULT_SUCCESS 0x00
>
> +#define NVME_RPMB_RESULT_GENERAL_FAILURE 0x01
>
> +#define NVME_RPMB_RESULT_AHTHENTICATION_FAILURE 0x02
>
> +#define NVME_RPMB_RESULT_COUNTER_FAILURE 0x03
>
> +#define NVME_RPMB_RESULT_ADDRESS_FAILURE 0x04
>
> +#define NVME_RPMB_RESULT_WRITE_FAILURE 0x05
>
> +#define NVME_RPMB_RESULT_READ_FAILURE 0x06
>
> +#define NVME_RPMB_RESULT_AUTHKEY_NOT_PROGRAMMED 0x07
>
> +#define NVME_RPMB_RESULT_INVALID_DCB 0x08
>
> +
>
> //
>
> // NvmExpress Admin Identify Cmd
>
> //
>
> --
>
> 2.37.1.windows.1
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] MdePkg: Add NVMe boot partition header definition
2023-02-02 6:41 ` [PATCH v2 2/2] MdePkg: Add NVMe boot partition header definition Weipu Zhu
@ 2023-02-06 5:17 ` Wu, Hao A
2023-02-10 0:39 ` Michael D Kinney
0 siblings, 1 reply; 7+ messages in thread
From: Wu, Hao A @ 2023-02-06 5:17 UTC (permalink / raw)
To: Zhu, Weipu, devel@edk2.groups.io
Cc: Kinney, Michael D, Gao, Liming, Liu, Zhiguang
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Best Regards,
Hao Wu
> -----Original Message-----
> From: Zhu, Weipu <weipu.zhu@intel.com>
> Sent: Thursday, February 2, 2023 2:42 PM
> To: devel@edk2.groups.io
> Cc: Zhu, Weipu <weipu.zhu@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
> Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>
> Subject: [PATCH v2 2/2] MdePkg: Add NVMe boot partition header definition
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4304
>
> Add NVMe boot partition header definition to NVMe.h
> according to NVMe spec 2.0.
>
> Signed-off-by: Weipu Zhu <weipu.zhu@intel.com>
> Cc: Hao Wu <hao.a.wu@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> ---
> MdePkg/Include/IndustryStandard/Nvme.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/MdePkg/Include/IndustryStandard/Nvme.h
> b/MdePkg/Include/IndustryStandard/Nvme.h
> index 3b4e9fe67c..8b8a1bb7f3 100644
> --- a/MdePkg/Include/IndustryStandard/Nvme.h
> +++ b/MdePkg/Include/IndustryStandard/Nvme.h
> @@ -546,6 +546,19 @@ typedef struct {
> #define NVME_RPMB_RESULT_AUTHKEY_NOT_PROGRAMMED 0x07
> #define NVME_RPMB_RESULT_INVALID_DCB 0x08
>
> +//
> +// Get Log Page - Boot Partition Log Header.
> +// (ref. NVMe Base spec. v2.0 Figure 262).
> +//
> +typedef struct {
> + UINT8 LogIdentifier; /* Log Identifier, shall be set to 15h */
> + UINT8 Rsvd1[3];
> + UINT32 Bpsz : 15; /* Boot Partition Size */
> + UINT32 Rsvd2 : 16;
> + UINT32 Abpid : 1; /* Active Boot Partition ID */
> + UINT8 Rsvd3[8];
> +} NVME_BOOT_PARTITION_HEADER;
> +
> //
> // NvmExpress Admin Identify Cmd
> //
> --
> 2.37.1.windows.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB definition for NVMe
2023-02-06 5:17 ` Wu, Hao A
@ 2023-02-10 0:39 ` Michael D Kinney
2023-02-10 3:18 ` Michael D Kinney
0 siblings, 1 reply; 7+ messages in thread
From: Michael D Kinney @ 2023-02-10 0:39 UTC (permalink / raw)
To: Wu, Hao A, Zhu, Weipu, devel@edk2.groups.io
Cc: Gao, Liming, Liu, Zhiguang, Kinney, Michael D
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
> -----Original Message-----
> From: Wu, Hao A <hao.a.wu@intel.com>
> Sent: Sunday, February 5, 2023 9:18 PM
> To: Zhu, Weipu <weipu.zhu@intel.com>; devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>
> Subject: RE: [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB definition for NVMe
>
> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
>
> Best Regards,
> Hao Wu
>
> > -----Original Message-----
> > From: Zhu, Weipu <weipu.zhu@intel.com>
> > Sent: Thursday, February 2, 2023 2:42 PM
> > To: devel@edk2.groups.io
> > Cc: Zhu, Weipu <weipu.zhu@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
> > Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> > <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>
> > Subject: [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB
> > definition for NVMe
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4303
> >
> >
> >
> > Add RPMB(Replay Protected Memory Block) access commands,
> >
> > result and DCB(Device Configuration Block) definition for
> >
> > NVMe according to the NVMe spec 2.0.
> >
> >
> >
> > Signed-off-by: Weipu Zhu <weipu.zhu@intel.com>
> >
> > Cc: Hao Wu <hao.a.wu@intel.com>
> >
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> >
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> >
> > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> >
> > ---
> >
> > MdePkg/Include/IndustryStandard/Nvme.h | 46
> > +++++++++++++++++++++++++-
> >
> > 1 file changed, 45 insertions(+), 1 deletion(-)
> >
> >
> >
> > diff --git a/MdePkg/Include/IndustryStandard/Nvme.h
> > b/MdePkg/Include/IndustryStandard/Nvme.h
> >
> > index 4a1d92c45d..3b4e9fe67c 100644
> >
> > --- a/MdePkg/Include/IndustryStandard/Nvme.h
> >
> > +++ b/MdePkg/Include/IndustryStandard/Nvme.h
> >
> > @@ -2,12 +2,13 @@
> >
> > Definitions based on NVMe spec. version 1.1.
> >
> >
> >
> > (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
> >
> > - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
> >
> > + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR>
> >
> > SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >
> >
> > @par Specification Reference:
> >
> > NVMe Specification 1.1
> >
> > NVMe Specification 1.4
> >
> > + NVMe Specification 2.0
> >
> >
> >
> > **/
> >
> >
> >
> > @@ -502,6 +503,49 @@ typedef struct {
> >
> > // UINT8 *Data; /* Data to be written or read by signed
> > access where M = 512 * Sector Count. */
> >
> > } NVME_RPMB_DATA_FRAME;
> >
> >
> >
> > +//
> >
> > +// RPMB Device Configuration Block Data Structure.
> >
> > +// (ref. NVMe Base spec. v2.0 Figure 460).
> >
> > +//
> >
> > +typedef struct {
> >
> > + UINT8 BPPEnable; /* Boot Partition Protection Enabled */
> >
> > + UINT8 BPLock; /* Boot Partition Lock */
> >
> > + UINT8 NameSpaceWrP; /* Namespace Write Protection */
> >
> > + UINT8 Rsvd1[509]; /* Reserved as of Nvm Express 2.0 Spec */
> >
> > +} NVME_RPMB_DCB;
> >
> > +
> >
> > +//
> >
> > +// RPMB Request and Response Message Types.
> >
> > +// (ref. NVMe Base spec. v2.0 Figure 461).
> >
> > +//
> >
> > +#define NVME_RPMB_AUTHKEY_PROGRAM 0x0001
> >
> > +#define NVME_RPMB_COUNTER_READ 0x0002
> >
> > +#define NVME_RPMB_AUTHDATA_WRITE 0x0003
> >
> > +#define NVME_RPMB_AUTHDATA_READ 0x0004
> >
> > +#define NVME_RPMB_RESULT_READ 0x0005
> >
> > +#define NVME_RPMB_DCB_WRITE 0x0006
> >
> > +#define NVME_RPMB_DCB_READ 0x0007
> >
> > +#define NVME_RPMB_AUTHKEY_PROGRAM_RESPONSE 0x0100
> >
> > +#define NVME_RPMB_COUNTER_READ_RESPONSE 0x0200
> >
> > +#define NVME_RPMB_AUTHDATA_WRITE_RESPONSE 0x0300
> >
> > +#define NVME_RPMB_AUTHDATA_READ_RESPONSE 0x0400
> >
> > +#define NVME_RPMB_DCB_WRITE_RESPONSE 0x0600
> >
> > +#define NVME_RPMB_DCB_READ_RESPONSE 0x0700
> >
> > +
> >
> > +//
> >
> > +// RPMB Operation Result.
> >
> > +// (ref. NVMe Base spec. v2.0 Figure 462).
> >
> > +//
> >
> > +#define NVME_RPMB_RESULT_SUCCESS 0x00
> >
> > +#define NVME_RPMB_RESULT_GENERAL_FAILURE 0x01
> >
> > +#define NVME_RPMB_RESULT_AHTHENTICATION_FAILURE 0x02
> >
> > +#define NVME_RPMB_RESULT_COUNTER_FAILURE 0x03
> >
> > +#define NVME_RPMB_RESULT_ADDRESS_FAILURE 0x04
> >
> > +#define NVME_RPMB_RESULT_WRITE_FAILURE 0x05
> >
> > +#define NVME_RPMB_RESULT_READ_FAILURE 0x06
> >
> > +#define NVME_RPMB_RESULT_AUTHKEY_NOT_PROGRAMMED 0x07
> >
> > +#define NVME_RPMB_RESULT_INVALID_DCB 0x08
> >
> > +
> >
> > //
> >
> > // NvmExpress Admin Identify Cmd
> >
> > //
> >
> > --
> >
> > 2.37.1.windows.1
> >
> >
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] MdePkg: Add NVMe boot partition header definition
2023-02-06 5:17 ` Wu, Hao A
@ 2023-02-10 0:39 ` Michael D Kinney
0 siblings, 0 replies; 7+ messages in thread
From: Michael D Kinney @ 2023-02-10 0:39 UTC (permalink / raw)
To: Wu, Hao A, Zhu, Weipu, devel@edk2.groups.io
Cc: Gao, Liming, Liu, Zhiguang, Kinney, Michael D
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
> -----Original Message-----
> From: Wu, Hao A <hao.a.wu@intel.com>
> Sent: Sunday, February 5, 2023 9:18 PM
> To: Zhu, Weipu <weipu.zhu@intel.com>; devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>
> Subject: RE: [PATCH v2 2/2] MdePkg: Add NVMe boot partition header definition
>
> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
>
> Best Regards,
> Hao Wu
>
> > -----Original Message-----
> > From: Zhu, Weipu <weipu.zhu@intel.com>
> > Sent: Thursday, February 2, 2023 2:42 PM
> > To: devel@edk2.groups.io
> > Cc: Zhu, Weipu <weipu.zhu@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
> > Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> > <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>
> > Subject: [PATCH v2 2/2] MdePkg: Add NVMe boot partition header definition
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4304
> >
> > Add NVMe boot partition header definition to NVMe.h
> > according to NVMe spec 2.0.
> >
> > Signed-off-by: Weipu Zhu <weipu.zhu@intel.com>
> > Cc: Hao Wu <hao.a.wu@intel.com>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > ---
> > MdePkg/Include/IndustryStandard/Nvme.h | 13 +++++++++++++
> > 1 file changed, 13 insertions(+)
> >
> > diff --git a/MdePkg/Include/IndustryStandard/Nvme.h
> > b/MdePkg/Include/IndustryStandard/Nvme.h
> > index 3b4e9fe67c..8b8a1bb7f3 100644
> > --- a/MdePkg/Include/IndustryStandard/Nvme.h
> > +++ b/MdePkg/Include/IndustryStandard/Nvme.h
> > @@ -546,6 +546,19 @@ typedef struct {
> > #define NVME_RPMB_RESULT_AUTHKEY_NOT_PROGRAMMED 0x07
> > #define NVME_RPMB_RESULT_INVALID_DCB 0x08
> >
> > +//
> > +// Get Log Page - Boot Partition Log Header.
> > +// (ref. NVMe Base spec. v2.0 Figure 262).
> > +//
> > +typedef struct {
> > + UINT8 LogIdentifier; /* Log Identifier, shall be set to 15h */
> > + UINT8 Rsvd1[3];
> > + UINT32 Bpsz : 15; /* Boot Partition Size */
> > + UINT32 Rsvd2 : 16;
> > + UINT32 Abpid : 1; /* Active Boot Partition ID */
> > + UINT8 Rsvd3[8];
> > +} NVME_BOOT_PARTITION_HEADER;
> > +
> > //
> > // NvmExpress Admin Identify Cmd
> > //
> > --
> > 2.37.1.windows.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB definition for NVMe
2023-02-10 0:39 ` Michael D Kinney
@ 2023-02-10 3:18 ` Michael D Kinney
0 siblings, 0 replies; 7+ messages in thread
From: Michael D Kinney @ 2023-02-10 3:18 UTC (permalink / raw)
To: Wu, Hao A, Zhu, Weipu, devel@edk2.groups.io
Cc: Gao, Liming, Liu, Zhiguang, Kinney, Michael D
Both NVMe patches merged
PR: https://github.com/tianocore/edk2/pull/4026
Commits:
https://github.com/tianocore/edk2/commit/93a21b465bda44cecdd6347ad481ca6f55286547
https://github.com/tianocore/edk2/commit/069703228cfe6ba128a20e770af831699eae79b7
Mike
> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Thursday, February 9, 2023 4:39 PM
> To: Wu, Hao A <hao.a.wu@intel.com>; Zhu, Weipu <weipu.zhu@intel.com>; devel@edk2.groups.io
> Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: RE: [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB definition for NVMe
>
> Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
>
> > -----Original Message-----
> > From: Wu, Hao A <hao.a.wu@intel.com>
> > Sent: Sunday, February 5, 2023 9:18 PM
> > To: Zhu, Weipu <weipu.zhu@intel.com>; devel@edk2.groups.io
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>
> > Subject: RE: [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB definition for NVMe
> >
> > Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
> >
> > Best Regards,
> > Hao Wu
> >
> > > -----Original Message-----
> > > From: Zhu, Weipu <weipu.zhu@intel.com>
> > > Sent: Thursday, February 2, 2023 2:42 PM
> > > To: devel@edk2.groups.io
> > > Cc: Zhu, Weipu <weipu.zhu@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
> > > Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> > > <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>
> > > Subject: [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB
> > > definition for NVMe
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4303
> > >
> > >
> > >
> > > Add RPMB(Replay Protected Memory Block) access commands,
> > >
> > > result and DCB(Device Configuration Block) definition for
> > >
> > > NVMe according to the NVMe spec 2.0.
> > >
> > >
> > >
> > > Signed-off-by: Weipu Zhu <weipu.zhu@intel.com>
> > >
> > > Cc: Hao Wu <hao.a.wu@intel.com>
> > >
> > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > >
> > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > >
> > > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > >
> > > ---
> > >
> > > MdePkg/Include/IndustryStandard/Nvme.h | 46
> > > +++++++++++++++++++++++++-
> > >
> > > 1 file changed, 45 insertions(+), 1 deletion(-)
> > >
> > >
> > >
> > > diff --git a/MdePkg/Include/IndustryStandard/Nvme.h
> > > b/MdePkg/Include/IndustryStandard/Nvme.h
> > >
> > > index 4a1d92c45d..3b4e9fe67c 100644
> > >
> > > --- a/MdePkg/Include/IndustryStandard/Nvme.h
> > >
> > > +++ b/MdePkg/Include/IndustryStandard/Nvme.h
> > >
> > > @@ -2,12 +2,13 @@
> > >
> > > Definitions based on NVMe spec. version 1.1.
> > >
> > >
> > >
> > > (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
> > >
> > > - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
> > >
> > > + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR>
> > >
> > > SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > >
> > >
> > > @par Specification Reference:
> > >
> > > NVMe Specification 1.1
> > >
> > > NVMe Specification 1.4
> > >
> > > + NVMe Specification 2.0
> > >
> > >
> > >
> > > **/
> > >
> > >
> > >
> > > @@ -502,6 +503,49 @@ typedef struct {
> > >
> > > // UINT8 *Data; /* Data to be written or read by signed
> > > access where M = 512 * Sector Count. */
> > >
> > > } NVME_RPMB_DATA_FRAME;
> > >
> > >
> > >
> > > +//
> > >
> > > +// RPMB Device Configuration Block Data Structure.
> > >
> > > +// (ref. NVMe Base spec. v2.0 Figure 460).
> > >
> > > +//
> > >
> > > +typedef struct {
> > >
> > > + UINT8 BPPEnable; /* Boot Partition Protection Enabled */
> > >
> > > + UINT8 BPLock; /* Boot Partition Lock */
> > >
> > > + UINT8 NameSpaceWrP; /* Namespace Write Protection */
> > >
> > > + UINT8 Rsvd1[509]; /* Reserved as of Nvm Express 2.0 Spec */
> > >
> > > +} NVME_RPMB_DCB;
> > >
> > > +
> > >
> > > +//
> > >
> > > +// RPMB Request and Response Message Types.
> > >
> > > +// (ref. NVMe Base spec. v2.0 Figure 461).
> > >
> > > +//
> > >
> > > +#define NVME_RPMB_AUTHKEY_PROGRAM 0x0001
> > >
> > > +#define NVME_RPMB_COUNTER_READ 0x0002
> > >
> > > +#define NVME_RPMB_AUTHDATA_WRITE 0x0003
> > >
> > > +#define NVME_RPMB_AUTHDATA_READ 0x0004
> > >
> > > +#define NVME_RPMB_RESULT_READ 0x0005
> > >
> > > +#define NVME_RPMB_DCB_WRITE 0x0006
> > >
> > > +#define NVME_RPMB_DCB_READ 0x0007
> > >
> > > +#define NVME_RPMB_AUTHKEY_PROGRAM_RESPONSE 0x0100
> > >
> > > +#define NVME_RPMB_COUNTER_READ_RESPONSE 0x0200
> > >
> > > +#define NVME_RPMB_AUTHDATA_WRITE_RESPONSE 0x0300
> > >
> > > +#define NVME_RPMB_AUTHDATA_READ_RESPONSE 0x0400
> > >
> > > +#define NVME_RPMB_DCB_WRITE_RESPONSE 0x0600
> > >
> > > +#define NVME_RPMB_DCB_READ_RESPONSE 0x0700
> > >
> > > +
> > >
> > > +//
> > >
> > > +// RPMB Operation Result.
> > >
> > > +// (ref. NVMe Base spec. v2.0 Figure 462).
> > >
> > > +//
> > >
> > > +#define NVME_RPMB_RESULT_SUCCESS 0x00
> > >
> > > +#define NVME_RPMB_RESULT_GENERAL_FAILURE 0x01
> > >
> > > +#define NVME_RPMB_RESULT_AHTHENTICATION_FAILURE 0x02
> > >
> > > +#define NVME_RPMB_RESULT_COUNTER_FAILURE 0x03
> > >
> > > +#define NVME_RPMB_RESULT_ADDRESS_FAILURE 0x04
> > >
> > > +#define NVME_RPMB_RESULT_WRITE_FAILURE 0x05
> > >
> > > +#define NVME_RPMB_RESULT_READ_FAILURE 0x06
> > >
> > > +#define NVME_RPMB_RESULT_AUTHKEY_NOT_PROGRAMMED 0x07
> > >
> > > +#define NVME_RPMB_RESULT_INVALID_DCB 0x08
> > >
> > > +
> > >
> > > //
> > >
> > > // NvmExpress Admin Identify Cmd
> > >
> > > //
> > >
> > > --
> > >
> > > 2.37.1.windows.1
> > >
> > >
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-02-10 3:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1675319448.git.weipu.zhu@intel.com>
2023-02-02 6:41 ` [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB definition for NVMe Weipu Zhu
2023-02-06 5:17 ` Wu, Hao A
2023-02-10 0:39 ` Michael D Kinney
2023-02-10 3:18 ` Michael D Kinney
2023-02-02 6:41 ` [PATCH v2 2/2] MdePkg: Add NVMe boot partition header definition Weipu Zhu
2023-02-06 5:17 ` Wu, Hao A
2023-02-10 0:39 ` Michael D Kinney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox