Attention is currently required from: Anastasia Klimchuk, Nikolai Artemiev, Stefan Reinauer.
Michael Heimpold has posted comments on this change by Michael Heimpold. ( https://review.coreboot.org/c/flashrom/+/82715?usp=email )
Change subject: flashchips: add support for chip model Winbond W25Q16JV_M
......................................................................
Patch Set 2:
(3 comments)
Patchset:
PS2:
Thanks for your review. I've adapted the patch accordingly.
File flashchips.c:
https://review.coreboot.org/c/flashrom/+/82715/comment/bbbbddc2_70cf1baa?us… :
PS1, Line 19297: FEATURE_WRSR_EXT2 |
> You need to remove this feature bit, it's not needed. […]
Done
https://review.coreboot.org/c/flashrom/+/82715/comment/67bdcf1e_8c5c818d?us… :
PS1, Line 19320: SPI_PRETTYPRINT_STATUS_REGISTER_BP3_SRWD
> I think this function is better for this chip, it will print more details: […]
Done
--
To view, visit https://review.coreboot.org/c/flashrom/+/82715?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ida1ceb5fe31411bef647e5133c5bd0bdb02d7704
Gerrit-Change-Number: 82715
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Heimpold <mhei(a)heimpold.de>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Comment-Date: Fri, 07 Jun 2024 19:39:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: Michael Heimpold, Nikolai Artemiev, Stefan Reinauer.
Hello Anastasia Klimchuk, Nikolai Artemiev, Stefan Reinauer, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/82715?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by build bot (Jenkins)
Change subject: flashchips: add support for chip model Winbond W25Q16JV_M
......................................................................
flashchips: add support for chip model Winbond W25Q16JV_M
This is a 2 MiB model with QE=0 factory setting.
Tested with ch341a programmer: probe, read, write, erase
Link to datasheet:
https://www.winbond.com/resource-files/w25q16jv%20spi%20revh%2004082019%20p…
Change-Id: Ida1ceb5fe31411bef647e5133c5bd0bdb02d7704
Signed-off-by: Michael Heimpold <mhei(a)heimpold.de>
---
M flashchips.c
M include/flashchips.h
2 files changed, 53 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/15/82715/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/82715?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ida1ceb5fe31411bef647e5133c5bd0bdb02d7704
Gerrit-Change-Number: 82715
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Heimpold <mhei(a)heimpold.de>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Michael Heimpold <mhei(a)heimpold.de>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Attention is currently required from: Anastasia Klimchuk, Hsuan Ting Chen, Thomas Heijligen.
Hsuan-ting Chen has posted comments on this change by Hsuan-ting Chen. ( https://review.coreboot.org/c/flashrom/+/82908?usp=email )
Change subject: how_to_add_new_chip: Add a section for feature bits and WRSR handling
......................................................................
Patch Set 1:
(1 comment)
File doc/contrib_howtos/how_to_add_new_chip.rst:
https://review.coreboot.org/c/flashrom/+/82908/comment/e28d2514_615354ec?us… :
PS1, Line 110:
: Write-Status-Register (WRSR) Handling
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:
: ``FEATURE_WRSR_EWSR``, ``FEATURE_WRSR_WREN``, and ``FEATURE_WRSR_EITHER``. These bits used for **SPI only**.
:
: The Write Status Register (WRSR) is used to configure various settings within the flash chip, including write protection and
: other features. The way WRSR is accessed varies between SPI flash chips, leading to the need for these feature bits.
:
: * ``FEATURE_WRSR_EWSR``:
: This indicates that we need an **Enable-Write-Status-Register** (EWSR) instruction which opens the status register for the
: immediately-followed next WRSR instruction. Usually, the opcode is **0x50**.
:
: * ``FEATURE_WRSR_WREN``:
: This indicates that we need an **Write-Enable** (WREN) instruction to set the Write Enable Latch (WEL) bit. The WEL bit
: must be set priort to every WRSR command. Usually, the opcode is **0x06**.
:
: * ``FEATURE_WRSR_EITHER``:
: This indicates that either EWSR or WREN is supported in this chip.
> Maybe move this section to "Write-protection" , below? You can skip the intro, and rename the sectio […]
Hi Anastasia:
Thanks for the review!
1. We had an in-depth discussion while adding [GD25LQ255E](https://review.coreboot.org/c/flashrom/+/79088/comment/a8af90df… where it took us some time to grasp the meaning of `FEATURE_WRSR_EXT2` and `FEATURE_WRSR2`. Given that, I thought it might be better to find a dedicated place to explain all the feature bits in detail.
2. The next steps would involve adding more explanations of other feature bits to this section gradually. If you think it's a good idea, I can create a post on the flashrom mailing list or bug tracker to initiate a broader discussion on this.
3. One alternative I considered is to add the notes directly to `include/flash.h`, as the original documentation mentions that available options can be found there. However, this might make the file excessively long.
4. Going back to point 2, my ultimate goal is to explain "all" the feature bits. I believe a separate section would provide better clarity than placing this information under the write-protection section. What are your thoughts?
--
To view, visit https://review.coreboot.org/c/flashrom/+/82908?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I34c20933a375380c8702f79ac637595cd3466000
Gerrit-Change-Number: 82908
Gerrit-PatchSet: 1
Gerrit-Owner: Hsuan-ting Chen <roccochen(a)google.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Hsuan Ting Chen <roccochen(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Hsuan Ting Chen <roccochen(a)chromium.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Fri, 07 Jun 2024 07:19:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: Hsuan Ting Chen, Hsuan-ting Chen, Thomas Heijligen.
Anastasia Klimchuk has posted comments on this change by Hsuan-ting Chen. ( https://review.coreboot.org/c/flashrom/+/82908?usp=email )
Change subject: how_to_add_new_chip: Add a section for feature bits and WRSR handling
......................................................................
Patch Set 1:
(5 comments)
File doc/contrib_howtos/how_to_add_new_chip.rst:
https://review.coreboot.org/c/flashrom/+/82908/comment/7f6a0db4_04132885?us… :
PS1, Line 120: This
Delete "This", start with "Indicates that"
https://review.coreboot.org/c/flashrom/+/82908/comment/ef389f53_43080cbc?us… :
PS1, Line 124: This
same
https://review.coreboot.org/c/flashrom/+/82908/comment/45eb2bae_f380d8b3?us… :
PS1, Line 125: priort
typo, prior
https://review.coreboot.org/c/flashrom/+/82908/comment/9268e6e7_9f208fca?us… :
PS1, Line 110:
: Write-Status-Register (WRSR) Handling
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:
: ``FEATURE_WRSR_EWSR``, ``FEATURE_WRSR_WREN``, and ``FEATURE_WRSR_EITHER``. These bits used for **SPI only**.
:
: The Write Status Register (WRSR) is used to configure various settings within the flash chip, including write protection and
: other features. The way WRSR is accessed varies between SPI flash chips, leading to the need for these feature bits.
:
: * ``FEATURE_WRSR_EWSR``:
: This indicates that we need an **Enable-Write-Status-Register** (EWSR) instruction which opens the status register for the
: immediately-followed next WRSR instruction. Usually, the opcode is **0x50**.
:
: * ``FEATURE_WRSR_WREN``:
: This indicates that we need an **Write-Enable** (WREN) instruction to set the Write Enable Latch (WEL) bit. The WEL bit
: must be set priort to every WRSR command. Usually, the opcode is **0x06**.
:
: * ``FEATURE_WRSR_EITHER``:
: This indicates that either EWSR or WREN is supported in this chip.
Maybe move this section to "Write-protection" , below? You can skip the intro, and rename the section as "Feature bits for Write-Status-Register (WRSR) Handling".
You mentioned you have further plans to update the doc, maybe you can tell me the plan? Then we can come up with a doc structure which aligns with you next plans!
https://review.coreboot.org/c/flashrom/+/82908/comment/96f001fb_342587b0?us… :
PS1, Line 128: This
same
--
To view, visit https://review.coreboot.org/c/flashrom/+/82908?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I34c20933a375380c8702f79ac637595cd3466000
Gerrit-Change-Number: 82908
Gerrit-PatchSet: 1
Gerrit-Owner: Hsuan-ting Chen <roccochen(a)google.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Hsuan Ting Chen <roccochen(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Hsuan Ting Chen <roccochen(a)chromium.org>
Gerrit-Attention: Hsuan-ting Chen <roccochen(a)google.com>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Comment-Date: Fri, 07 Jun 2024 06:30:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: DZ, Nikolai Artemiev, Stefan Reinauer.
Anastasia Klimchuk has posted comments on this change by DZ. ( https://review.coreboot.org/c/flashrom/+/82777?usp=email )
Change subject: flashchips: Add support for MXIC MX25U25645G
......................................................................
Patch Set 1:
(3 comments)
File flashchips.c:
https://review.coreboot.org/c/flashrom/+/82777/comment/578e93b9_f67537ab?us… :
PS1, Line 11104: 512B
Datasheet says `8K-bit secured OTP` so I think this is 1024B
https://review.coreboot.org/c/flashrom/+/82777/comment/534bf2b2_4d87f9b0?us… :
PS1, Line 11111: {
: .eraseblocks = { {4 * 1024, 8192} },
: .block_erase = SPI_BLOCK_ERASE_21,
: },
I don't see it in datasheet (I mean: 21h, 5Ch, DCh)? I see there is:
20h for 4K
52h for 32K
D8h for 64K
60h or C7h for chip erase
I am looking at sections 10-24 and to 10-27 which describe erase commands?
https://review.coreboot.org/c/flashrom/+/82777/comment/05089391_e1ed2a9e?us… :
PS1, Line 11137: /* TODO: security register */
You can remove TODO, you added security register bits below
--
To view, visit https://review.coreboot.org/c/flashrom/+/82777?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I8641f36e1909274629690fc243be46281a21360d
Gerrit-Change-Number: 82777
Gerrit-PatchSet: 1
Gerrit-Owner: DZ <danielzhang(a)mxic.com.cn>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: DZ <danielzhang(a)mxic.com.cn>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Comment-Date: Fri, 07 Jun 2024 05:31:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: Bora Guvendik, DZ, Nikolai Artemiev, Stefan Reinauer.
Anastasia Klimchuk has posted comments on this change by Bora Guvendik. ( https://review.coreboot.org/c/flashrom/+/82626?usp=email )
Change subject: flashchips: add support for MX77U51250F chip
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS3:
> Hi Anastasia, I think you need to request datasheet from Macronix, it is not available on their site […]
I see. I will try!
Do you have datasheet yourself (to get the values for chip definition)? And since you marked as tested, I understand you also have the chip?
--
To view, visit https://review.coreboot.org/c/flashrom/+/82626?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I2c2e94f01dc63f60cf636bc6afe1f033e2a6f83c
Gerrit-Change-Number: 82626
Gerrit-PatchSet: 3
Gerrit-Owner: Bora Guvendik <bora.guvendik(a)intel.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: DZ <danielzhang(a)mxic.com.cn>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Bora Guvendik <bora.guvendik(a)intel.com>
Gerrit-Attention: DZ <danielzhang(a)mxic.com.cn>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Comment-Date: Fri, 07 Jun 2024 04:54:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Bora Guvendik <bora.guvendik(a)intel.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: Aarya, Alexander Goncharov.
Peter Marheine has posted comments on this change by Peter Marheine. ( https://review.coreboot.org/c/flashrom/+/82393?usp=email )
Change subject: erasure_layout: Fix get_flash_region bug
......................................................................
Patch Set 17: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/82393?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ic5bf9d0f0e4a94c48d6f6e74e3cb9cccdc7adec9
Gerrit-Change-Number: 82393
Gerrit-PatchSet: 17
Gerrit-Owner: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Attention: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Comment-Date: Fri, 07 Jun 2024 03:49:20 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/82649?usp=email )
Change subject: doc: Convert ME and Intel docs
......................................................................
doc: Convert ME and Intel docs
ME page existed on wiki here https://wiki.flashrom.org/ME
The contents are mostly unchanged, but one broken kernel link is
removed from Intel doc.
Change-Id: I79af5674f3af9ca880e89becd6a272a2cf8ed599
Signed-off-by: Anastasia Klimchuk <aklm(a)flashrom.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/82649
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: David Hendricks <david.hendricks(a)gmail.com>
---
D Documentation/mysteries_intel.txt
M doc/user_docs/index.rst
A doc/user_docs/management_engine.rst
A doc/user_docs/misc_intel.rst
4 files changed, 252 insertions(+), 173 deletions(-)
Approvals:
build bot (Jenkins): Verified
David Hendricks: Looks good to me, approved
diff --git a/Documentation/mysteries_intel.txt b/Documentation/mysteries_intel.txt
deleted file mode 100644
index 088abb8..0000000
--- a/Documentation/mysteries_intel.txt
+++ /dev/null
@@ -1,173 +0,0 @@
-= BBAR on ICH8 =
- There is no sign of BBAR (BIOS Base Address Configuration Register) in the
- public datasheet (or specification update) of the ICH8. Also, the offset of
- that register has changed between ICH7 (SPIBAR + 50h) and ICH9 (SPIBAR +
- A0h), so we have no clue if or where it is on ICH8. Out current policy is to
- not touch it at all and assume/hope it is 0.
-
-= Software Sequencing vs. Hardware Sequencing and the "Opaque flash chip" =
-Software sequencing and hardware sequencing are two methods used to interface
-with the SPI controller on Intel platforms. They can be selected using either
-ich_spi_mode=swseq or ich_spi_mode=hwseq programmer parameters. Flashrom will
-attempt to automatically detect which mode to use.
-
-Software sequencing is the traditional method whereby software running on the
-CPU handles most of the logic needed to interact with the flash chip. This
-offers good flexibility since the user can utilize any opcode available in the
-OPMENU registers, and OPMENU can be left unlocked or on coreboot-supported
-platforms the owner of the system may program it for their needs before locking
-it. Advanced or non-standard features of a chip such as write protection and
-OTP may therefore be directly utilized by software.
-
-Hardware sequencing is a newer method (since around 2011) whereby most of the
-logic for interacting with the SPI flash chip is contained within the SPI
-controller itself and software such as flashrom may only select a few operations
-chosen by Intel via the Flash Cycle (FCYCLE) field. The chip must conform to
-specifications from Intel for each chipset/PCH. The specs are given in the
-"SPI Programming Guide" application note. See [SPI_PROG] cited at the bottom of
-this document for an example.
-
-Hardware sequencing simplifies things from a software perspective since the
-software is guaranteed some minimal level of support and doesn't even need to
-know the chip's ID or opcodes; it just needs to tell the SPI controller to
-perform a type of transaction such as "read", "4k block erase", etc. Hence when
-using hardware sequencing one will see "Opaque flash chip" as the chip's
-description since software might not be able to identify the chip. The SPI
-controller can combine multiple physical flash chips to logically appear as a
-single large flash device, and in such cases it would not make sense for
-flashrom to try to identify the chip.
-
-In many non-Intel systems the software has full control of a generic SPI
-controller where the software controls the SPI signals and also constructs the
-data payload including pre-op (e.g. write enable latch), opcode, address, and
-data. Intel SPI flash controllers are purpose-built for flash chip access and
-the software does not control the hardware directly. This makes Intel SPI
-controllers less flexible from a software standpoint, however there are some
-benefits such as guaranteed atomicity and multi-master arbitration needed for
-modern Intel platforms where the CPU and various microprocessors can share the
-same flash chip.
-
-= SMM BIOS Write Protection =
-Sometimes a hardware vendor will enable "SMM BIOS Write Protect" (SMM_BWP)
-in the firmware during boot time. The bits that control SMM_BWP are in the
-BIOS_CNTL register in the LPC interface.
-
-When enabled, the SPI flash can only be written when the system is operating in
-in System Management Mode (SMM). In other words, only certain code that was
-installed by the BIOS can write to the flash chip. Programs that run in OS
-context such as flashrom can still read the flash chip, but cannot write to the
-flash chip.
-
-Flashrom will attempt to detect this and print a warning such as the following:
-"Warning: BIOS region SMM protection is enabled!"
-
-Many vendor-supplied firmware update utilities do not actually write to the ROM;
-instead they transfer data to/from memory which is read/written by a routine
-running in SMM and is responsible for writing to the firmware ROM. This causes
-severe system performance degradataion since all processors must be in SMM
-context (ring -2) instead of OS context (ring 0) while the firmware ROM is being
-written.
-
-= Accesses beyond region bounds in descriptor mode =
- Intel's flash image tool will always expand the last region so that it covers
- the whole flash chip, but some boards ship with a different configuration.
- It seems that in descriptor mode all addresses outside the used regions can not
- be accessed whatsoever. This is not specified anywhere publicly as far as we
- could tell. flashrom does not handle this explicitly yet. It will just fail
- when trying to touch an address outside of any region.
- See also http://www.flashrom.org/pipermail/flashrom/2011-August/007606.html
-
-= (Un)locking the ME region =
- If the ME region is locked by the FRAP register in descriptor mode, the host
- software is not allowed to read or write any address inside that region.
- Although the chipset datasheets specify that "[t]he contents of this register
- are that of the Flash Descriptor" [PANTHER], this is not entirely true.
- The firmware has to fill at least some of the registers involved. It is not
- known when they become read-only or any other details, but there is at least
- one HM67-based board, that provides an user-changeable setting in the firmware
- user interface to enable ME region updates that lead to a FRAP content that is
- not equal to the descriptor region bits [NC9B].
-
- There are different ways to unlock access:
-
- - A pin strap: Flash Descriptor Security Override Strap (as indicated by the
- Flash Descriptor Override Pin Strap Status (FDOPSS) in HSFS. That pin is
- probably not accessible to end users on consumer boards (every Intel doc i
- have seen stresses that this is for debugging in manufacturing only and
- should not be available for end users).
- The ME indicates this in bits [19:16] (Operation Mode) in the HFS register of
- the HECI/MEI PCI device by setting them to 4 (SECOVR_JMPR) [MODE_CTRL].
-
- - Intel Management Engine BIOS Extension (MEBx) Disable
- This option may be available to end users on some boards usually accessible
- by hitting ctrl+p after BIOS POST. Quote: "'Disabling' the Intel ME does not
- really disable it: it causes the Intel ME code to be halted at an early stage
- of the Intel ME's booting so that the system has no traffic originating from
- the Intel ME on any of the buses." [MEBX] The ME indicates this in
- bits [19:16] (Operation Mode) in the HFS register of the HECI/MEI PCI device
- by setting them to 3 (Soft Temporary Disable) [MODE_CTRL].
-
- - Previous to Ibex Peak/5 Series chipsets removing the DIMM from slot (or
- channel?) #0 disables the ME completely, which may give the host access to
- the ME region.
-
- - HMRFPO (Host ME Region Flash Protection Override) Enable MEI command
- This is the most interesting one because it allows to temporarily disable
- the ME region protection by software. The ME indicates this in bits [19:16]
- (Operation Mode) in the HFS register of the HECI/MEI PCI device by setting
- them to 5 (SECOVER_MEI_MSG) [MODE_CTRL].
-
-== MEI/HECI ==
- Communication between the host software and the different services provided by
- the ME is done via a packet-based protocol that uses MMIO transfers to one or
- more virtual PCI devices. Upon this layer there exist various services that can
- be used to read out hardware management values (e.g. temperatures, fan speeds
- etc.). The lower levels of that protocol are well documented:
- The locations/offsets of the PCI MMIO registers are noted in the chipset
- datasheets. The actually communication is documented in a whitepaper [DCMI] and
- an outdated as well as a current Linux kernel implementation (currently in
- staging/ exist [KERNEL]. There exists a patch that re-implements this in user
- space (as part of flashrom).
-
-== Problems ==
- The problem is that only very few higher level protocols are documented publicly,
- especially the bunch of messages that contain the HMRFPO commands is probably
- well protected and only documented in ME-specific docs and the BIOS writer's
- guides. We are aware of a few leaked documents though that give us a few hints
- about it, but nothing substantial regarding its implementation.
-
- The documents are somewhat contradicting each other in various points which
- might be due to factual changes in process of time or due to the different
- capabilities of the ME firmwares, example:
-
- Intel's Flash Programming Tool (FPT) "automatically stops ME writing to SPI
- ME Region, to prevent both writing at the same time, causing data corruption." [ME8]
-
- "FPT is not HMRFPO-capable, so needs [the help of the FDOPS pin] HDA_SDO if
- used to update the ME Region." [SPS]
-
- When looking at the various ME firmware editions (and different chipsets), things
- get very unclear. Some docs say that HMRFPO needs to be sent before End-of-POST
- (EOP), others say that the ME region can be updated in the field or that some
- vendor tools use it for updates. This needs to be investigated further before
- drawing any conclusion.
-
-[PANTHER] Intel 7 Series Chipset Family Platform Controller Hub (PCH) Datasheet
- Document Number: 326776, April 2012, page 857
-[NC9B] Jetway NC9B flashrom v0.9.5.2-r1517 log with ME region unlocked.
- NB: "FRAP 0e0f" vs. "FLMSTR1 0a0b".
- http://paste.flashrom.org/view.php?id=1215
-[MODE_CTRL] Client Platform Enabling Tour: Platform Software
- Document Number: 439167, Revision 1.2, page 52
-[MEBX] Intel Management Engine BIOS Extension (MEBX) User's Guide
- Revision 1.2, Section 3.1 and 3.5
-[DCMI] DCMI Host Interface Specification
- Revision 1.0
-[KERNEL] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=tree;f=d…
-[SPI_PROG] Ibex Peak SPI Programming Guide
- Document Number: 403598, Revision 1.3, page 79
-[ME8] Manufacturing with Intel Management Engine (ME) Firmware 8.X on Intel 7 Series
- Revision 2.0, page 59
-[SPS] Manufacturing with Intel Management Engine (ME) on Intel C600 Series Chipset 1
- for Romley Server 2 Platforms using Server Platform Services (SPS) Firmware
- Revision 2.2, page 51
diff --git a/doc/user_docs/index.rst b/doc/user_docs/index.rst
index 5bc93d1..b61567a 100644
--- a/doc/user_docs/index.rst
+++ b/doc/user_docs/index.rst
@@ -7,3 +7,5 @@
fw_updates_vs_spi_wp
example_partial_wp
chromebooks
+ management_engine
+ misc_intel
diff --git a/doc/user_docs/management_engine.rst b/doc/user_docs/management_engine.rst
new file mode 100644
index 0000000..f1cf3fc
--- /dev/null
+++ b/doc/user_docs/management_engine.rst
@@ -0,0 +1,45 @@
+======================
+ME (Management Engine)
+======================
+
+ME stands for Management Engine (or Manageability Engine) and refers to an Embedded Controller found in Intel chipsets. It uses different versions
+of an `ARC <http://en.wikipedia.org/wiki/ARC_International>`_ 32-bit microcontroller that runs its own operating system independently from the user's.
+The ME has access to all kinds of buses which allows for out-of-band processing which is used for features
+like `Active Management Technology <http://en.wikipedia.org/wiki/Intel_Active_Management_Technology>`_, but it makes it also a very interesting target for black hats.
+The firmware it runs is secured by certificates stored in ROM, but it is a complex beast and it is very unlikely that there is
+no `way around its security measures <http://invisiblethingslab.com/resources/misc09/Quest%20To%20The%20Core%20(p…>`_ (intentional backdoors included).
+For further details about the ME please see these excellent `slides by Igor Skochinsky <http://2012.ruxconbreakpoint.com/assets/Uploads/bpx/Breakpoint%202012%20Sko…>`_
+and the `Security Evaluation of AMT by Vassilios Ververis <http://web.it.kth.se/~maguire/DEGREE-PROJECT-REPORTS/100402-Vassilios_Verve…>`_.
+
+Effects on flashrom
+===================
+
+The firmware of the ME usually shares the flash memory with the firmware of the host PC (BIOS/UEFI/coreboot).
+The address space is separated into regions (similar to partitions on a harddisk). The first one (*Descriptor region*)
+contains configuration data which contains something similar to a partition table and access rights for the different devices that can access the flash
+(host CPU, ME, GbE controller). These restrictions are enforced by the chipset's SPI controller which is the main interface for flashrom
+to access the flash chip(s) attached to the chipset. Intel recommends to set the descriptor region read-only and to forbid reads and writes to the ME region by the host CPU.
+Writes by the host could interfere with the code running on the ME. This means that flashrom which runs on the host PC can not access
+the ME firmware region of the flash at all in this configuration. flashrom detects that, warns the user and disables write access for safety reasons in that case.
+
+Unlocking the ME region
+=======================
+
+There are a few ways to enable full access to the ME region, but they are not user friendly at all in general. Also, the Descriptor region is not affected by these actions,
+so it is still not possible to access the complete flash memory even when the ME region is unlocked. For the different possibilities please see
+the document :doc:`misc_intel`.
+
+Suggested workarounds
+=====================
+
+ * If you just want to update the proprietary firmware of the board use the vendor tool(s).
+ * If you need full access to the flash chip get an external programmer (see :doc:`/supported_hw/supported_prog/index`) and try in-circuit programming.
+ * If you only need to update the BIOS region, then you may use the options ``--ifd -i bios --noverify-all`` to write (and verify) only the BIOS region as described in the Intel flash descriptor.
+
+.. todo:: Migrate page for in-circuit programming (ISP)
+
+See also
+========
+
+ * The respective `coreboot page on the management engine <http://www.coreboot.org/Intel_Management_Engine>`_
+ * :doc:`misc_intel`
diff --git a/doc/user_docs/misc_intel.rst b/doc/user_docs/misc_intel.rst
new file mode 100644
index 0000000..dca535e
--- /dev/null
+++ b/doc/user_docs/misc_intel.rst
@@ -0,0 +1,205 @@
+========================
+Miscellaneous Intel info
+========================
+
+BBAR on ICH8
+============
+
+There is no sign of BBAR (BIOS Base Address Configuration Register) in the
+public datasheet (or specification update) of the ICH8. Also, the offset of
+that register has changed between ICH7 (SPIBAR + 50h) and ICH9 (SPIBAR +
+A0h), so we have no clue if or where it is on ICH8. Out current policy is to
+not touch it at all and assume/hope it is 0.
+
+Software Sequencing vs. Hardware Sequencing and the "Opaque flash chip"
+=======================================================================
+
+Software sequencing and hardware sequencing are two methods used to interface
+with the SPI controller on Intel platforms. They can be selected using either
+ich_spi_mode=swseq or ich_spi_mode=hwseq programmer parameters. Flashrom will
+attempt to automatically detect which mode to use.
+
+Software sequencing is the traditional method whereby software running on the
+CPU handles most of the logic needed to interact with the flash chip. This
+offers good flexibility since the user can utilize any opcode available in the
+OPMENU registers, and OPMENU can be left unlocked or on coreboot-supported
+platforms the owner of the system may program it for their needs before locking
+it. Advanced or non-standard features of a chip such as write protection and
+OTP may therefore be directly utilized by software.
+
+Hardware sequencing is a newer method (since around 2011) whereby most of the
+logic for interacting with the SPI flash chip is contained within the SPI
+controller itself and software such as flashrom may only select a few operations
+chosen by Intel via the Flash Cycle (FCYCLE) field. The chip must conform to
+specifications from Intel for each chipset/PCH. The specs are given in the
+"SPI Programming Guide" application note. See [SPI_PROG] cited at the bottom of
+this document for an example.
+
+Hardware sequencing simplifies things from a software perspective since the
+software is guaranteed some minimal level of support and doesn't even need to
+know the chip's ID or opcodes; it just needs to tell the SPI controller to
+perform a type of transaction such as "read", "4k block erase", etc. Hence when
+using hardware sequencing one will see "Opaque flash chip" as the chip's
+description since software might not be able to identify the chip. The SPI
+controller can combine multiple physical flash chips to logically appear as a
+single large flash device, and in such cases it would not make sense for
+flashrom to try to identify the chip.
+
+In many non-Intel systems the software has full control of a generic SPI
+controller where the software controls the SPI signals and also constructs the
+data payload including pre-op (e.g. write enable latch), opcode, address, and
+data. Intel SPI flash controllers are purpose-built for flash chip access and
+the software does not control the hardware directly. This makes Intel SPI
+controllers less flexible from a software standpoint, however there are some
+benefits such as guaranteed atomicity and multi-master arbitration needed for
+modern Intel platforms where the CPU and various microprocessors can share the
+same flash chip.
+
+SMM BIOS Write Protection
+=========================
+
+Sometimes a hardware vendor will enable "SMM BIOS Write Protect" (SMM_BWP)
+in the firmware during boot time. The bits that control SMM_BWP are in the
+BIOS_CNTL register in the LPC interface.
+
+When enabled, the SPI flash can only be written when the system is operating in
+in System Management Mode (SMM). In other words, only certain code that was
+installed by the BIOS can write to the flash chip. Programs that run in OS
+context such as flashrom can still read the flash chip, but cannot write to the
+flash chip.
+
+Flashrom will attempt to detect this and print a warning such as the following:
+"Warning: BIOS region SMM protection is enabled!"
+
+Many vendor-supplied firmware update utilities do not actually write to the ROM;
+instead they transfer data to/from memory which is read/written by a routine
+running in SMM and is responsible for writing to the firmware ROM. This causes
+severe system performance degradataion since all processors must be in SMM
+context (ring -2) instead of OS context (ring 0) while the firmware ROM is being
+written.
+
+Accesses beyond region bounds in descriptor mode
+================================================
+
+Intel's flash image tool will always expand the last region so that it covers
+the whole flash chip, but some boards ship with a different configuration.
+It seems that in descriptor mode all addresses outside the used regions can not
+be accessed whatsoever. This is not specified anywhere publicly as far as we
+could tell. flashrom does not handle this explicitly yet. It will just fail
+when trying to touch an address outside of any region.
+See also http://www.flashrom.org/pipermail/flashrom/2011-August/007606.html
+
+(Un)locking the ME region
+=========================
+
+If the ME region is locked by the FRAP register in descriptor mode, the host
+software is not allowed to read or write any address inside that region.
+Although the chipset datasheets specify that "[t]he contents of this register
+are that of the Flash Descriptor" [PANTHER], this is not entirely true.
+The firmware has to fill at least some of the registers involved. It is not
+known when they become read-only or any other details, but there is at least
+one HM67-based board, that provides an user-changeable setting in the firmware
+user interface to enable ME region updates that lead to a FRAP content that is
+not equal to the descriptor region bits [NC9B].
+
+There are different ways to unlock access:
+
+ * A pin strap: Flash Descriptor Security Override Strap (as indicated by the
+ Flash Descriptor Override Pin Strap Status (FDOPSS) in HSFS. That pin is
+ probably not accessible to end users on consumer boards (every Intel doc i
+ have seen stresses that this is for debugging in manufacturing only and
+ should not be available for end users).
+ The ME indicates this in bits [19:16] (Operation Mode) in the HFS register of
+ the HECI/MEI PCI device by setting them to 4 (SECOVR_JMPR) [MODE_CTRL].
+
+ * Intel Management Engine BIOS Extension (MEBx) Disable
+ This option may be available to end users on some boards usually accessible
+ by hitting ctrl+p after BIOS POST. Quote: "'Disabling' the Intel ME does not
+ really disable it: it causes the Intel ME code to be halted at an early stage
+ of the Intel ME's booting so that the system has no traffic originating from
+ the Intel ME on any of the buses." [MEBX] The ME indicates this in
+ bits [19:16] (Operation Mode) in the HFS register of the HECI/MEI PCI device
+ by setting them to 3 (Soft Temporary Disable) [MODE_CTRL].
+
+ * Previous to Ibex Peak/5 Series chipsets removing the DIMM from slot (or
+ channel?) #0 disables the ME completely, which may give the host access to
+ the ME region.
+
+ * HMRFPO (Host ME Region Flash Protection Override) Enable MEI command
+ This is the most interesting one because it allows to temporarily disable
+ the ME region protection by software. The ME indicates this in bits [19:16]
+ (Operation Mode) in the HFS register of the HECI/MEI PCI device by setting
+ them to 5 (SECOVER_MEI_MSG) [MODE_CTRL].
+
+MEI/HECI
+========
+
+Communication between the host software and the different services provided by
+the ME is done via a packet-based protocol that uses MMIO transfers to one or
+more virtual PCI devices. Upon this layer there exist various services that can
+be used to read out hardware management values (e.g. temperatures, fan speeds
+etc.). The lower levels of that protocol are well documented:
+The locations/offsets of the PCI MMIO registers are noted in the chipset
+datasheets. The actually communication is documented in a whitepaper [DCMI] and
+an outdated as well as a current Linux kernel implementation (currently in
+staging/ exist [KERNEL]. There exists a patch that re-implements this in user
+space (as part of flashrom).
+
+Problems
+========
+
+The problem is that only very few higher level protocols are documented publicly,
+especially the bunch of messages that contain the HMRFPO commands is probably
+well protected and only documented in ME-specific docs and the BIOS writer's
+guides. We are aware of a few leaked documents though that give us a few hints
+about it, but nothing substantial regarding its implementation.
+
+The documents are somewhat contradicting each other in various points which
+might be due to factual changes in process of time or due to the different
+capabilities of the ME firmwares, example:
+
+Intel's Flash Programming Tool (FPT) "automatically stops ME writing to SPI
+ME Region, to prevent both writing at the same time, causing data corruption." [ME8]
+
+"FPT is not HMRFPO-capable, so needs [the help of the FDOPS pin] HDA_SDO if
+used to update the ME Region." [SPS]
+
+When looking at the various ME firmware editions (and different chipsets), things
+get very unclear. Some docs say that HMRFPO needs to be sent before End-of-POST
+(EOP), others say that the ME region can be updated in the field or that some
+vendor tools use it for updates. This needs to be investigated further before
+drawing any conclusion.
+
+[PANTHER]
+ Intel 7 Series Chipset Family Platform Controller Hub (PCH) Datasheet
+ Document Number: 326776, April 2012, page 857
+
+[NC9B]
+ Jetway NC9B flashrom v0.9.5.2-r1517 log with ME region unlocked.
+ NB: "FRAP 0e0f" vs. "FLMSTR1 0a0b".
+ http://paste.flashrom.org/view.php?id=1215
+
+[MODE_CTRL]
+ Client Platform Enabling Tour: Platform Software
+ Document Number: 439167, Revision 1.2, page 52
+
+[MEBX]
+ Intel Management Engine BIOS Extension (MEBX) User's Guide
+ Revision 1.2, Section 3.1 and 3.5
+
+[DCMI]
+ DCMI Host Interface Specification
+ Revision 1.0
+
+[SPI_PROG]
+ Ibex Peak SPI Programming Guide
+ Document Number: 403598, Revision 1.3, page 79
+
+[ME8]
+ Manufacturing with Intel Management Engine (ME) Firmware 8.X on Intel 7 Series
+ Revision 2.0, page 59
+
+[SPS]
+ Manufacturing with Intel Management Engine (ME) on Intel C600 Series Chipset 1
+ for Romley Server 2 Platforms using Server Platform Services (SPS) Firmware
+ Revision 2.2, page 51
--
To view, visit https://review.coreboot.org/c/flashrom/+/82649?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I79af5674f3af9ca880e89becd6a272a2cf8ed599
Gerrit-Change-Number: 82649
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Attention is currently required from: Michael Heimpold, Nikolai Artemiev, Stefan Reinauer.
Anastasia Klimchuk has posted comments on this change by Michael Heimpold. ( https://review.coreboot.org/c/flashrom/+/82715?usp=email )
Change subject: flashchips: add support for chip model Winbond W25Q16JV_M
......................................................................
Patch Set 1:
(3 comments)
Patchset:
PS1:
Thank you for your contribution.
I have just two comments.
File flashchips.c:
https://review.coreboot.org/c/flashrom/+/82715/comment/b4c70817_230f1409?us… :
PS1, Line 19297: FEATURE_WRSR_EXT2 |
You need to remove this feature bit, it's not needed.
For the operation of writing the second bit of status register, you have FEATURE_WRSR2 and that's correct from the datasheets.
(FEATURE_WRSR_EXT2 would be an alternative way, which is not for this chip).
https://review.coreboot.org/c/flashrom/+/82715/comment/cc6801e5_ecddb6a9?us… :
PS1, Line 19320: SPI_PRETTYPRINT_STATUS_REGISTER_BP3_SRWD
I think this function is better for this chip, it will print more details:
`SPI_PRETTYPRINT_STATUS_REGISTER_SRWD_SEC_TB_BP2_WELWIP`
--
To view, visit https://review.coreboot.org/c/flashrom/+/82715?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ida1ceb5fe31411bef647e5133c5bd0bdb02d7704
Gerrit-Change-Number: 82715
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Heimpold <mhei(a)heimpold.de>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Michael Heimpold <mhei(a)heimpold.de>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Comment-Date: Thu, 06 Jun 2024 03:07:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: Aarya, Alexander Goncharov, Peter Marheine.
Anastasia Klimchuk has posted comments on this change by Peter Marheine. ( https://review.coreboot.org/c/flashrom/+/82393?usp=email )
Change subject: erasure_layout: Fix get_flash_region bug
......................................................................
Patch Set 17: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/82393?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ic5bf9d0f0e4a94c48d6f6e74e3cb9cccdc7adec9
Gerrit-Change-Number: 82393
Gerrit-PatchSet: 17
Gerrit-Owner: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Attention: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Comment-Date: Thu, 06 Jun 2024 00:57:09 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes