firmweaver: Introduce GPIO tool for AP firmware config Introduce the GPIO tool in ap_fw directory. This tool parses a GPIO map CSV file (typically generated from a hardware spreadsheet) and generates C configuration code for different SoCs. Currently supports Intel SoCs, with placeholder support for Qualcomm and MediaTek SoCs. The Intel-specific logic is organized in intel_gpio_config.go, while the main entry point and generic logic are in gpio_tool.go. Include a Go module definition for building the tool, and update README.md with instructions. Also include test data and expected output for verification. BUG=b:475292981, b:475293394 TEST=Build the tool and run against the provided test CSV: ./ap_fw/gpio_tool --soc intel --csv ap_fw/test/ExampleGpio.csv \ --output /tmp/test.c Verify the output matches the expected ap_fw/test/gpio_config.c. Change-Id: Iafaa8f74510cdab0b6213c393350138f7fdbc7f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/firmweaver/+/8051010 Commit-Queue: Karthik Ramasubramanian <kramasub@google.com> Tested-by: Karthik Ramasubramanian <kramasub@google.com> Reviewed-by: Kshitij Shah <tij@google.com>
Firmweaver is a collection of tools for Chromium OS to assist with initial firmware setup during board bringup.
The Chromium OS project includes tools to assist with initial firmware setup during board bringup. These tools generate certain objects in Application Processor (AP) and Embedded Controller (EC) firmware (e.g., EC devicetree, AP GPIO configuration, etc.).
The tools take a curated sheet as prepared by the hardware team as an input and generate these objects as output. Developers can validate the generated output and contribute them to the concerned project.
The GPIO tool is located in the ap_fw directory.
ap_fw directory:cd ap_fw
go build -o gpio_toolThis will generate the
gpio_tool executable in the ap_fw directory.The gpio_tool parses a GPIO map CSV file and generates C configuration code.
./ap_fw/gpio_tool --soc <soc_type> --csv <path_to_csv> [--output <path_to_output_c_file>]
--soc: SoC type. Supported values: intel, qcom, mtk. (Required)--csv: Path to the local CSV file containing the GPIO map. (Required)--output: Path to the output file. If omitted, output is written to stdout.To generate Intel GPIO configuration from the provided example CSV:
./ap_fw/gpio_tool --soc intel --csv ap_fw/test/ExampleGpio.csv --output ap_fw/test/gpio_config.c
This project follows the standard Chromium OS contribution process.