openbmc / openpower-proc-control

Routines to start and stop OpenPower processors.
Apache License 2.0
1 stars 6 forks source link

Manual override of SBE side #3

Open hanetzer opened 5 years ago

hanetzer commented 5 years ago

So, I'm beginning work on porting coreboot to power9, specifically the Talos II family of boards. In part of this, I'll be altering the hostboot bootloader to kickstart the coreboot way of doing things, and as such will need to alter the seeproms.

I had the idea to use the RebootAttempts variable to force it one way or the other, keeping a 'normal' seeprom image on one side and working on the other, so as to have a safe fallback (the way the talos machines are wired up one can easily read/write one seeprom side via i2c, and not the other). However, using busctl set-property for it resets it to 3.

So, I had an idea based on the cfam override file; what if we took the code below https://github.com/openbmc/openpower-proc-control/blob/16ab00cb9383b17b8dd033a1cb300e2a013d55b1/procedures/p9/start_host.cpp#L70-L81 and altered it to first check for some override file to determine which seeprom side to boot, then doing the normal RebootAttempts manner? It would keep current behavior, and allow a bit of flex when doing sbe work.

Do you think this would be a good option for 'everyone' or should it just be a local hack I use indev?

geissonator commented 5 years ago

I'd tend to lean more towards a openpower setting that could be used to override the boot side selection vs. something like the CFAM override. Maybe a SBE.interface.yaml with a Settings property out at https://github.com/openbmc/openpower-dbus-interfaces/tree/master/org/open_power/Control/? @spinler ?

amboar commented 5 years ago

@geissonator I'm with you there, not sure why we chose to hide it behind the boot counter initially.

geissonator commented 5 years ago

The current design using the boot counter was just the default rule from previous POWER systems. Providing an override to that policy makes sense to me (for both production and lab debug)

hanetzer commented 5 years ago

@geissonator @amboar as long as something is done along those lines I'd be happy. Currently I have two unconditional openpower-proc-control-[01] binaries which I manually swap symlinks to openpower-proc-control which forces the boot of one or the other, but a less hackish way would be appreciated.

dcrowell77 commented 5 years ago

keeping a 'normal' seeprom image on one side and working on the other, so as to have a safe fallback

This is exactly the way the current code works. We update the active side in Hostboot and then force a reboot. If the reboot succeeds and we boot up to our SBE update step again then we declare it good and write the same image into the backup side. If we can't boot that far, OpenBMC will eventually flip sides and boot us from the backup side. Hostboot knows we're on the wrong side and won't try to update it.

hanetzer commented 5 years ago

@dcrowell77 Ah, that's cool. On another note I've actually figured a way I should be able to boot coreboot without changing either the seeprom's sbe firmware or the hostboot binary by wrapping the coreboot.rom in ffs style headers with the tool fpart, so this particular issue isn't as important as I thought it to be at the time.