common: add GPIO controller function

The CPLD update process requires toggling a GPIO pin to control the
debug card mux. BIOS and EEPROM updates use the same logic, so refactor
the duplicated code into a common GPIO controller function. Update BIOS,
EEPROM, and CPLD code paths to use the new helper.

Tested:
- Verified CPLD update with GPIO mux toggling
- Verified BIOS update with GPIO mux toggling

Verified CPLD update with GPIO mux toggling
```
Dec 18 18:33:35 bmc phosphor-cpld-software-update[1064]: Requesting chip gpiochip0, GPIO line debug-card-mux to 1
Dec 18 18:33:35 bmc phosphor-cpld-software-update[1064]: Updating Lattice CPLD firmware
Dec 18 18:33:45 bmc phosphor-cpld-software-update[1064]: [48K blob data]
Dec 18 18:34:14 bmc phosphor-cpld-software-update[1064]: [48K blob data]
Dec 18 18:34:31 bmc phosphor-cpld-software-update[1064]: Successfully updated CPLD
Dec 18 18:34:31 bmc phosphor-cpld-software-update[1064]: Requesting chip gpiochip0, GPIO line debug-card-mux to 0
```

Verified BIOS update with GPIO mux toggling
```
Dec 18 18:45:53 bmc phosphor-bios-software-update[1063]: Requesting chip gpiochip0, GPIO line FM_MUX1_SEL_R to 1
Dec 18 18:46:24 bmc phosphor-bios-software-update[2158]: [14.8K blob data]
Dec 18 18:46:30 bmc phosphor-bios-software-update[2158]: [47.9K blob data]
Dec 18 18:46:37 bmc phosphor-bios-software-update[2158]: [48K blob data]
Dec 18 18:46:44 bmc phosphor-bios-software-update[2158]: [48K blob data]
Dec 18 18:46:51 bmc phosphor-bios-software-update[2158]: [48K blob data]
Dec 18 18:46:58 bmc phosphor-bios-software-update[2158]: [47.9K blob data]
Dec 18 18:46:58 bmc phosphor-bios-software-update[2158]: [4.5K blob data]
Dec 18 18:47:01 bmc phosphor-bios-software-update[2158]: [48K blob data]
Dec 18 18:47:04 bmc phosphor-bios-software-update[2158]: [48K blob data]
Dec 18 18:47:07 bmc phosphor-bios-software-update[2158]: [48K blob data]
Dec 18 18:47:10 bmc phosphor-bios-software-update[2158]: [48K blob data]
Dec 18 18:47:13 bmc phosphor-bios-software-update[2158]: [48K blob data]
Dec 18 18:47:15 bmc phosphor-bios-software-update[2158]: [20.5K blob data]
Dec 18 18:47:17 bmc phosphor-bios-software-update[1063]: Successfully updated SPI flash
Dec 18 18:47:17 bmc phosphor-bios-software-update[1063]: Requesting chip gpiochip0, GPIO line FM_MUX1_SEL_R to 0
```

Change-Id: I8d3c128951fd833a0cd25e1440236f82d37b776f
Signed-off-by: Henry Wu <Henry_Wu@quantatw.com>
15 files changed
tree: 65a9980122623535e6d10066febd4c385c96b970
  1. bios/
  2. bmc/
  3. common/
  4. cpld/
  5. eeprom-device/
  6. i2c-vr/
  7. subprojects/
  8. test/
  9. tpm/
  10. .clang-format
  11. .clang-tidy
  12. .gitignore
  13. .shellcheck
  14. LICENSE
  15. meson.build
  16. meson.options
  17. OWNERS
  18. README.md
README.md

phosphor-bmc-code-mgmt

Phosphor BMC Code Management provides a set of system software management applications. More information can be found at Software Architecture

To Build

To build this package, do the following steps:

  1. meson build
  2. ninja -C build

To clean the repository run rm -r build.