Attention is currently required from: Peter Marheine, Richard Hughes, Sergii Dmytruk.
Anastasia Klimchuk has posted comments on this change by Anastasia Klimchuk. ( https://review.coreboot.org/c/flashrom/+/86031?usp=email )
Change subject: libflashrom: Update the API for progress callback
......................................................................
Patch Set 3:
(1 comment)
File include/libflashrom.h:
https://review.coreboot.org/c/flashrom/+/86031/comment/bac8f592_d987043f?us… :
PS2, Line 90: * @deprecated Use flashrom_set_progress_callback_v1 instead
> Well, it's not backwards compatible for sure. […]
There is an important detail here, I will try to explain the full context.
The old version of API was unusable, the commit message in CB:64663 explains it. The input to the callback, flashctx, was not possible to peek into for external clients.
In other words, old API was not possible to use for external clients without one more patch. And CB:64663 could be one options of that "one more patch", but after discussion there, I think changing the API is more correct, so I made this patch instead.
But one way or the other, what is currently in the tree, is not usable by external clients. (It does build of course).
So keeping the old implementation, and as you said that would require storing two callbacks - I don't want to do this, because that would be just a dead code.
However, somehow this needs to move on. I understand some formality is needed because we are changing the public API. What would be the minimum required to get this v2 in? Because really, the old version was not possible to use anyway (except of internal clients as cli and tests, but these can be changed easily)
--
To view, visit https://review.coreboot.org/c/flashrom/+/86031?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: Ia8cc0461c449b7e65888a64cdc594c55b81eae7a
Gerrit-Change-Number: 86031
Gerrit-PatchSet: 3
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Richard Hughes <richard(a)hughsie.com>
Gerrit-Reviewer: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Richard Hughes <richard(a)hughsie.com>
Gerrit-Attention: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Comment-Date: Sat, 01 Feb 2025 12:41:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Comment-In-Reply-To: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Attention is currently required from: Matt DeVillier, Stefan Reinauer.
Anastasia Klimchuk has posted comments on this change by Anastasia Klimchuk. ( https://review.coreboot.org/c/flashrom/+/86243?usp=email )
Change subject: doc: Migrate old pages about laptops and EC
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
Matt, I added a trailer for your upcoming doc, I hope you don't mind! :)
--
To view, visit https://review.coreboot.org/c/flashrom/+/86243?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: I26f5aef8d679d37fcaebfd830a04d09d818ffe0b
Gerrit-Change-Number: 86243
Gerrit-PatchSet: 1
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Comment-Date: Sat, 01 Feb 2025 10:07:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Anastasia Klimchuk has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/86243?usp=email )
Change subject: doc: Migrate old pages about laptops and EC
......................................................................
doc: Migrate old pages about laptops and EC
Old pages are:
https://wiki.flashrom.org/Laptopshttps://wiki.flashrom.org/Laptop_enable
Info from both is gathered into one doc.
Change-Id: I26f5aef8d679d37fcaebfd830a04d09d818ffe0b
Signed-off-by: Anastasia Klimchuk <aklm(a)flashrom.org>
---
M doc/contrib_howtos/index.rst
A doc/contrib_howtos/laptops_and_ec.rst
2 files changed, 171 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/43/86243/1
diff --git a/doc/contrib_howtos/index.rst b/doc/contrib_howtos/index.rst
index cb74e1c..3df2fac 100644
--- a/doc/contrib_howtos/index.rst
+++ b/doc/contrib_howtos/index.rst
@@ -7,5 +7,7 @@
how_to_add_new_chip
how_to_mark_chip_tested
how_to_add_unit_test
+ laptops_and_ec
+
../how_to_add_docs
../how_to_support_flashrom
diff --git a/doc/contrib_howtos/laptops_and_ec.rst b/doc/contrib_howtos/laptops_and_ec.rst
new file mode 100644
index 0000000..a07073a
--- /dev/null
+++ b/doc/contrib_howtos/laptops_and_ec.rst
@@ -0,0 +1,169 @@
+======================
+Info on laptops and EC
+======================
+
+The page contains some info about flashing the EC on the laptops without official vendor support.
+
+**Note this document was migrated from old website and the content >10yrs old**
+(exept the links to mailing list and dev guide, those are up-to-date).
+
+For the info how to flash system firmware on modern laptops with vendor support, please check
+"Flashing coreboot" document in user docs.
+
+Why laptops are difficult
+=========================
+
+Laptops, notebooks and netbooks are difficult to support and we recommend to use the vendor flashing utility.
+The embedded controller (EC) in these machines often interacts badly with flashing,
+either by blocking all read/write access to the flash chip or by crashing
+(it may power off the machine or mess with the battery or cause system instability).
+
+ECs are particularly difficult besides blocking access and crashing:
+
+* Almost all ECs do not have public datasheets with programming information.
+
+* Even if the programming information for an EC is public,
+ the errata (often needed to use the EC for flashing) are not.
+
+* Even if you have the datasheets with programming information (under NDA or by convincing the EC vendor to release them),
+ the following problems remain:
+
+ * flashrom has to detect/probe the EC. For this, it writes a magic byte sequence to a magic port.
+ The bad news is that a laptop vendor can customize the magic sequence and the magic port and the response to that,
+ so even if you try all magic sequences mentioned in the datasheet on all magic ports mentioned in the datasheet,
+ it will either not react (because the laptop vendor came up with its own secret magic sequence/port or
+ because the laptop vendor decided to disable all detection support) or it will respond with a non-default ID
+ which is not present in any table. If you are really extremely lucky,
+ the EC will react to the probing sequence mentioned in the datasheet and respond with the ID mentioned in the datasheet.
+
+ * Most ECs support 3-5 different interfaces to the flash chip. Depending on the software running on the EC,
+ none, some or all of them can be disabled. So if you want to support a given embedded controller with reasonable reliability,
+ you have to write code for all flash interfaces (usually vastly different from each other).
+
+ * During a flash erase/read/write, flashrom competes with the EC for flash access. The EC usually executes
+ its software directly from flash (no RAM involved) and starving the EC instruction decoder may crash the EC.
+ If you erase the part of the flash chip where the EC fetches its instructions from, the EC will execute garbage
+ and crash/misbehave. When (not if, it always happens) the flash chip is in ID mode during flash probing,
+ the EC will mistake the ID data for instructions and execute them, resulting in a crash.
+
+ * You have to find a way to let the EC software run for some time without requiring flash access.
+ This can be achieved by writing a loop (not really a loop, but this is just to illustrate the point)
+ to EC-internal tiny RAM and then jumping there. Only during that time
+ you can access the flash chip reliably without side effects.
+
+ * After flashing, you have to reset the EC so that it can resume running normally.
+ This is not optional because the EC controls battery charging (among others) and you want that to work.
+
+Adding support for laptops
+==========================
+
+That said, adding support for an EC is doable. Here is a cheat sheet on what to do.
+
+* Find out which flash chip you have by physical inspection of the board
+ (or by looking at the internal docs of the manufacturer or the repair manual).
+
+* Find out the controller where the flash chip is attached to. Can be the EC (likely),
+ SuperI/O (somewhat likely), Southbridge (pretty unlikely, if it were, you wouldn't be reading this).
+ This is a job done by physical inspection of the board (or by looking at the internal docs
+ of the manufacturer which sometimes only the ODM and not even the laptop vendor has).
+
+* You can post on the flashrom mailing list (see :ref:`mailing list`) that you plan to work on your EC,
+ mention the exact EC model (and laptop model). You can ask if someone has public docs for the EC,
+ knows how to get them under NDA or has vendor contacts at the EC vendor.
+ With some luck, you might even get docs (some vendors are more friendly than others).
+
+* Get hold of a BIOS image for your laptop (flashrom dump in force mode won't work reliably here).
+ Locate the EC code in the BIOS image. The EC often is 8051 compatible or has an architecture with similar limitations.
+ The EC code will be uncompressed in flash. Download BIOS images for other laptops with the same EC
+ and try to compare the EC code. It may be 100% vanilla code directly from the EC manufacturer
+ (which makes your task rather easy) or a heavily customized variant of the original code
+ (bad, because you have to analyze it).
+
+* Cross-check the EC code with the EC docs to find out which interfaces for detecting the EC
+ and which interfaces for flashing are enabled and working.
+
+* The above two steps can be skipped if you get that information from the laptop vendor.
+
+* Make sure your flash chip is removable in case something goes wrong. If it is not removable,
+ look for an in-system-programming header on the board and check if it is supported by flashrom
+ (or your hardware programmer of choice). If there is no header and the chip is soldered,
+ desolder it and solder a socket in place.
+
+* Dump the old firmware via the programming header or via reading the chip in an external programmer
+ and store it safely (backup on a readonly medium like CD-ROM). It contains your laptop serial number,
+ your MAC address, and sometimes your Windows preactivation keys.
+
+* (optional) Disconnect the battery. You don't know how the EC behaves if it crashes
+ and batteries are expensive and prone to unwanted reactions.
+
+* Start implementing and testing EC detection code. We recommend to do this either
+ as external programmer driver init code (and have the code return 1 to make sure flashrom aborts after init)
+ or in a standalone program (this helps you keep an overview).
+
+* Start implementing flasher support for your EC. The best way to do this is an external programmer driver.
+
+* Note that you can push your patch for review even if it is still in Work In Progress state, if you want to
+ get early feedback and/or share your effort with the people on the mailing list. See :doc:`/dev_guide/development_guide`.
+
+Laptop enable
+=============
+
+Most (all?) laptop designs use an EC (embedded controller) to control the backlight,
+watch the battery status, etcetera.
+
+To access the flash chip (safely), the EC needs to be suspended/stopped.
+The code to stop the EC typically is found at the end of a BIOS binary.
+This page is about that trailing part of a binary.
+
+PhoenixBIOS specifics
+---------------------
+
+This subsection is about the disassembly of a laptop BIOS file (Compal HTW20, ENE KB910QF, SMC LPC47B227?, Phoenix TrustedCore)
+that is 1052598 bytes large, the trailer starts at 0x100000 (1024 * 1024) and is 4022 bytes in size.
+
+To extract the trailer, use dd::
+
+ dd if=<romfile> of=bios.bin bs=1024k skip=1
+
+Example of a disassembly
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+The disassembler that is used is IDAPro, the freeware version.
+
+Example of how the disassembly of the trailer looks::
+
+ TRAILER:0010 09 00 00 00 00 00 00 00 00 00 00 43 6F 6D 70 61 ..........Compa
+ TRAILER:0020 6C 20 57 69 6E 50 68 6C 61 73 68 20 2D 20 46 6C l WinPhlash - Fl
+ TRAILER:0030 61 73 68 69 6E 74 2E 61 73 6D 20 76 30 2E 30 33 ashint.asm v0.03
+ TRAILER:0040 5A 46 4C 50 46 25 00 00 00 00 00 00 00 59 02 00 ZFLPF%
+
+Hints and facts
+^^^^^^^^^^^^^^^
+
+Facts:
+
+* ZFLPF is found at 0x40
+* len(ZFLPH) = 5
+
+The location of the entrypoint is stored at 0x51:
+
+(base of ZFLPF) + len(ZFLPF) + 0xc = 0x40 + 5 + 0xc = 0x51
+
+
+Let's take a look at position 0x51::
+
+ TRAILER:0051 DE 02 dw 2DEh
+
+Fact:
+
+* 0x2de + 0x1b = 0x2f9
+
+Preview of the begin of the board specific code
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+::
+
+ TRAILER:02F9 ; ---------------------------------------------------------------------------
+ TRAILER:02F9 9C pushf
+ TRAILER:02FA 60 pusha
+ TRAILER:02FB E8 C2 00 call determine_lpc_pci_id
--
To view, visit https://review.coreboot.org/c/flashrom/+/86243?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I26f5aef8d679d37fcaebfd830a04d09d818ffe0b
Gerrit-Change-Number: 86243
Gerrit-PatchSet: 1
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: Anastasia Klimchuk.
Stefan Reinauer has posted comments on this change by Anastasia Klimchuk. ( https://review.coreboot.org/c/flashrom/+/86242?usp=email )
Change subject: doc: Migrate privacy policy page from old website into new one
......................................................................
Patch Set 1: Code-Review+2 Verified+1
--
To view, visit https://review.coreboot.org/c/flashrom/+/86242?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: I54ace480b3bebe3031ea6d1e507c540ac1dc7cc6
Gerrit-Change-Number: 86242
Gerrit-PatchSet: 1
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Sat, 01 Feb 2025 07:55:09 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Anastasia Klimchuk has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/86242?usp=email )
Change subject: doc: Migrate privacy policy page from old website into new one
......................................................................
doc: Migrate privacy policy page from old website into new one
Change-Id: I54ace480b3bebe3031ea6d1e507c540ac1dc7cc6
Signed-off-by: Anastasia Klimchuk <aklm(a)flashrom.org>
---
M doc/about_flashrom/index.rst
A doc/about_flashrom/privacy_policy.rst
2 files changed, 52 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/42/86242/1
diff --git a/doc/about_flashrom/index.rst b/doc/about_flashrom/index.rst
index 49c9849..143c7b6 100644
--- a/doc/about_flashrom/index.rst
+++ b/doc/about_flashrom/index.rst
@@ -6,3 +6,4 @@
team
code_of_conduct
+ privacy_policy
diff --git a/doc/about_flashrom/privacy_policy.rst b/doc/about_flashrom/privacy_policy.rst
new file mode 100644
index 0000000..f675eec
--- /dev/null
+++ b/doc/about_flashrom/privacy_policy.rst
@@ -0,0 +1,51 @@
+==============
+Privacy policy
+==============
+
+Email address: stefan.reinauer(a)coreboot.org
+
+Disclaimer
+==========
+
+Liability for content
+---------------------
+
+We try to be careful when creating our pages, however we can not take any responsibility for the accuracy,
+completeness, or timeliness of any of our content. Obligations to remove or block the use of information
+under the law remains unaffected. Upon formal notification of any such violations, we will remove the content.
+
+Liability for links
+-------------------
+
+Our site contains links to external websites, over which we have no control.
+We therefore cannot accept any responsibility for the remote content.
+It is always the responsibility of the respective provider or operator for the contents of any linked site.
+The linked sites were checked at the time of linking for possible legal violations
+and no illegal contents were noticed at that time. Removal of the linked pages is unreasonable
+without concrete evidence of a legal violation. Upon formal notification of legal violations,
+we will remove such links.
+
+Copyright & license
+-------------------
+
+With the exception of use for sending unsolicited advertisements, we encourage copying, editing,
+and distribution of the flashrom project source and of the contents of the website for educational,
+personal, and commercial use. Copyrights are maintained by the individual authors,
+and the copyright notices must be included anywhere they are present.
+
+In instances where the content on this page were not the created by the flashrom project,
+the rights of third party creators are maintained. Please see the credits page for a list of these items.
+Should you be aware of any copyright infringement, we request that the copyright owner send a notice.
+Upon appropriate notification of violations, we will remove the infringing content.
+
+Data protection
+---------------
+
+The use of our website is usually possible without providing personal information.
+As much as possible, any personal data such as your name, address or email address which is collected,
+is done on a voluntary basis. This data is not saved without your express request.
+
+The flashrom project takes reasonable security measures to protect your private data, however data transmission over the internet (for example, when communicating via e-mail) can have security holes. Complete protection of data against unauthorized access by third parties is impossible.
+
+The use of data published on this website (anything on the flashrom.org domain) by third parties
+for sending unsolicited advertisements and information materials is hereby expressly prohibited.
--
To view, visit https://review.coreboot.org/c/flashrom/+/86242?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I54ace480b3bebe3031ea6d1e507c540ac1dc7cc6
Gerrit-Change-Number: 86242
Gerrit-PatchSet: 1
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>