summaryrefslogtreecommitdiff
path: root/common/cbi_eeprom.c
Commit message (Collapse)AuthorAgeFilesLines
* Update license boilerplate text in source code filesMike Frysinger2022-09-121-1/+1
| | | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* common/cbi_eeprom.c: Format with clang-formatJack Rosenthal2022-06-291-5/+5
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I0891009f625db01245b20cb97ecf31c95204564f Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729612 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* write protect: extract checking write protectDawid Niedzwiecki2022-02-111-5/+3
| | | | | | | | | | | | | | | | | | | | | | The write-protect state can be checked on 2 pins GPIO_WP or GPIO_WP_L. The CONFIG_WP_ACTIVE_HIGH config is used to distinguish these two cases. Move the checking the config and pin state to a separate header file. For Zephyr, start using the gpio_get_level function that takes into account the GPIO_ACTIVE_LOW flag. Also, use 'gpio-wp' alias to the WP pin instead of the legacy enum-name property and 'int-wp' alias to the WP GPIO interrupt. BUG=b:211779766 TEST=zmake testall & make sure WP works BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I70bfbcd5e539fcc8cd157f2feae1a6c8e25083a4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3447404 Reviewed-by: Andrew McRae <amcrae@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* cbi: Add CONFIG_EEPROM_CBI_WPAseda Aboagye2021-07-291-0/+9
| | | | | | | | | | | | | | | | | | | | | This commit adds the config option, CONFIG_EEPROM_CBI_WP. It is to be defined when the EC directly controls the CBI EEPROM WP signal. The EC will set the WP according to the result of `system_is_locked()`. Note that once the WP is set, the EC must be reset via EC_RST_ODL in order for the WP to become unset. This is enabled by the accompanying hardware. BUG=b:181769483 BRANCH=None TEST=`make -j buildall` Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: If490594ab4dd24af98119b01299215b997913b66 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3046412 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* cbi: Add cbi_get_cache_status()Philip Chen2021-07-031-1/+0
| | | | | | | | | | | | | | | | Implement a new API cbi_get_cache_status() for us to probe CBI cache status in unit tests and anywhere else. BRANCH=None BUG=b:186264627 TEST=make buildall -j Signed-off-by: Philip Chen <philipchen@google.com> Change-Id: Ibe3af7df4f04abe2d65b31f2d604dbb6044e5863 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3002448 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* cbi: Remove cbi_eeprom.hPhilip Chen2021-07-021-1/+0
| | | | | | | | | | | | | | | | Move the declaration of cbi_config to cros_board_info.h so that we can get rid of cbi_eeprom.h. BRANCH=None BUG=b:186264627 TEST=make buildall -j Change-Id: I6780542c6428090117d879945d901fe82ce999f4 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3002446 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* cbi: Separate CBI EEPROM driver from CBI protocolPhilip Chen2021-06-291-0/+77
Factor out the physical storage driver (cbi_eeprom.c) from the CBI data/protocol layer (cbi.c), setting up the groundwork to support more options of CBI sources. BRANCH=None BUG=b:186264627 TEST=make buildall -j Change-Id: Ic30a6f789970dd6723cf70d4e852ddb7161f796f Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2965848 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>