Title: Select GPIO command source.
Subsystems (2)
PATCH 1/1 Title: Select GPIO command source.
From: peteryin <[email protected]>
Description:
The capability to choose the GPIO command source
between ARM LPC and Coprocessor CPU is supported.
Test Plan:
Get Bank gpio command source
e.g.
cd /sys/bus/platform/drivers/aspeed-command-source/ cat 1e780000.gpio-command-source/bank_abcd ARM ARM ARM ARM
Set Bank gpio command source.
e.g.
cd /sys/bus/platform/drivers/aspeed-command-source/
echo "A ARM" > 1e780000.gpio-command-source/bank_abcd or
echo "A LPC" > 1e780000.gpio-command-source/bank_abcd or$
echo "A COP" > 1e780000.gpio-command-source/bank_abcd
--- .../sysfs-driver-aspeed-gpio-command-source | 24 ++ .../soc/aspeed/gpio-command-source.yaml | 58 ++++ drivers/soc/aspeed/Kconfig | 9 + drivers/soc/aspeed/Makefile | 1 + drivers/soc/aspeed/aspeed-command-source.c | 266 ++++++++++++++++++ 5 files changed, 358 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-aspeed-gpio-command-source create mode 100644 Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml create mode 100644 drivers/soc/aspeed/aspeed-command-source.c
Documentation/ABI/testing/sysfs-driver-aspeed-gpio-command-source new file +24 -0
@@ -0,0 +1,24 @@ +What: /sys/bus/platform/drivers/aspeed-command-source/\*command\*/bank\* +Date: August 2023 +Contact: Peter Yin <[email protected]> +Description: Get or set the gpio command source for ARM, LPC or Coprocessor CPU. + + When read, each file shows the list of available options with bank + that depends on the selected bank file. + + e.g. + get gpio command source + cd /sys/bus/platform/drivers/aspeed-command-source/ + cat 1e780000.gpio-command-source/bank_abcd + ARM ARM ARM ARM + In this case, gets bank gpio command source. + + + e.g. + set gpio command source + cd /sys/bus/platform/drivers/aspeed-command-source/ + echo "A ARM" > 1e780000.gpio-command-source/bank_abcd + or + echo "A LPC" > 1e780000.gpio-command-source/bank_abcd + or + echo "A COP" > 1e780000.gpio-command-source/bank_abcd
Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml new file +58 -0
58 lines not on this page · raw message
drivers/soc/aspeed/Kconfig +9 -0
@@ -34,6 +34,15 @@ config ASPEED_UART_ROUTING users to perform runtime configuration of the RX muxes among the UART controllers and I/O pins. +config ASPEED_COMMAND_SOURCE + tristate "ASPEED gpio command source control" + select REGMAP + select MFD_SYSCON + default ARCH_ASPEED + help + Provides a driver to control the gpio command source to ARM, + LPC or Coprocessor. + config ASPEED_P2A_CTRL tristate "ASPEED P2A (VGA MMIO to BMC) bridge control" select REGMAP
drivers/soc/aspeed/Makefile +1 -0
@@ -2,6 +2,7 @@ obj-$(CONFIG_ASPEED_LPC_CTRL) += aspeed-lpc-ctrl.o obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o obj-$(CONFIG_ASPEED_UART_ROUTING) += aspeed-uart-routing.o +obj-$(CONFIG_ASPEED_COMMAND_SOURCE) += aspeed-command-source.o obj-$(CONFIG_ASPEED_P2A_CTRL) += aspeed-p2a-ctrl.o obj-$(CONFIG_ASPEED_SOCINFO) += aspeed-socinfo.o obj-$(CONFIG_ASPEED_SBC) += aspeed-sbc.o
drivers/soc/aspeed/aspeed-command-source.c new file +266 -0
266 lines not on this page · raw message
Signature · 1 line
2.25.1
Rob Herring
maintainerQuoted 24 lines · peteryin
From: peteryin <[email protected]>
Description:
The capability to choose the GPIO command source
between ARM LPC and Coprocessor CPU is supported.Test Plan:
Get Bank gpio command source
e.g.
cd/sys/bus/platform/drivers/aspeed-command-source/cat 1e780000.gpio-command-source/bank_abcd ARM ARM ARM ARMSet Bank gpio command source.
e.g.
cd/sys/bus/platform/drivers/aspeed-command-source/echo "A ARM" > 1e780000.gpio-command-source/bank_abcd or
echo "A LPC" > 1e780000.gpio-command-source/bank_abcd or$
echo "A COP" > 1e780000.gpio-command-source/bank_abcdSigned-off-by peteryin <[email protected]>
Quoted 11 lines
--- .../sysfs-driver-aspeed-gpio-command-source | 24 ++ .../soc/aspeed/gpio-command-source.yaml | 58 ++++ drivers/soc/aspeed/Kconfig | 9 + drivers/soc/aspeed/Makefile | 1 + drivers/soc/aspeed/aspeed-command-source.c | 266 ++++++++++++++++++ 5 files changed, 358 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-aspeed-gpio-command-source create mode 100644 Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml create mode 100644 drivers/soc/aspeed/aspeed-command-source.c
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:./Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml:38:3: [error] syntax error: expected <block end>, but found '?' (syntax) ./Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml:39:6: [error] missing starting space in comment (comments)
dtschema/dtc warnings/errors:
make[2]: *** Deleting file 'Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.example.dts' Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml:38:3: expected <block end>, but found '?'
make[2]: *** [Documentation/devicetree/bindings/Makefile:26: Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.example.dts] Error 1 make[2]: *** Waiting for unfinished jobs...../Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml:38:3: expected <block end>, but found '?' /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml: ignoring, error parsing file make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1500: dt_binding_check] Error 2
make: *** [Makefile:234: __sub-make] Error 2
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230823160810.1067102-1-peteryin.openbmc at gmail.com
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Hi Peter,
Quoted 128 lines · peteryin
From: peteryin <[email protected]>
Description:
The capability to choose the GPIO command source
between ARM LPC and Coprocessor CPU is supported.Test Plan:
Get Bank gpio command source
e.g.
cd/sys/bus/platform/drivers/aspeed-command-source/cat 1e780000.gpio-command-source/bank_abcd ARM ARM ARM ARMSet Bank gpio command source.
e.g.
cd/sys/bus/platform/drivers/aspeed-command-source/echo "A ARM" > 1e780000.gpio-command-source/bank_abcd or
echo "A LPC" > 1e780000.gpio-command-source/bank_abcd or$
echo "A COP" > 1e780000.gpio-command-source/bank_abcdSigned-off-by peteryin <[email protected]>--- .../sysfs-driver-aspeed-gpio-command-source | 24 ++ .../soc/aspeed/gpio-command-source.yaml | 58 ++++ drivers/soc/aspeed/Kconfig | 9 + drivers/soc/aspeed/Makefile | 1 + drivers/soc/aspeed/aspeed-command-source.c | 266 ++++++++++++++++++ 5 files changed, 358 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-aspeed-gpio-command-source create mode 100644 Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml create mode 100644 drivers/soc/aspeed/aspeed-command-source.c(quoted diff) +0
-0a/Documentation/ABI/testing/sysfs-driver-aspeed-gpio-command-source b/Documentation/ABI/testing/sysfs-driver-aspeed-gpio-command-source new file mode 100644
index 000000000000..4698f47a1f75Documentation/ABI/testing/sysfs-driver-aspeed-gpio-command-source new file +4
-0@@ -0,0 +1,24 @@ +What: /sys/bus/platform/drivers/aspeed-command-source/\*command\*/bank\* +Date: August 2023 +Contact: Peter Yin <[email protected]> +Description: Get or set the gpio command source for ARM, LPC orCoprocessor CPU.
Documentation/ABI/testing/sysfs-driver-aspeed-gpio-command-source new file +20
-0+ + When read, each file shows the list of available options with bank + that depends on the selected bank file. + + e.g. + get gpio command source + cd /sys/bus/platform/drivers/aspeed-command-source/ + cat 1e780000.gpio-command-source/bank_abcd + ARM ARM ARM ARM + In this case, gets bank gpio command source. + + + e.g. + set gpio command source + cd /sys/bus/platform/drivers/aspeed-command-source/ + echo "A ARM" > 1e780000.gpio-command-source/bank_abcd + or + echo "A LPC" > 1e780000.gpio-command-source/bank_abcd + or + echo "A COP" > 1e780000.gpio-command-source/bank_abcd(quoted diff) +0
-0
a/Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yamlb/Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yamlnew file mode 100644
index 000000000000..034183667501
---/dev/null
+++b/Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yamlDocumentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml new file +5
-0@@ -0,0 +1,58 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# # Copyright (c) 2023 Quanta Inc. +%YAML 1.2 +--- +$id:"http://devicetree.org/schemas/soc/aspeed/gpio-command-source.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml new file +8
-0+ +title: Aspeed UART Routing Controller + +maintainers: + - Peter Yin <[email protected]> + +description: + The Aspeed gpio command source control allow to dynamically writethe inputs for
Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml new file +3
-0+ the built-in gpio command source. + + This allows, for example, to connect the gpio command source to ARMLPC or Coprocessor CPU.
Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml new file +3
-0+ e.g. let LPC port80 to connect the gpio group. + + This driver is for the BMC side. The sysfs files allow the BMCuserspace
+ which owns the system configuration policy, to configure gpio command source.Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml new file +23
-0+ +properties: + compatible: + items: + - enum: + - aspeed,ast2600-gpio-command-source + reg: + maxItems: 1 + +required: + - compatible + +additionalProperties: false + +examples: + - | + gpio0: gpio at 1e780000 { + #gpio-cells = <2>; + gpio-controller; + compatible = "aspeed,ast2600-gpio", "simple-mfd", "syscon"; + reg = <0x1e780000 0x400>; + interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>; + gpio-ranges = <&pinctrl 0 0 208>;
Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml line 54
Quoted 10 lines
Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml new file +10
-0+ ngpios = <208>; + clocks = <&syscon ASPEED_CLK_APB2>; + interrupt-controller; + #interrupt-cells = <2>; + + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x1e780000 0x400>; + gpio_command_source: gpio-command-source at 0 { + compatible = "aspeed,ast2600-gpio-command-source";
You're using the devicetree to load a specific driver rather than to describe the hardware.
The command source registers are fundamentally part of the GPIO block. As such, the kernel support for the feature should be integrated into the existing GPIO driver. It should not be necessary to add this binding to expose the feature.
Andrew
Quoted 23 lines · peteryin
From: peteryin <[email protected]>
Description:
The capability to choose the GPIO command source
between ARM LPC and Coprocessor CPU is supported.Test Plan:
Get Bank gpio command source
e.g.
cd/sys/bus/platform/drivers/aspeed-command-source/cat 1e780000.gpio-command-source/bank_abcd ARM ARM ARM ARMSet Bank gpio command source.
e.g.
cd/sys/bus/platform/drivers/aspeed-command-source/echo "A ARM" > 1e780000.gpio-command-source/bank_abcd or
echo "A LPC" > 1e780000.gpio-command-source/bank_abcd or$
echo "A COP" > 1e780000.gpio-command-source/bank_abcd
Quoted 4 lines
Signed-off-by peteryin <[email protected]>--- .../sysfs-driver-aspeed-gpio-command-source | 24 ++ .../soc/aspeed/gpio-command-source.yaml | 58 ++++
Bindings are separate patches. And it would be pointed out by checkpatch.
Please run scripts/checkpatch.pl and fix reported warnings. Some warnings can be ignored, but the code here looks like it needs a fix. Feel free to get in touch if the warning is not clear.
Please use standard email subjects, so with the PATCH keyword in the title. git format-patch helps here to create proper versioned patches. Another useful tool is b4. Skipping the PATCH keyword makes filtering of emails more difficult thus making the review process less convenient.
Quoted 44 lines
drivers/soc/aspeed/Kconfig | 9 + drivers/soc/aspeed/Makefile | 1 + drivers/soc/aspeed/aspeed-command-source.c | 266 ++++++++++++++++++ 5 files changed, 358 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-aspeed-gpio-command-source create mode 100644 Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml create mode 100644 drivers/soc/aspeed/aspeed-command-source.cDocumentation/ABI/testing/sysfs-driver-aspeed-gpio-command-source new file +24
-0@@ -0,0 +1,24 @@ +What: /sys/bus/platform/drivers/aspeed-command-source/\*command\*/bank\* +Date: August 2023 +Contact: Peter Yin <[email protected]> +Description: Get or set the gpio command source for ARM, LPC or Coprocessor CPU. + + When read, each file shows the list of available options with bank + that depends on the selected bank file. + + e.g. + get gpio command source + cd /sys/bus/platform/drivers/aspeed-command-source/ + cat 1e780000.gpio-command-source/bank_abcd + ARM ARM ARM ARM + In this case, gets bank gpio command source. + + + e.g. + set gpio command source + cd /sys/bus/platform/drivers/aspeed-command-source/ + echo "A ARM" > 1e780000.gpio-command-source/bank_abcd + or + echo "A LPC" > 1e780000.gpio-command-source/bank_abcd + or + echo "A COP" > 1e780000.gpio-command-source/bank_abcdDocumentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml new file +0
-0
Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml line 6
Quoted 6 lines
Documentation/devicetree/bindings/soc/aspeed/gpio-command-source.yaml new file +6
-0@@ -0,0 +1,58 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# # Copyright (c) 2023 Quanta Inc. +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/soc/aspeed/gpio-command-source.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
It does not look like you tested the bindings, at least after quick look. Please run make dt_binding_check (see Documentation/devicetree/bindings/writing-schema.rst for instructions). Maybe you need to update your dtschema and yamllint.
Best regards,
Krzysztof