Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nv41/ns50 : How to update EC firmware #1639

Open
tlaurion opened this issue Apr 16, 2024 · 7 comments
Open

nv41/ns50 : How to update EC firmware #1639

tlaurion opened this issue Apr 16, 2024 · 7 comments

Comments

@tlaurion
Copy link
Collaborator

tlaurion commented Apr 16, 2024

Edit: how to update EC to be in sync with firmware version?

flashrom needs to support ite_ec programmer to be able to flash ec firmware internally on nv41 edit: flashrom only supports proprietary protocol to talk to EC prior of switching to open source version. This strategy wouldn't work. Clarified in next comments. Firmware will contain EC and coreboot will sync EC to its contained version.

To be followed :
#1639 (comment)

SRC: https://docs.dasharo.com/unified/novacustom/initial-deployment/#installing-dasharo

@tlaurion
Copy link
Collaborator Author

tlaurion commented Apr 16, 2024

If ideal goal forward is to be able to also flash EC firmware through fwupd, then

  • qubesos would also need to fork and provide their own flashrom outside of the one provided by fc37 under q4.2.1+
  • Heads firmware package upgrade (zip) will need to provide also ec firmware rom with checksum
    • not sure how to do that.
      • Is Heads supposed to also build EC firmare to provide it through firmware package (zip created at build time containing both heads firmware + ec firmware)?
        • If so, a board config will also need to keep track of EC firmware that matches what is expected from firmware
          • CI will need to build EC firmware which I guess should be module/ec_nv41, tracking commit as other module with Makefile based configure/build instruction.

First step is to have flashrom under heads able to talk to ec spi: this is ite_ec programmer support, not present under currently used flashrom versions.

@marmarek @pietrushnic am I missing something on the strategy level?

@macpijan
Copy link
Contributor

macpijan commented Apr 16, 2024

flashrom needs to support ite_ec programmer to be able to flash ec firmware internally on nv41
SRC: https://docs.dasharo.com/unified/novacustom/initial-deployment/#installing-dasharo

Unfortunately it is more convoluted. The flasrom ite_ec programer works with proprietary EC firmware only. So it allows us to transition from proprietary to open-source EC firmware. But from this point on, flashrom ite_ec plugin is pretty much useless unfortunately, as the system76ec we base on uses different update protocol than the proprietary one.

In order to update the open-sorce EC version, you need the system76_ectool which is in Rust and will probably occupy too much space when integrated into heads: https://github.com/Dasharo/ec/tree/master/tool/src

@macpijan
Copy link
Contributor

macpijan commented Apr 16, 2024

We have a bit different proposal from @mkopec here: Dasharo/coreboot#481

The EC firmware to be updated shall be stored in the coreboot binary. Then, the coreboot itself will sync (update) the firmware from main flash into EC flash. So no need for ite_ec or any other external tools, as the EC update protocol is implemented in coreboot, so that the coreboot and EC can be always in sync. This should work the same, regardless of the payload (heads or edk2).

@tlaurion tlaurion changed the title Have flashrom EC firmware flashing How to update EC firmware Apr 16, 2024
@tlaurion
Copy link
Collaborator Author

tlaurion commented Apr 16, 2024

Renamed issue on goal, not on its strategy

@tlaurion
Copy link
Collaborator Author

@macpijan needed under #1647

@fhvyhjriur
Copy link
Contributor

The topic here looks general about EC update. Is this also about thinkpad EC? There its known for people to realize at some point, that new OEM batteries are not really available and they need to patch the EC for the replacement battery they got.
Also there are issues if you have not updated the lenovo bios ever before and the outdated EC from the first lenovo bios releases is known to make problems with coreboot.
The most common way to make a thinkpad ready for flashing coreboot is this project here: https://github.com/hamishcoleman/thinkpad-ec
If you missed this step before flashing coreboot, in general you are stuck at reflashing the lenovo OEM bios file and then lock your SPI again. And then you have again to open up your device once again and redo everything or you have to learn how to remove the write protection in the OEM Lenovo image before writing it to the SPI and this is really terrible documented.

To be able to flash inside heads the EC of the Thinkpad would be some great improvement. If you for example decide ever later to use a x20 keyboard in a x30 Thinkpad you can just change the EC with heads.

@tlaurion tlaurion changed the title How to update EC firmware nv41/ns50 : How to update EC firmware May 5, 2024
@tlaurion
Copy link
Collaborator Author

tlaurion commented May 5, 2024

The topic here looks general about EC update. Is this also about thinkpad EC? There its known for people to realize at some point, that new OEM batteries are not really available and they need to patch the EC for the replacement battery they got.

Right. Unfortunately, this doesn't apply to Lenovo. I changed the title.

Also there are issues if you have not updated the lenovo bios ever before and the outdated EC from the first lenovo bios releases is known to make problems with coreboot.
The most common way to make a thinkpad ready for flashing coreboot is this project here: https://github.com/hamishcoleman/thinkpad-ec

1vyprep is another way to do this AFAIK. Should be in wiki.

If you missed this step before flashing coreboot, in general you are stuck at reflashing the lenovo OEM bios file and then lock your SPI again. And then you have again to open up your device once again and redo everything or you have to learn how to remove the write protection in the OEM Lenovo image before writing it to the SPI and this is really terrible documented.

To be able to flash inside heads the EC of the Thinkpad would be some great improvement. If you for example decide ever later to use a x20 keyboard in a x30 Thinkpad you can just change the EC with heads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants