Issue fixes for MinnowBoard Turbot 0.9.0-rc2
@miczyg1 I have:
- added get_ilb_bar() for reading ILB_BAR from PCI config registers here
- switched to using get_spi_bar() and get_ilb_bar() here
- switched to using the BIOS_CNTL define here
- added checking and toggling SMM BWP to the SMMSTORE handler here
This partially works - I can boot to setup menu, turn on SMM BWP, reboot into DTS and observe that:
bash-5.2# flashrom -p internal
flashrom v1.2-1037-g5b4a5b4 on Linux 6.6.21-yocto-standard (x86_64)
flashrom is free software, get the source code at https://flashrom.org
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
coreboot table found at 0x79d6c000.
Found chipset "Intel Bay Trail".
Enabling flash write... Warning: BIOS region SMM protection is enabled! <-----
Warning: Setting BIOS Control at 0x0 from 0x2b to 0x09 failed.
New value is 0x2b.
SPI Configuration is locked down.
FREG0: Flash Descriptor region (0x00000000-0x00000fff) is read-write.
FREG1: BIOS region (0x00200000-0x007fffff) is read-write.
FREG2: Management Engine region (0x00001000-0x001fffff) is read-write.
OK.
and trying to erase the chip fails.
However, when I reboot the platform, not changing any settings, the coreboot log repeats the same error:
[SPEW ] Found variable with state 3f and GUID: 8be4df61-93ca-11d2-aa0d00e098032b8c
[SPEW ] Found variable with state 3f and GUID: 8be4df61-93ca-11d2-aa0d00e098032b8c
[DEBUG] ICH SPI: Data transaction error
[WARN ] SF: Failed to send read command 0x0b(0x216fd8, 0x3c): -1
and flashrom output after booting to DTS changes to this:
bash-5.2# flashrom -p internal
flashrom v1.2-1037-g5b4a5b4 on Linux 6.6.21-yocto-standard (x86_64)
flashrom is free software, get the source code at https://flashrom.org
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
coreboot table found at 0x79d6c000.
Found chipset "Intel Bay Trail".
Enabling flash write... Warning: Setting BIOS Control at 0x0 from 0x0b to 0x09 failed.
New value is 0x0b.
SPI Configuration is locked down.
FREG0: Flash Descriptor region (0x00000000-0x00000fff) is read-write.
FREG1: BIOS region (0x00200000-0x007fffff) is read-write.
FREG2: Management Engine region (0x00001000-0x001fffff) is read-write.
PR0: Warning: 0x002d0000-0x007fffff is read-only.
Which looks like bios lock enabled and SMM BWP disabled, opposite of what's set in setup menu. I would really appreciate a suggestion on where to go with this.
BTW reworking the spi_set_smm_only_flashing function to make it more generic and have less overdub in the Silvermont #if.
I have cherry-picked the necessary fixes to : https://github.com/Dasharo/coreboot/pull/542
SMM_BWP is still having problems, so not including it in the release for now. CLosign this PR, but leaving the branch if we would like to go back to SMM_BWP eventually