Coreboot/OpenSIL Porting Underway for AMD FW16

This is pretty standard in coreboot, but isn’t perfect and has some issues.

Google uses VBOOT on their systems, it stores 3 copies of the firmware (RO, RW-A and RW-B). RO section is usually located in section of the flash chip that’s write-protected, and control over that pin is handled by CR50/Ti50 (H1 security chip).
It also uses TPM for measurment (you sign build with your keys and everything is checked before loading, providing a ROT that isn’t PSB or BootGuard).

This approach has issues, VBOOT doesn’t have stable ABI so if you flash coreboot 26.09 with VBOOT let’s say, and then you will want to flash 28.04 down the line, it will actually cause a brick.

Because of this, Google maintains their own fork of coreboot and backport upstream patches into their branch they tagged when device was released.

So while in theory it’s doable (I’m maintaining coreboot tree for large-scale industrial customer), you simply write new build with flashprog -p internal --fmap -i RW_SECTION_A -w build/coreboot.rom… but it won’t be that simple here.
PSP in these systems expect to find blobs at address 0x2000 (8KB) in the flash, plus I haven’t figured out ROM3 yet so only upper 16MB are currently usable.

Capsule updates from EDK2 are also mostly working from what I’ve been told, but I’m not tracking anything UEFI-related so I can’t comment on details.

On Intel side some people from 3mdeb and Tuxedo are experimenting with top-swap feature, I see that AMD has something similar (PSP A/B) but I haven’t looked at details yet. It would allow you to store two independent copies and overwrite one of them, having fallback recovery if anything goes wrong.

I find it a bit ironic that reliablity is still a problem in BIOS/UEFI world. This is why Gigabyte used to place two SPI chips on their boards and use custom feature in their ITE ECs to swap CS to a second chip if firmware hasn’t written an undocumented register over LPC to kill the “watchdog” within 3 seconds of asserting PS_ON.
Maybe they’re still doing that? Not sure, I haven’t been following the “enthusiast PC market” for over a decade now.

But… yes, coreboot is faaaaaar more reliable than UEFI regardless of the implementation (especially since I’m on the release team and test most platforms that we support before tagging the release). I haven’t had a single brick from simply doing an update in 5 years, on any systems I own/use on regular basis (~8 of them).

There are two aspects to unbrickable.

  1. The true unbrickable.
    I like that some mainboards have a feature where one can update the BIOS even with the CPU and RAM removed. You plug a USB stick into a USB port and turn on while pressing a micro-switch on the mainboard.
    This method needs the feature designed in at the hardware level.
  2. In field unbrickable.
    This is where the BIOS update is 100% reliable. It has two bios images and they use checksums and a watchdog to detect faulty BIOS.

ARM chips achieve this unbrickability by having a piece of ROM code that runs inside the ARM chip, that decides which image to boot based on how well it did last time. ARM boot options (chosen by dip switches) are:
a) Boot from RAM
b) Boot from Serial Port. (This is generally the unbrickable recovery method)
c) Boot from Image 1,2,3

When I ask AMD about making (b) work on AMD platforms, they spout some rubbish about security. There are secure ways of doing it, they just choose to ignore them. For example. ARM do it securely.

Not really. Most ARM64 platforms configure USB controller to accept (usually signed) payload if BootROM fails to load the next stage, or if user specifically requests it by pulling USB_BOOT GPIO low.
That’s how you can recover most smartphones even if you replace the UFS, but device manufacturers keep tooling needed to perform such recovery behind NDAs.
This is where (ironically enough) Apple is doing best, since DFU can be performed by anyone, as opposed to Qualcomm or MediaTek where you need signed firehose/preloader and 99.99% of vendors simply don’t publish it.

Intel also has this mechanism which started with Atom-based tablets, but nobody implements DnX in the field (maybe with exception of edge/embedded i.e cars).

Turns out that dGPU mostly just worked, had to change DGPU_PWR_EN to active-high (for some reason I thought it was active-low before).
However, default ReBAR bits in coreboot are 29, which doesn’t give us enough memory:

[WARN ]  Device PCI: 00:03:00.0 requests a BAR with 33 bits of address space, which coreboot is not configured to hand out, truncating to 29 bits
[INFO ]  PCI: 00:03:00.0: Adjusting resource index 16: base: 0 size: 20000000 align: 29 gran: 29 limit: ffffffffffffffff
[INFO ]  PCI: 00:03:00.0: Adjusting resource index 24: base: 0 size: 10000000 align: 28 gran: 28 limit: ffffffffffffffff

After adjusting it to 33, we get dGPU up in running, with 8GB of BAR space so we’re getting full performance:

I know Nvidia GPUs require even more, could someone running an RTX 5070 module post output from their lspci -vvvnnnxxx?
It would be nice to add default config for this into board’s Kconfig :wink:

Here’s the relevant section of the output from mine (RTX 5070 12GB). Booted into a Linux Mint live system to get this because I only have Windows installed. Hope it helps; if it doesn’t, let me know what would help and I’ll try to get it.

That’s fine, thank you. We need 34 bits of space for this card, so I might as well allocate a bit more (36). Should be fine :slight_smile:

Just chiming in to say, holy cow you guys are doing amazing work, reading all the comments from the past make me hopeful that id be able to get my 16 flashed sometime in the future, if there’s a way I can jump in to help (sans coding) I would love to!
P.S. what are the chances we could get intel’s wifi 7 chips supported vs the current stock firmware? since the last time ive seen AMD has yet to support those chips on our boards

I think this issue is potentially intel doing something non-standard, so may not be AMD’S problem

Thank you :smiley:
If you mean Intel BE200, they’re a bit hard to get I think?

When I was working on PantherLake last year we were supposed to receive one for testing but it never happened, currently starting to work on NovaLake and CRB did not come with WiFi card either. Not entirely sure why.

Looking at the datasheet I don’t see a reason why it wouldn’t work (even on stock firmware) as it uses PCIe (instead of CNVi). It might require some new ACPI tables for power management (i.e. I stuck an AX201 into a 2015 15iin MBP and stock firmware couldn’t handle suspend/resume due to missing tables, though porting coreboot to that system is on a very long “TODO” list) but that wouldn’t be a problem, probably 30 minutes to an hour of work.

I’ve had luck getting them from mouser when I was trying to get them, but they definitely didn’t play nice with AMD systems. Ive only experienced it hanging during POST whenever I tried to use it, and nothing I did managed to get it past that point.

I had a conversation with AMD about the Intel BE2xx wifi cards and their incompatibility with AMD.
The general gist of the answer is AMD won’t look at the problem unless Intel lean in also, so that it is a combined effort to get it to work.
Currently, Intel are not interested.

Note. I also approached Intel about it, and can confirm that they are not interested.

That makes me curious: Who, or which BU?
Regardless, this piqued my interest and so asked my boyfriend to order one from alternate (since it’s cheaper than amazon and he’s got an account). Will pick it up and try later this week

And, yet again, a community volunteer walks the path the corporates refuse to tread

Are they? I got one pretty easily when they initially came out from mouser.

Would be interresting to have someone with deeper access/knowledge to the firmware have a look at it since the way it fails (on some amd platforms) is pretty interesting.

If plugged in at boot it won’t even post and if it is plugged in later (via usb4 hotplug) it insta crashes the machine without any logs (the case on my intel tb3 based egpu board) or just doesn’t show up at all (the case on my intel tb5 based egpu board).

I suspect it does something weird on the pcie bus that either confuses the amd firmware or something like trying to access something it isn’t allowed to.

Other people have done pretty detailed investigations into the BE200.
If @ellyqw has extra documentation via NDA, she might get further.
My theory is that something goes wrong during PCIe link training.
Hopefully the extra documentation can point to gaining some information about the PCIe training registers and maybe find out why it goes wrong.
The AMD CPU will crash and reboot if it sees too many AER errors.

Note: Even with full NDA documentation, there will be errors in it. For example i found a way to force reboot the amd laptop via a usb port that did not match up with AMDs knowledge of their own chips.

Mouser is where I got my modules from, I did try to toss one in but it didn’t play nice so I eventually just gave it to my friend who needed a module for WiFi in general

If there’s other people who would also like to take a look into it, I’d be more then happy to seed some hardware since as far as Intel’s site says the BE201 is the only CNVio3 card, the BE 200 and BE202 are PCIE.

This isn’t excluding the fact that Intel’s R2 WiFi cards have been released, but they are currently CNVio3 as well…

Can you point me to some of them, I had been following that topic for a while but have not seen anything I would call “detailed investigation”.

Pretty sure the tb case would indicate against that as the pcie link training would be between the tb chipset and not the laptop.

As far as I can tell the be200 does not cause reboots/resets but just halts.

Implemented runtime bifurfication today:

[INFO ]  [Bifurfication] EC GPU_CONTROL reports 0x80 (config 2)
[INFO ]  [Bifurfication] Configuring expansion bay as 2x4

root@frame:/home/elly# lspci -vvvnnnt | grep SSD
           +-01.1-[01]----00.0  KIOXIA Corporation NVMe SSD Controller BG4 (DRAM-less) [1e0f:0001]
           +-01.2-[02]----00.0  Kingston Technology Company, Inc. OM3PDP3 PCIe 3 NVMe SSD (DRAM-less) [2646:500d]
           +-01.4-[03]----00.0  Kingston Technology Company, Inc. KC3000/FURY Renegade NVMe SSD [E18] [2646:5013]
           +-02.4-[04]----00.0  Kingston Technology Company, Inc. NV2 NVMe SSD [SM2267XT] (DRAM-less) [2646:5017]
[INFO ]  [Bifurfication] EC GPU_CONTROL reports 0x08 (config 0)
[INFO ]  [Bifurfication] Configuring expansion bay as 1x8

root@frame:/home/elly# lspci -vvvnnnt | grep RX
           +-01.1-[01-03]----00.0-[02-03]----00.0-[03]--+-00.0  Advanced Micro Devices, Inc. [AMD/ATI] Navi 33 [Radeon RX 7600/7600 XT/7600M XT/7600S/7700S / PRO W7600] [1002:7480]

Of course all SSDs run at x4 speed, and GPU at x8 so that’s done :ok_hand:

Tested BE200: It does indeed hang the system, but very late. I can already see the screen being initialized by my WIP driver which means it already returns from OpenSIL and coreboot enables devices.
Will look into it a bit more once i hook-up UART again.

The other thread that looked at BE200 and BE202.