1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 22:21:16 +02:00

flashchips: Splitting flashchips into separate files by vendor

To make the flashchips "database" easier to manage, split it by vendor
into several smaller files. This commit transfers the bulk of the data
to separate files and includes them from `flashchips.c`. Although this
is ugly (.c includes are usually frowned upon), it is a necessary evil
to make this commit reproducible.

Tested in two ways:

1) Output of `flashrom -L` has no diffs with/without the patch
compared with diff and cmp tools

2) flashrom binary has no diffs with/without the patch
compared with diff and cmp tools
Note for binary comparison documentation and manpages need to be
disabled (documentation is actually modified in the patch), also
version in meson.build set to "none" (otherwise git version counts
every commit).

Change-Id: I3a9ebb0575e2700c5871d16875495d9c8943b30b
Co-developed-by: Angel Pons <th3fanbus@gmail.com>
Co-developed-by: Anastasia Klimchuk <aklm@flashrom.org>
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Signed-off-by: Anastasia Klimchuk <aklm@flashrom.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/83307
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
This commit is contained in:
Angel Pons
2024-07-02 16:51:43 +02:00
committed by Anastasia Klimchuk
parent 3ba9d6140b
commit d07cd9f515
37 changed files with 24143 additions and 23458 deletions

View File

@ -12,7 +12,7 @@ Typically, you would add all the models covered by the datasheet you have, but o
To begin with, make sure you have a link to the publicly available datasheet for the chip you want to add. Publicly
available datasheet is a requirement for adding a new chip.
Open the datasheet, ``flashchips.c`` and ``include/flashchips.h``, and then
Open the datasheet, ``flashchips/`` directory, ``include/flashchips.h``, and then
Model ID and vendor ID
======================
@ -23,7 +23,7 @@ These values come in combination with commands used for probing the chip (more o
probing SPI chips is ``0x9f`` which corresponds to ``PROBE_SPI_RDID``.
At this point you need to double-check if exact same chip is already defined. Search for the ``.name`` and ``.vendor`` of the chip
you have in ``flashchips.c`` and if found, compare values of ``.manufacture_id`` and ``.model_id``. If all 4 values match, it
you have in the files in ``flashchips/`` directory and if found, compare values of ``.manufacture_id`` and ``.model_id``. If all 4 values match, it
seems like the chip already defined. In this case you can try using it. Possibly, only the testing status of the chip needs to be
updated, in this case see :doc:`how_to_mark_chip_tested` for instructions.
@ -52,8 +52,8 @@ and continue with the next section "Properties".
Model ID already exists
^^^^^^^^^^^^^^^^^^^^^^^
It is possible that model ID already exists in the header. Then find the corresponding definition in ``flashchips.c`` and inspect
it carefully. Is it the same chip that you have or a different one?
It is possible that model ID already exists in the header. Then find the corresponding definition in file in ``flashchips/`` directory
and inspect it carefully. Is it the same chip that you have or a different one?
The question you need to figure out is: whether existing definition can work for your chip or not. You figure that out by
reading the rest of instructions and comparing the values from the datasheet with existing definition.