How to modify RetryCount

Hi,nvidia
I am using the board of Jeston Orin
Can i modify the slotA or slotB 's retry count on the linux

Hi shuochong.liu,

The variable(RootfsRetryCountMax) is configured as locked so that you can not configure it in runtime.
Please specify ROOTFS_RETRY_COUNT_MAX in flash command as Flashing the Target Board with a Redundant Root File Systems during flash.

Hi
I found that slotA or slotB’s retry count is stored in a register.
So I want to know if I can modify the value of this register on Linux.

Which register do you mean?
As I know, it is stored in efi variable and locked by default.
We don’t suggest user configuring it so that we configure it locked.

The registers that will be read during system warm boot.

STATIC
EFI_STATUS
EFIAPI
SyncSrRfAndmRootfsInfo (
  IN  UINT32  Direction,
  OUT UINT32  *RegisterValue
  )
{
  EFI_STATUS  Status = EFI_SUCCESS;

  switch (Direction) {
    case FROM_REG_TO_VAR:
      // Copy CurrentSlot, RetryCountA/B from Scratch Register to mRootfsInfo
      mRootfsInfo.CurrentSlot = SR_RF_CURRENT_SLOT_GET (*RegisterValue);

      mRootfsInfo.RetryCountSlotA = SR_RF_RETRY_COUNT_A_GET (*RegisterValue);
      mRootfsInfo.RetryCountSlotB = SR_RF_RETRY_COUNT_B_GET (*RegisterValue);
      break;
    case FROM_VAR_TO_REG:
      // Copy CurrentSlot, RetryCountA/B from mRootfsInfo to Scratch Register
      *RegisterValue = SR_RF_CURRENT_SLOT_SET (mRootfsInfo.CurrentSlot, *RegisterValue);

      *RegisterValue = SR_RF_RETRY_COUNT_A_SET (mRootfsInfo.RetryCountSlotA, *RegisterValue);
      *RegisterValue = SR_RF_RETRY_COUNT_B_SET (mRootfsInfo.RetryCountSlotB, *RegisterValue);
      break;
    default:
      break;
  }

  return Status;
}

The above code is the source code in UEFI. I would like to know if Linux can access the register mentioned in UEFI.

They are stored in efi variable as I mentioned before and are configured as locked by default.
You can find the following file under /sys/firmware/efi/efivars/

RootfsRetryCountMax-781e084c-a330-417c-b678-38e696380cb9
RootfsStatusSlotA-781e084c-a330-417c-b678-38e696380cb9
RootfsStatusSlotB-781e084c-a330-417c-b678-38e696380cb9

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.