| 1 |
========================== |
| 2 |
How to mark chip as tested |
| 3 |
========================== |
| 4 |
|
| 5 |
flashrom has a massive amount of flashchips definitions, not all of them are fully tested. The reason for this is: |
| 6 |
in some situations chip definition can be introduced based on the values that the datasheet claims, |
| 7 |
but without testing on hardware. In this case chip definition is marked as not tested, **TEST_UNTESTED**. If later |
| 8 |
someone uses the chip for real, and it works, the chip definition can be (and should be) updated, and operations |
| 9 |
which run successfully should be marked as tested. |
| 10 |
|
| 11 |
To mark the chip as tested, someone (one of the maintainers, or one of the contributors) need to send a patch to update |
| 12 |
the list of flashchips. It can be you, and *yes it can be your first patch to flashrom!* If this is your first patch, |
| 13 |
make sure you read the :doc:`/dev_guide/development_guide` and set up dev environment locally. If this is not possible, you |
| 14 |
are welcome to send test results to the mailing list, see :ref:`mailing list`. |
| 15 |
|
| 16 |
Instructions below assume you went through Development guide, and set up environment and repository locally. |
| 17 |
|
| 18 |
To begin with, make sure you have full logs from all the operations that you have run successfully and want to |
| 19 |
mark as tested. **Providing full logs which indicate successful run is required to mark chip as tested.** |
| 20 |
|
| 21 |
Information about tested status of the chip is stored in ``flashchips.c``, specifically in the ``.tested`` member |
| 22 |
of ``struct flashchip``. |
| 23 |
|
| 24 |
Relevant definitions and available options are in ``include/flash.h``, specifically see the definition of: |
| 25 |
|
| 26 |
* ``enum test_state`` |
| 27 |
* ``struct tested`` (inside ``struct flashchip``) |
| 28 |
* pre-defined macros for ``struct tested``, all of them follow the pattern ``#define TEST_xxx_yyy`` |
| 29 |
|
| 30 |
Choose the correct value depending on the operations that you have tested successfully. And then: |
| 31 |
|
| 32 |
#. Open ``flashchips.c`` and find the definition of your chip. |
| 33 |
#. Check the tested status of the chip. If you tested *not* on the latest HEAD (perhaps on the latest released version, |
| 34 |
or on flashrom built a month ago, etc), it is possible that tested status has been updated already. If the status |
| 35 |
has not been updated, |
| 36 |
#. Update ``.tested`` value to the one which reflects current test status. Note that not all the operations have to be |
| 37 |
tested at once: maybe you tested only probe and read, then mark just that. |
| 38 |
#. Make sure flashrom builds successfully, and all the unit tests pass. |
| 39 |
#. For commit title, use the string ``flashchips: Mark <chip name> as tested for <operations>``. |
| 40 |
#. Provide the logs in commit message, you can use flashrom paste service at `paste.flashrom.org <https://paste.flashrom.org>`_ |
| 41 |
or any other paste service. As a plan B, you can post message on the :ref:`mailing list`, attach the logs to the post, |
| 42 |
and then add the link to the post to the commit message. |
| 43 |
#. Follow :doc:`/dev_guide/development_guide` and send your patch for review. |
| 44 |
#. Go through review process until your patch gets approved (see Development guide for more details on this). |
| 45 |
|
| 46 |
To see the examples of such patches, have a look at commit history of ``flashchips.c``. |