Hello Vadim Bendebury,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/flashrom/+/38673
to review the following change.
Change subject: [WIP] Add .clang-format to help with patch formatting
......................................................................
[WIP] Add .clang-format to help with patch formatting
This is based on CB:38208 by Vadim, but with a few added changes.
Here is the original commit message.
This is a copy from the coreboot tree, could be tweaked to better
match the flashrom tree if there are any differences.
Once this file is in place a script could be deployed which would
format only new/changed lines in git patches.
Change-Id: I1fe22809c4a2d73fa02f4de55290d990a9750b86
Signed-off-by: Vadim Bendebury <vbendeb(a)chromium.org>
Signed-off-by: David Hendricks <david.hendricks(a)gmail.com>
---
A .clang-format
1 file changed, 21 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/73/38673/1
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..45c116b
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,21 @@
+BasedOnStyle: LLVM
+Language: Cpp
+IndentWidth: 8
+UseTab: Always
+BreakBeforeBraces: Linux
+AllowShortIfStatementsOnASingleLine: false
+IndentCaseLabels: false
+SortIncludes: false
+ContinuationIndentWidth: 8
+ColumnLimit: 112
+AlwaysBreakBeforeMultilineStrings: true
+AllowShortLoopsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: false
+AlignEscapedNewlinesLeft: false
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: false
+AlignAfterOpenBracket: true
+SpaceAfterCStyleCast: false
+MaxEmptyLinesToKeep: 2
+BreakBeforeBinaryOperators: NonAssignment
+BreakStringLiterals: false
--
To view, visit https://review.coreboot.org/c/flashrom/+/38673
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I1fe22809c4a2d73fa02f4de55290d990a9750b86
Gerrit-Change-Number: 38673
Gerrit-PatchSet: 1
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Vadim Bendebury <vbendeb(a)chromium.org>
Gerrit-MessageType: newchange
David Hendricks has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/42485 )
Change subject: mysteries_intel: Add a section for software vs hardware sequencing
......................................................................
mysteries_intel: Add a section for software vs hardware sequencing
This attempts to explain software sequencing, hardware sequencing,
and the "Opaque flash chip".
Change-Id: I2445e926aad96060f26d0bc55dd7642c1a404296
Signed-off-by: David Hendricks <david.hendricks(a)gmail.com>
---
M Documentation/mysteries_intel.txt
1 file changed, 41 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/85/42485/1
diff --git a/Documentation/mysteries_intel.txt b/Documentation/mysteries_intel.txt
index 60ad21a..8ed7b65 100644
--- a/Documentation/mysteries_intel.txt
+++ b/Documentation/mysteries_intel.txt
@@ -5,6 +5,47 @@
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 Sequenching 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 and 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 be therefore be directly utilized by software.
+
+Hardware sequencing is a newer method 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. There specs are given in the "SPI Programming Guide"
+for each chipset/PCH and are usually available under NDA.
+
+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 and know its supported opcodes; it just needs to tell the
+SPI controller to perform a certain type of transaction such as "read", "4k
+block erase", etc. without knowing the actual opcodes used by the chip for the
+transaction. Hence when using hardware sequencing one will see "Opaque flash
+chip" as the chip's description, since flashrom will not necessarily even read
+the chip's ID. This abstraction also allows the SPI controller to do things like
+concatenating multiple chips to appear as a single large one.
+
+In many non-Intel systems the software has full control of a generic SPI
+controller where the software controls the chip select and data buffer and also
+constructs the 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
--
To view, visit https://review.coreboot.org/c/flashrom/+/42485
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I2445e926aad96060f26d0bc55dd7642c1a404296
Gerrit-Change-Number: 42485
Gerrit-PatchSet: 1
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-MessageType: newchange