You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 28, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: Platform/Ampere/JadePkg/PlatformPortingGuide.md
+145-8Lines changed: 145 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ Modify it appropriately for the new platform configuration.
86
86
87
87
Please refer to the Ampere Altra Interface Firmware Requirements at the Table 4 for detailed descriptions of each Board Setting fields.
88
88
89
-
### PCIe
89
+
### PCIe Root Complex Configuration
90
90
91
91
Below modules are generic and can be shared among Ampere Altra-based platforms.
92
92
@@ -103,6 +103,8 @@ Silicon/Ampere/AmpereAltraPkg/Library/PciSegmentLib | Provide functions to ac
103
103
The difference between platforms could be the mechanism to control the PERST line for each PCIe controller and the segment number.
104
104
Platform code must modify the functions below in the Platform/Ampere/JadePkg/Library/BoardPcieLib/BoardPcieLib.c to comply with specific platform hardware.
105
105
106
+
This `BoardPcieAssertPesrt()` function controls the toggling of PERST to release reset to endpoint card. The Mt. Jade platform uses a combination of GPIO pins to assert PERST to endpoint card.
107
+
106
108
**BoardPcieAssertPerst**
107
109
108
110
```c
@@ -125,6 +127,8 @@ Platform code must modify the functions below in the Platform/Ampere/JadePkg/Lib
125
127
);
126
128
```
127
129
130
+
This `BoardPcieGetSegmentNumber()` defines the segment number mapping of PCIe root complexes. See the content in the inline function for more information about PCIe segment mapping in Ampere Mt. Jade platform.
131
+
128
132
**BoardPcieGetSegmentNumber**
129
133
130
134
```c
@@ -141,6 +145,92 @@ Platform code must modify the functions below in the Platform/Ampere/JadePkg/Lib
141
145
IN AC01_ROOT_COMPLEX *RootComplex
142
146
);
143
147
```
148
+
Note: Although the PCIe segment number mapping could be changed but it is not recommended unless the custom board has to use a different mapping. If using different mapping, along with the change in `BoardPcieGetSegmentNumber()`, the PCIe segment number must be also updated in ACPI DSDT and MCFG tables.
149
+
150
+
### PCIe Hot-Plug
151
+
`Silicon/Ampere/AmpereAltraPkg/Library/PcieHotPlugLib` is the base library that supports the function calls to start PCIe Hot-Plug service including the SPCI callings to ATF to set hot-plug port map, and GPIO or I2C for PCIe reset. There are two functions in this library that a custom board can use to change the hot-plug configuration if it is different from Mt. Jade platform: `PcieHotPlugSetPortMap()` and `PcieHotplugSetGpioMap()`. By default, the configuration of Ampere Mt. Jade 2U platform will be set. In case the new board uses a different configuration, user can override the default PCDs used by these two functions with the custom configuration in `NewBoard.dsc`.
152
+
153
+
**PcieHotplugSetPortMap()**
154
+
155
+
Function `PcieHotplugSetPortMap()` passes hot-plug configuration to Arm Trusted Firmware (ATF) to update/customize port map entries such as I2C address, RCA port, RCA sub-port, etc. It uses SPCI PORTMAP_SET_CMD to send that information to ATF. Refer to the document titled Altra ATF Interface Specification for more details on this function.
156
+
157
+
A custom platform that does not use the same Hot-Plug PortMap configuration with Ampere Mt. Jade 2U platform must define the corresponding PCD below.
158
+
159
+
```c
160
+
#
161
+
# Flag to indicate option of using default or specific platform Port Map table
162
+
# Set TRUE: if using the default setting in Ampere Mt. Jade 2U platform.
163
+
# Set FALSE: if using a custom PCIe Hot-Plug Port Map settings.
gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[36]|{ 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF } # Require if no fully structure used
225
+
```
226
+
227
+
**PcieHotplugSetGpioMap()**
228
+
229
+
Function `PcieHotplugSetGpioMap()` is used to limit the number of GPIO[16:21] pins or use I2C instead of GPIO for PCIe reset. It uses SPCI GPIOMAP_CMD to send information to ATF. Ampere EDK2 defines `gPcieHotPlugGpioResetMap` PCD to allow user to define a custom GPIO Map. In `NewBoard.dsc`, user should set the new PCD indicating the GPIO Map for PCIe Hot-Plug. Below is the GPIO Reset Map PCD definition for Ampere Mt. Jade platform.
@@ -159,6 +249,16 @@ In order to modify the platform specific tables under `Platform/Ampere/NewBoardP
159
249
* UART2 for ACPI DBG2 table
160
250
* UART3: non-use
161
251
* Add or remove UART devices based on the platform configuration.
252
+
* DSDT/MHPP for Memory Hot-Plug Port Mapping
253
+
* This is a shared DRAM memory region between ATF and UEFI to indicate a PCIe hot-plug event action. An item of this MHPP region is used to reflect a hot-plug event action of each PCIe port. Whenever there is a PCIe hot-plug event, ATF will update the action value to each item of MHPP region, and UEFI will handle the hot-plug ejection/insertion accordingly
254
+
* An item of MHPP is 24-bytes in size and is named by a 4-character word (mnemonic) to represent a PCIe Root Port device. The name format is <root_complex_A/B><socket><root_complex_number><root_complex_port>. For example, if the board has a PCIe Root Port device RCA2.0 on socket 1 the hot-plug event action item must be named A120.
255
+
* This MHPP region is declared in the file named `Platform/Ampere/JadePkg/AcpiTable/MHPP.asi`. For Altra Max, this ACPI table is located at `Platform/Ampere/JadePkg/Ac02AcpiTables/MHPP.asi`. If the new board has the list of PCIe devices different than the Ampere Mt. Jade board, these items in MHPP region must be renamed.
256
+
* DSDT/PCI for Hot-Plug events
257
+
* The files to declare the PCIe Root Port are `Platform/Ampere/JadePkg/AcpiTables/{PCI-S0.asi, PCI-S1.asi}`. Note that the ACPI tables for Altra Max based platform is at `Platform/Ampere/JadePkg/Ac02AcpiTables/` folder. To support full hot-plug feature (software and hardware hot-plug with LED behavior functioning), the Segment:Bus:Device.Function (S:B:D.F) of the Root Port must be declared correctly. Follow the steps listed below to declare them.
258
+
* List down PCIe devices tree in Linux using lspci -tv command to see all Root Port S:B:D.F values.
259
+
* Find out which PCIe device includes the segment that the Root Port has.
260
+
* Based on this S:B:D.F, declare Root Port device into the PCIe Device just found.
261
+
* Add _STA and _EJ0 instance to handle insertion and ejection events.
162
262
163
263
### SMBIOS
164
264
@@ -203,17 +303,24 @@ You can also leverage `EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTi
203
303
204
304
The IPMI SSIF is used for the communication between the BMC and the SoC. It requires the following modules:
205
305
206
-
*`Silicon/Ampere/AmpereAltraPkg/Drivers/SmbusHcDxe/SmbusHcDxe.inf`: This driver produces the SMBUS protocol.
207
-
*`Silicon/Ampere/AmpereSiliconPkg/Library/IpmiCommandLibExt/IpmiCommandLibExt.inf`: This library instance provides supplementary IPMI Commands to the `Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib`.
208
-
*`Silicon/Ampere/AmpereSiliconPkg/Drivers/IpmiSsifDxe/IpmiSsifDxe.inf`: This driver produces the IPMI protocol.
209
-
*`Platform/Ampere/NewBoardPkg/Library/DxePlatformSmbusLib/DxePlatformSmbusLib.inf`: This library layers on top of the SMBUS protocol to provide platform specific SMBUS API functions. On the Mt. Jade platform, the SoC relies on the GPI0 (referred to as BMC READY GPIO) to determine whether the BMC is ready for the communication.
306
+
*`Silicon/Ampere/AmpereAltraPkg/Library/SmbusHcCommonLib/SmbusHcCommonLib.inf`: This library instance provides common API to execute SMBus operations.
307
+
*`Silicon/Ampere/AmpereAltraPkg/Drivers/SmbusHcDxe/SmbusHcDxe.inf`: This driver produces the SMBUS protocol at DXE phase.
308
+
*`Silicon/Ampere/AmpereAltraPkg/Drivers/SmbusHcPei/SmbusHcPei.inf`: This driver produces the SMBUS protocol at PEI phase.
309
+
*`Silicon/Ampere/AmpereSiliconPkg/Library/IpmiCommandLibExt/IpmiCommandLibExt.inf`: This library instance provides supplementary IPMI Commands to the Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib.
310
+
*`Silicon/Ampere/AmpereSiliconPkg/Drivers/IpmiSsif/IpmiSsifDxe.inf`: This driver produces the IPMI protocol at DXE phase.
311
+
*`Silicon/Ampere/AmpereSiliconPkg/Drivers/IpmiSsif/IpmiSsifPeim.inf`: This driver produces the IPMI protocol at PEI phase.
312
+
*`Platform/Ampere/NewBoardPkg/Library/PlatformBmcReadyLib/PlatformBmcReadyLib.inf`: This platform-dependent library provides API to check BMC status before executing SMBus commands for IPMI communication. On the Mt. Jade platform, the Altra SoC relies on GPI0 (referred to as BMC_READY GPIO) to determine status of BMC is ready for the IPMI communication. If the custom platform does not support this pin, use a NULL library that assumes BMC is always on and ready to accept IPMI messages. Put below line to NewBoard.dsc.
1. Ensure that the I2C4 is connected to the BMC and the frequency is operated at 400KHz.
214
-
2. Update correspondingly the following PCDs if there are different configuration from the BMC slave address and the BMC READY GPIO.
215
-
* gAmpereTokenSpaceGuid.PcdBmcSlaveAddr
216
-
* gAmpereTokenSpaceGuid.PcdBmcReadyGpio
321
+
2. Update correspondingly the following PCDs if there are different configuration from the BMC slave address and the BMC_READY GPIO if the custom board uses BMC_READY GPIO to determine the status of BMC.
322
+
*`gAmpereTokenSpaceGuid.PcdBmcSlaveAddr`
323
+
*`gAmpereTokenSpaceGuid.PcdBmcReadyGpio`
217
324
218
325
### Signed Capsule Update
219
326
@@ -232,6 +339,36 @@ No change is needed.
232
339
233
340
It's important that the ATF running on the new platform must comply with the Ampere Altra Interface Firmware Requirements.
234
341
342
+
### Secure Boot and Update
343
+
No change is needed. The new platform can inherit the required libraries and modules to support this feature.
344
+
345
+
Ampere EDK2 supports UEFI Secure Boot and it complies with UEFI Specifications. User can change the UEFI secure boot keys using UEFI Menu Setup.
346
+
347
+
Starting from Ampere EDK2 release 2.04.100, the new UEFI Shell utility: `eask` is used to deploy DBB/DBU key for UEFI/BL33 firmware authentication at boot and upgrade. In the build command, the argument `VER=<Major.Minor>` must be greater than 2.04 and the build process will append the certificate into the firmware image for the BL33 Root-of-Trust Secure Boot purpose.
348
+
349
+
If the DBB/DBU secure keys are deployed, requires to boot and update EDK2 firmware via capsule using the signed firmware image.
350
+
351
+
Below is the command usage of UEFI Shell utility eask to deploy dbb/dbu secure keys for BL33 UEFI authentication.
352
+
353
+
```c
354
+
Shell> help eask
355
+
Enroll Ampere Secure Keys Usage
356
+
EASK
357
+
-K <UpdateDBUPubCertFile>
358
+
-k
359
+
-P <UpdateDBBPubCertFile>
360
+
-p
361
+
362
+
-K: Register the Public Key Certificate to be used for firmware update verification. This must be an x509 certificate.
363
+
The file provided must be the authorization file (.auth) to register or delete the DBU certificate.
364
+
-k: Read enrolled DBU certificate
365
+
-P: Register the Public Key Certificate to be used for firmware verification. This must be an x509 certificate.
366
+
The file provided must be the authorization file (.auth) to register or delete the DBB certificate.
367
+
-p: Read enrolled DBB certificate
368
+
```
369
+
370
+
Starting from Ampere EDK2 2.05.100, user can run firmware update at run-time OS without reboot using [amp_fwupgrade](https://github.com/AmpereComputing/amp-fwupgrade) utility to update signed ATF-UEFI EDK2 image and signed SCP image.
0 commit comments