[edk2-devel] [PATCH 09/33] AMD/VanGoghBoard: Check in Flash_AB

duke.zhai via groups.io posted 33 patches 7 months, 3 weeks ago
There is a newer version of this series
[edk2-devel] [PATCH 09/33] AMD/VanGoghBoard: Check in Flash_AB
Posted by duke.zhai via groups.io 7 months, 3 weeks ago
From: Duke Zhai <Duke.Zhai@amd.com>


BZ #:4640

Chachani board supports AB recovery function.

Initial Flash_AB module to create AB recovery header in BIOS binary.



Signed-off-by: Duke Zhai <duke.zhai@amd.com>

Cc: Eric Xing <eric.xing@amd.com>

Cc: Ken Yao <ken.yao@amd.com>

Cc: Igniculus Fu <igniculus.fu@amd.com>

Cc: Abner Chang <abner.chang@amd.com>

---

 .../ImageSlotHeader/ImageSlotHeader_1.inf     | 34 ++++++++++++++++

 .../ImageSlotHeader/ImageSlotHeader_1.nasmb   | 18 +++++++++

 .../ImageSlotHeader/ImageSlotHeader_2.inf     | 34 ++++++++++++++++

 .../ImageSlotHeader/ImageSlotHeader_2.nasmb   | 18 +++++++++

 .../Flash_AB/NewEFS/NewEFS.inf                | 26 ++++++++++++

 .../Flash_AB/NewEFS/NewEFS.nasmb              | 40 +++++++++++++++++++

 .../PspL1Directory/PspL1Directory.inf         | 38 ++++++++++++++++++

 .../PspL1Directory/PspL1Directory.nasmb       | 28 +++++++++++++

 8 files changed, 236 insertions(+)

 create mode 100644 Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_1.inf

 create mode 100644 Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_1.nasmb

 create mode 100644 Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_2.inf

 create mode 100644 Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_2.nasmb

 create mode 100644 Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/NewEFS/NewEFS.inf

 create mode 100644 Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/NewEFS/NewEFS.nasmb

 create mode 100644 Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/PspL1Directory/PspL1Directory.inf

 create mode 100644 Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/PspL1Directory/PspL1Directory.nasmb



diff --git a/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_1.inf b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_1.inf

new file mode 100644

index 0000000000..61184ca544

--- /dev/null

+++ b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_1.inf

@@ -0,0 +1,34 @@

+## @file

+#  ImageSlotHeader_1

+#

+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  INF_VERSION                    = 0x00010005

+  BASE_NAME                      = ImageSlotHeader_1

+  FILE_GUID                      = 3FAD5469-976C-4BBB-8127-43D536A71356

+  MODULE_TYPE                    = SEC

+  VERSION_STRING                 = 1.1

+

+#

+# The following information is for reference only and not required by the build tools.

+#

+#  VALID_ARCHITECTURES           = IA32 X64

+#

+

+[Sources]

+  ImageSlotHeader_1.nasmb

+

+[Packages]

+  MdePkg/MdePkg.dec

+  ChachaniBoardPkg/Project.dec

+

+[Pcd]

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotImageSize

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotDefaultPriority

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotUpdateRetries

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotGlitchRetry

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlot1Base

\ No newline at end of file

diff --git a/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_1.nasmb b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_1.nasmb

new file mode 100644

index 0000000000..6b57199f2f

--- /dev/null

+++ b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_1.nasmb

@@ -0,0 +1,18 @@

+;/** @file

+; ImageSlotHeader_1

+;

+; Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>

+; SPDX-License-Identifier: BSD-2-Clause-Patent

+;

+;**/

+

+BITS    16

+

+ALIGN   16

+

+ImageSlotHeader:

+  DD FixedPcdGet32 (PcdFlashAbImageSlotDefaultPriority) ; Priority

+  DD FixedPcdGet32 (PcdFlashAbImageSlotUpdateRetries)   ; UpdateRetries  - [2^(n+1) - 1]

+  DD FixedPcdGet32 (PcdFlashAbImageSlotGlitchRetry)     ; GlitchRetry

+  DD FixedPcdGet32 (PcdFlashAbImageSlot1Base)           ; Location of IMAGES_SLOT No.

+  ; Enhanced Structure

diff --git a/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_2.inf b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_2.inf

new file mode 100644

index 0000000000..df23e3d8fd

--- /dev/null

+++ b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_2.inf

@@ -0,0 +1,34 @@

+## @file

+#  ImageSlotHeader_2

+#

+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  INF_VERSION                    = 0x00010005

+  BASE_NAME                      = ImageSlotHeader_2

+  FILE_GUID                      = 889470B2-F0EC-456b-9D23-5379959AB561

+  MODULE_TYPE                    = SEC

+  VERSION_STRING                 = 1.1

+

+#

+# The following information is for reference only and not required by the build tools.

+#

+#  VALID_ARCHITECTURES           = IA32 X64

+#

+

+[Sources]

+  ImageSlotHeader_2.nasmb

+

+[Packages]

+  MdePkg/MdePkg.dec

+  ChachaniBoardPkg/Project.dec

+

+[Pcd]

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotImageSize

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotDefaultPriority

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotUpdateRetries

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotGlitchRetry

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlot2Base

\ No newline at end of file

diff --git a/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_2.nasmb b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_2.nasmb

new file mode 100644

index 0000000000..c257cf3c3f

--- /dev/null

+++ b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/ImageSlotHeader/ImageSlotHeader_2.nasmb

@@ -0,0 +1,18 @@

+;/** @file

+; ImageSlotHeader_2

+;

+; Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>

+; SPDX-License-Identifier: BSD-2-Clause-Patent

+;

+;**/

+

+BITS    16

+

+ALIGN   16

+

+ImageSlotHeader:

+  DD FixedPcdGet32 (PcdFlashAbImageSlotDefaultPriority) - 1 ; Priority

+  DD FixedPcdGet32 (PcdFlashAbImageSlotUpdateRetries)       ; UpdateRetries  - [2^(n+1) - 1]

+  DD FixedPcdGet32 (PcdFlashAbImageSlotGlitchRetry)         ; GlitchRetry

+  DD FixedPcdGet32 (PcdFlashAbImageSlot2Base)               ; Location of IMAGES_SLOT No.

+  ; Enhanced Structure

diff --git a/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/NewEFS/NewEFS.inf b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/NewEFS/NewEFS.inf

new file mode 100644

index 0000000000..2315f0e2e1

--- /dev/null

+++ b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/NewEFS/NewEFS.inf

@@ -0,0 +1,26 @@

+## @file

+#  EFS header

+#

+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  INF_VERSION                    = 0x00010005

+  BASE_NAME                      = NewEFS

+  FILE_GUID                      = 9EB20E65-AA38-44e8-8315-BE4305EAB250

+  MODULE_TYPE                    = SEC

+  VERSION_STRING                 = 1.1

+

+#

+# The following information is for reference only and not required by the build tools.

+#

+#  VALID_ARCHITECTURES           = IA32 X64

+#

+

+[Sources]

+  NewEFS.nasmb

+

+[Packages]

+  MdePkg/MdePkg.dec

diff --git a/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/NewEFS/NewEFS.nasmb b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/NewEFS/NewEFS.nasmb

new file mode 100644

index 0000000000..1133fe21ae

--- /dev/null

+++ b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/NewEFS/NewEFS.nasmb

@@ -0,0 +1,40 @@

+;/** @file

+; ImageSlotHeader_2

+;

+; Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>

+; SPDX-License-Identifier: BSD-2-Clause-Patent

+;

+;**/

+

+BITS    16

+

+ALIGN   16

+

+OemRomSignature:

+  DD 0x55AA55AA                               ; 0x00 - Signature

+  DD 0x00000000                               ; 0x04 - Reserved

+  DD 0x00000000                               ; 0x08 - Reserved

+  DD 0x00000000                               ; 0x0C - Reserved

+  DD 0x00000000                               ; 0x10 - Reserved

+  DD 0x00021000                               ; 0x14 - PSP_L1_DIRECTORY

+  DD 0x00000000                               ; 0x18 - Reserved

+  DD 0x00000000                               ; 0x1C - Reserved

+  DD 0x00000000                               ; 0x20 - Reserved

+  DD 0x00000000                               ; 0x24 - Reserved

+  DD 0x00000000                               ; 0x28 - Reserved

+  DD 0x00000000                               ; 0x2C - Reserved

+  DD 0x00000000                               ; 0x30 - Reserved

+  DD 0x00000000                               ; 0x34 - Reserved

+  DD 0x00000000                               ; 0x38 - Reserved

+  DD 0x00000000                               ; 0x3C - Reserved

+  DB 0xFF                                     ; 0x40 - SPI read mode for

+  DB 0xFF                                     ; 0x41 - SPI read speed for

+  DB 0x00                                     ; 0x42 - Reserved

+  DB 0xFF                                     ; 0x43 - SPI read mode

+  DB 0xFF                                     ; 0x44 - SPI read speed

+  DB 0xFF                                     ; 0x45 - SPI Dummy Cycle Config

+  DB 0x00                                     ; 0x46 - Reserved

+  DB 0x05                                     ; 0x47 - SpiReadMode

+  DB 0x00                                     ; 0x48 - SpiFastSpeed

+  DB 0x55                                     ; 0x49 - MicronDetectFlag

+  DB 0x01                                     ; 0x4A - SpiWriteSpeed

diff --git a/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/PspL1Directory/PspL1Directory.inf b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/PspL1Directory/PspL1Directory.inf

new file mode 100644

index 0000000000..b96f6774d5

--- /dev/null

+++ b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/PspL1Directory/PspL1Directory.inf

@@ -0,0 +1,38 @@

+## @file

+#  PspL1Directory

+#

+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  INF_VERSION                    = 0x00010005

+  BASE_NAME                      = PspL1Directory

+  FILE_GUID                      = A41C64EC-9702-42bd-8C4A-84F64CA6DCFE

+  MODULE_TYPE                    = SEC

+  VERSION_STRING                 = 1.1

+

+#

+# The following information is for reference only and not required by the build tools.

+#

+#  VALID_ARCHITECTURES           = IA32 X64

+#

+

+[Sources]

+  PspL1Directory.nasmb

+

+[Packages]

+  MdePkg/MdePkg.dec

+  ChachaniBoardPkg/Project.dec

+

+[Pcd]

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotNumbers

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotHeader1Base

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotHeader2Base

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotHeader3Base

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotHeader4Base

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotHeader5Base

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotHeader6Base

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotHeader7Base

+  gPlatformPkgTokenSpaceGuid.PcdFlashAbImageSlotHeader8Base

diff --git a/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/PspL1Directory/PspL1Directory.nasmb b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/PspL1Directory/PspL1Directory.nasmb

new file mode 100644

index 0000000000..65cbc4565a

--- /dev/null

+++ b/Platform/AMD/VanGoghBoard/VanGoghCommonPkg/Flash_AB/PspL1Directory/PspL1Directory.nasmb

@@ -0,0 +1,28 @@

+;/** @file

+; ImageSlotHeader_2

+;

+; Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>

+; SPDX-License-Identifier: BSD-2-Clause-Patent

+;

+;**/

+

+BITS    16

+

+ALIGN   16

+

+PspL1Directory:

+  ; Header

+  DD 0x50535024                                      ; Signature ‘$PSP’

+  DD 0x00000000                                      ; Checksum of PSP_L1_DIRECTORY

+  DD FixedPcdGet32 (PcdFlashAbImageSlotNumbers)      ; Total enties of IMAGE_SLOT

+  DD 0x00000000                                      ; Reserved

+  ; Entry 1

+  DD 0x00000048                                      ; Type

+  DD 0x00000000                                      ; Size - Reserved

+  DD FixedPcdGet32 (PcdFlashAbImageSlotHeader1Base)  ; Location (L) of IMAGE_SLOT_HEADER No.

+  DD 0x00000000                                      ; Location (H) of IMAGE_SLOT_HEADER No.

+  ; Entry 2

+  DD 0x0000004A                                      ; Type

+  DD 0x00000000                                      ; Size - Reserved

+  DD FixedPcdGet32 (PcdFlashAbImageSlotHeader2Base)  ; Location (L) of IMAGE_SLOT_HEADER No.

+  DD 0x00000000                                      ; Location (H) of IMAGE_SLOT_HEADER No.

--

2.31.1





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114058): https://edk2.groups.io/g/devel/message/114058
Mute This Topic: https://groups.io/mt/103831170/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-