eeprom-format: Add support to configure GPIO bank 1
The GPIO bank 1 is available on CM1/CM3/CM3+ and CM4S devices. On these devices an ID EEPROM can be used to get all available GPIOs in a defined state before the operating system takes over.
This is a RFC, if you might be willing to implement this or something similar in the bootloader code. We will provide the implementation to the eepromutils if you have no objections to these changes.
GPIO_BANK1 will have to be type 0x0005 - 0x0004 is the custom blob - but otherwise it's looking plausible. I've had a look at our end and it's a relatively small change. I can't guarantee that some nasty problem won't make this unattractive, but for now I think this should be acceptable.
Yes, you're right about the type. Fixed it. We will schedule the changes to the tooling on our side and hopefully have a PR soon. I'm not sure about the "EEPROM data format version", should it be incremented? But this is a detail which should not block anything at the moment.
Since the new format is compatible with the old if the new type isn't used I would leave the format version as it is.
Looking at the parsing code in the firmware it exits (successfully!) when an unknown ID is encountered. It therefore makes sense when building the eep to put the new chunk at the end of the image, after any custom chunks.
I also found it convenient to reuse the same gpio_map_d structure for the smaller second bank, leaving the remaining entries zeroed (and therefore ignored).
Thanks for the fast replay. I updated the document to reflect this.
I wasn't actually thinking of using a larger blob in the image, just to unpack it into a gpio_map_d rather than adding say a gpio_bank1_map_d structure.
Ohhh ok, so only the internal representation. Will change it back.
closed in favor of https://github.com/raspberrypi/hats/pull/93 The format is the same but now also the tooling was updated.