firmweaver: update dtsi generation Support unmodified EC pinout sheets and match arbitrage output. BUG=b:427556454 TEST=go test -v -race ./... TEST=compared generated kenai dtsi between arb and firmweaver Change-Id: Id7c95bb62edc558472b774f19303ad5466e2474c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/firmweaver/+/8522577 Reviewed-by: Karthik Ramasubramanian <kramasub@google.com> Commit-Queue: Kshitij Shah <tij@google.com> Tested-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.
coreboot_gpio, alias: gpio)zephyr_dtsi, alias: dtsi)Build the firmweaver binary from the repository root:
go build -o firmweaver .
Login to use Google Sheets:
./firmweaver auth login ./firmweaver auth status
The coreboot_gpio (alias: gpio) parses a GPIO map CSV file or Google Sheet and generates C configuration code.
./firmweaver coreboot_gpio --soc <soc_type> (--csv <path_to_csv> | --sheet <sheet_url_or_id>) [--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.--sheet: Google Sheets URL, ID, or go/ shortlink.--sheet-tab: Optional specific sheet tab title to read.--output: Path to the output file. If omitted, output is written to stdout.To generate Intel GPIO configuration from the provided example CSV:
./firmweaver coreboot_gpio --soc intel --csv coreboot_gpio/test/ExampleGpio.csv --output coreboot_gpio/test/gpio_config.c
(You can also use the shorthand ./firmweaver gpio ...)
Or directly from a Google Sheet:
./firmweaver coreboot_gpio --soc intel --sheet "go/firmweaver-example-gpio-go-link" --output coreboot_gpio/test/gpio_config.c
The zephyr_dtsi (alias: dtsi) parses an EC pinout CSV spreadsheet or Google Sheet and generates Zephyr devicetree overlays.
./firmweaver zephyr_dtsi --chip <chip_name> (--csv <path_to_csv> | --sheet <sheet_url_or_id>) [--pin-col <variant>] [--output <path_to_output_dtsi>]
To generate Nuvoton NPCX9 Devicetree overlay from the provided example CSV:
./firmweaver zephyr_dtsi --chip npcx99 --csv zephyr_dtsi/test/ExampleEcPinout.csv --pin-col "NPCX99 (NPCX)" --output zephyr_dtsi/test/generated.dtsi
(You can also use the shorthand ./firmweaver dtsi ...)
Or directly from a Google Sheet:
./firmweaver zephyr_dtsi --chip npcx99 --sheet "go/firmweaver-example-ec-go-link" --output zephyr_dtsi/test/generated.dtsi
Run unit tests across all tools in the workspace:
go test -v ./...
This project follows the standard Chromium OS contribution process.