openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Aladyshev <aladyshev22@gmail.com>
To: openbmc@lists.ozlabs.org
Subject: Support for the "BIOS boot type" option in the 'phosphor-host-ipmid'
Date: Mon, 8 Feb 2021 22:38:18 +0300	[thread overview]
Message-ID: <CACSj6VW38ctPRF7VeOnm7CB39QtFyK0SAMtggm9uZxU3JHU4QQ@mail.gmail.com> (raw)

What was the point of splitting IPMI boot source interface to BootMode
and BootSource?
https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Control/Boot/Mode.interface.yaml
https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Control/Boot/Source.interface.yaml

In the IPMI specification all possible boot options are represented by
"Boot Device Selector" field in the "Get System Boot Options" сommand:

```
[5:2] - Boot device selector
0000b = No override
0001b = Force PXE
0010b = Force boot from default Hard-drive
0011b = Force boot from default Hard-drive, request Safe Mode
0100b = Force boot from default Diagnostic Partition
0101b = Force boot from default CD/DVD
0110b = Force boot into BIOS Setup
0111b = Force boot from remotely connected (redirected) Floppy/primary
removable media
1001b = Force boot from primary remote media
1000b = Force boot from remotely connected (redirected) CD/DVD
1010b = reserved
1011b = Force boot from remotely connected (redirected) Hard Drive
1100-1110b = Reserved
1111b = Force boot from Floppy/primary removable media
```

With this in mind, splitting Boot device selector to `BootMode` and
`BootSource` seems to be redundant:


https://github.com/openbmc/phosphor-host-ipmid/blob/master/chassishandler.cpp
```
std::map<IpmiValue, Source::Sources> sourceIpmiToDbus = {
    {0x01, Source::Sources::Network},
    {0x02, Source::Sources::Disk},
    {0x05, Source::Sources::ExternalMedia},
    {0x0f, Source::Sources::RemovableMedia},
    {ipmiDefault, Source::Sources::Default}};

std::map<IpmiValue, Mode::Modes> modeIpmiToDbus = {
#ifdef ENABLE_BOOT_FLAG_SAFE_MODE_SUPPORT
    {0x03, Mode::Modes::Safe},
#endif // ENABLE_BOOT_SAFE_MODE_SUPPORT
    {0x06, Mode::Modes::Setup},
    {ipmiDefault, Mode::Modes::Regular}};
```

And the main question is, what is the best way to add `BIOS boot type`
option functionality to the current design?
Currently `phosphor-host-ipmid` lacks support for the IPMI BIOS boot type field:

```
[5] - BIOS boot type (for BIOS that support both legacy and EFI boots)
0b = “PC compatible” boot (legacy)
1b = Extensible Firmware Interface Boot (EFI)
```

Because of this it is not possible to select EFI or Legacy boot with
the ipmitool. `phosphor-host-ipmid` always reports BIOS boot type flag
as "Legacy". And this could lead to problems in the HOST firmware that
expects this feature to be working in the BMC.

```
~$ ipmitool -U root -P 0penBmc -H 192.168.101.221 -I lanplus -C 17
chassis bootdev none options=efiboot
Set Boot Device to none
~$ ipmitool -U root -P 0penBmc -H 192.168.101.221 -I lanplus -C 17
chassis bootparam get 5
Boot parameter version: 1
Boot parameter 5 is valid/unlocked
Boot parameter data: 8000000000
 Boot Flags :
   - Boot Flag Valid
   - Options apply to only next boot
   - BIOS PC Compatible (legacy) boot
   - Boot Device Selector : No override
   - Console Redirection control : System Default
   - BIOS verbosity : Console redirection occurs per BIOS
configuration setting (default)
   - BIOS Mux Control Override : BIOS uses recommended setting of the
mux at the end of POST
```

What is the best way to add support for this kind of functionality?
Should I add another phosphor-dbus-interface, something like
`/xyz/openbmc_project/Control/Boot/Type.interface.yaml`?
I guess I just want to know OpenBMC community opinion regarding this
problem before I start working on the solution.

Best regards,
Konstantin Aladyshev

                 reply	other threads:[~2021-02-08 19:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACSj6VW38ctPRF7VeOnm7CB39QtFyK0SAMtggm9uZxU3JHU4QQ@mail.gmail.com \
    --to=aladyshev22@gmail.com \
    --cc=openbmc@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).