diff options
author | Reka Norman <rekanorman@google.com> | 2021-11-08 11:18:42 +1100 |
---|---|---|
committer | Tim Wawrzynczak <twawrzynczak@chromium.org> | 2021-11-09 23:45:26 +0000 |
commit | e6a1ebe55ba6bbcd791e40a934bd3e65fad31cb9 (patch) | |
tree | 51f73817a63746dbf4b7423a58a1b259e6786d01 /util/spd_tools/src | |
parent | b455dd3486a7b2e0b8d98c907cb9389c8283faff (diff) |
util/spd_tools: Document adding support for a new memory technology
Add documentation describing how to add support for a new memory
technology to spd_tools:
- Add a section to the README.
- Document the memTech interface in spd_gen.go.
BUG=b:191776301
TEST=None
Signed-off-by: Reka Norman <rekanorman@google.com>
Change-Id: Ie710c1c686ddf5288db35cf43e5f1ac9b1974305
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59005
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/spd_tools/src')
-rw-r--r-- | util/spd_tools/src/spd_gen/spd_gen.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/util/spd_tools/src/spd_gen/spd_gen.go b/util/spd_tools/src/spd_gen/spd_gen.go index fa6549262d..6cc910272f 100644 --- a/util/spd_tools/src/spd_gen/spd_gen.go +++ b/util/spd_tools/src/spd_gen/spd_gen.go @@ -28,10 +28,37 @@ type memPart struct { } type memTech interface { + /* + * Returns the set -> platform mapping for the memory technology. Platforms with the + * same SPD requirements should be grouped together into a single set. + */ getSetMap() map[int][]int + + /* + * Takes the name and attributes of a part, as read from the memory_parts JSON file. + * Validates the attributes, returning an error if any attribute has an invalid value. + * Stores the name and attributes internally to be used later. + */ addNewPart(string, interface{}) error + + /* + * Takes the name of a part and a set number. + * Retrieves the part's attributes which were stored by addNewPart(). Updates them by + * setting any optional attributes which weren't specified in the JSON file to their + * default values. + * Returns these updated attributes. + */ getSPDAttribs(string, int) (interface{}, error) + + /* + * Returns the size of an SPD file for this memory technology. + */ getSPDLen() int + + /* + * Takes an SPD byte index and the attributes of a part. + * Returns the value which that SPD byte should be set to based on the attributes. + */ getSPDByte(int, interface{}) byte } |