Skip to content

Commit 3f37773

Browse files
generatedunixname2655515034848748meta-codesync[bot]
authored andcommitted
fbcode/openbmc/openbmc/tools/flashy/checks_and_remediations/common/90_expose_real_flash0_on_secondary_boot.go
Reviewed By: echistyakov Differential Revision: D95030066 fbshipit-source-id: 86c629379e7357beeeb42d274c4ef4d9e18c49f2
1 parent fe92e76 commit 3f37773

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tools/flashy/checks_and_remediations/common/90_expose_real_flash0_on_secondary_boot.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ package common
2121

2222
import (
2323
"encoding/binary"
24+
"fmt"
2425
"log"
2526
"os"
2627
"syscall"
2728

2829
"github.com/facebook/openbmc/tools/flashy/lib/step"
2930
"github.com/facebook/openbmc/tools/flashy/lib/utils"
30-
"github.com/pkg/errors"
3131
)
3232

3333
// From ASPEED AST2400/AST1250 A1 Datasheet – V1.3, p524
@@ -51,7 +51,7 @@ func init() {
5151
func ExposeRealFlash0OnSecondaryBoot(stepParams step.StepParams) step.StepExitError {
5252
machine, err := utils.GetMachine()
5353
if err != nil {
54-
return step.ExitSafeToReboot{Err: errors.Errorf("Unable to fetch machine: %v", err)}
54+
return step.ExitSafeToReboot{Err: fmt.Errorf("Unable to fetch machine: %w", err)}
5555
}
5656

5757
// Bail if not running on AST2400 (armv5tejl) nor AST2500 (armv6l)
@@ -62,7 +62,7 @@ func ExposeRealFlash0OnSecondaryBoot(stepParams step.StepParams) step.StepExitEr
6262

6363
mem, err := MmapDevMemRw()
6464
if err != nil {
65-
return step.ExitSafeToReboot{Err: errors.Errorf("Unable to mmap /dev/mem: %v", err)}
65+
return step.ExitSafeToReboot{Err: fmt.Errorf("Unable to mmap /dev/mem: %w", err)}
6666
}
6767
defer Munmap(mem)
6868

@@ -98,7 +98,7 @@ var ResetWDT2StatusReg = func(mem []byte) error {
9898

9999
wdt2_status_reg := ReadWDT2StatusReg(mem)
100100
if wdt2_status_reg&0b10 == 0b10 {
101-
return errors.Errorf("Unable to clear WDT2 second boot code flag @ 0x%x, current value = 0x%x", WDT2_STATUS_REG_ADDR, wdt2_status_reg)
101+
return fmt.Errorf("Unable to clear WDT2 second boot code flag @ 0x%x, current value = 0x%x", WDT2_STATUS_REG_ADDR, wdt2_status_reg)
102102
}
103103

104104
return nil

0 commit comments

Comments
 (0)