Add Pinctrl driver for Starfive JH8100 SoC
Subsystems (5)
v2 cover Add Pinctrl driver for Starfive JH8100 SoC
Starfive JH8100 SoC consists of 4 pinctrl domains - sys_east, sys_west, sys_gmac, and aon. This patch series adds pinctrl drivers for these 4 pinctrl domains and this patch series is depending on the JH8100 base patch series in [1] and [2]. The relevant dt-binding documentation for each pinctrl domain has been updated accordingly.
[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/
---
Changes in v2:
- Add "(always-on)" to document title to clarify acronym AON.
- Replace "drive-strength" by "drive-strength-microamp".
- Update "slew-rate" property in sys-east, sys-west, and aon document.
- remove redundant "bindings" from commit subject and message.
- Change regular expression "-[0-9]+$" to "-grp$" to standardize client node names to end with suffix "-grp" instead of "-<numerical _number>".
- Use 4 spaces indentation for DTS examples.
- Update DTS examples in sys-east, sys-west, and aon document with client driver pinmuxing.
- Remove redundant syscon and gmac macros from dt-binding header file.
- Remove redundant register macros from dt-binding header file.
- Add "wakeup-gpios" and "wakeup-source" to aon document.
- Add "gpio-line-names" to sys-east and sys-west document.
- Update the description of syscon register usage in each document.
- Update sys-gmac and aon document with information of GMAC voltage. reference syscon and GMAC pad syscon.
- Fix the pinctrl device nodes compatible string too long issue.
- Move all common codes from subdrivers to the main driver.
- Change the commit log to "add main and sys_east driver" to indicate the commit of both main and sys-east driver.
- Turn pin_to_hwirq macro to a static inline function to hide gpio internal detail, and also, for easier code readability.
- Change "JH8100_PADCFG_BIAS" to "JH8100_PADCFG_BIAS_MASK".
- Change "#define JH8100_PADCFG_DS_4MA BIT(1)" to
#define JH8100_PADCFG_DS_4MA (1U << 1)".
- Replace "jh8100_gpio_request" by "pinctrl_gpio_request".
- Replace "jh8100_gpio_free" by "pinctrl_gpio_free".
- Replace "jh8100_gpio_set_config" by "gpiochip_generic_config".
- Use irq_print_chip function to display irqchip name to user space.
- Use girq to represent GPIO interrupt controller.
- Update code to ensure wakeup-gpios is always an input line.
- Remove the jh8100_gpio_add_pin_ranges function and use gpio-ranges in device tree to provide information for GPIO core to add pin range for each pinctrl.
- Change "StarFive GPIO chip registered" to "StarFive JH8100 GPIO chip registered".
---
Alex Soo (6):
dt-bindings: pinctrl: starfive: Add JH8100 pinctrl
pinctrl: starfive: jh8100: add main and sys_east driver
pinctrl: starfive: jh8100: add pinctrl driver for sys_west domain
pinctrl: starfive: jh8100: add pinctrl driver for sys_gmac domain
pinctrl: starfive: jh8100: add pinctrl driver for AON domain
riscv: dts: starfive: jh8100: add pinctrl device tree nodes
.../pinctrl/starfive,jh8100-aon-pinctrl.yaml | 261 ++++ .../starfive,jh8100-sys-east-pinctrl.yaml | 223 ++++ .../starfive,jh8100-sys-gmac-pinctrl.yaml | 163 +++ .../starfive,jh8100-sys-west-pinctrl.yaml | 220 +++ MAINTAINERS | 7 + arch/riscv/boot/dts/starfive/jh8100-evb.dts | 5 + arch/riscv/boot/dts/starfive/jh8100-pinfunc.h | 418 ++++++ arch/riscv/boot/dts/starfive/jh8100.dtsi | 47 + drivers/pinctrl/starfive/Kconfig | 59 + drivers/pinctrl/starfive/Makefile | 6 + .../starfive/pinctrl-starfive-jh8100-aon.c | 154 +++ .../pinctrl-starfive-jh8100-sys-east.c | 224 ++++ .../pinctrl-starfive-jh8100-sys-gmac.c | 93 ++ .../pinctrl-starfive-jh8100-sys-west.c | 168 +++ .../starfive/pinctrl-starfive-jh8100.c | 1181 +++++++++++++++++ .../starfive/pinctrl-starfive-jh8100.h | 105 ++ .../pinctrl/starfive,jh8100-pinctrl.h | 103 ++ 17 files changed, 3437 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-aon-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-east-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-gmac-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-west-pinctrl.yaml create mode 100644 arch/riscv/boot/dts/starfive/jh8100-pinfunc.h create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-aon.c create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-east.c create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-gmac.c create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-west.c create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100.h create mode 100644 include/dt-bindings/pinctrl/starfive,jh8100-pinctrl.h
Signature · 7 lines
2.43.0 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
RFC PATCH v2 1/6 dt-bindings: pinctrl: starfive: Add JH8100 pinctrl
Add documentation and header file for JH8100 pinctrl driver.
--- .../pinctrl/starfive,jh8100-aon-pinctrl.yaml | 261 ++++++++++++++++++ .../starfive,jh8100-sys-east-pinctrl.yaml | 223 +++++++++++++++ .../starfive,jh8100-sys-gmac-pinctrl.yaml | 163 +++++++++++ .../starfive,jh8100-sys-west-pinctrl.yaml | 220 +++++++++++++++ .../pinctrl/starfive,jh8100-pinctrl.h | 103 +++++++ 5 files changed, 970 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-aon-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-east-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-gmac-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-west-pinctrl.yaml create mode 100644 include/dt-bindings/pinctrl/starfive,jh8100-pinctrl.h
Documentation/devicetree/bindings/pinctrl/starfive,jh8100-aon-pinctrl.yaml new file +261 -0
@@ -0,0 +1,261 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pinctrl/starfive,jh8100-aon-pinctrl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH8100 AON (always-on) Pin Controller + +description: | + Pinctrl bindings for JH8100 RISC-V SoC from StarFive Technology Ltd. + + The JH8100 SoC has 4 pinctrl domains - sys_east, sys_west, sys_gmac, and aon. + This document provides an overview of the "aon" pinctrl domain. + + The "aon" domain has a pin controller which provides + - I/O multiplexing for peripheral signals specific to this domain. + - GPIO pins which support external GPIO interrupts or external wake-up. + - syscon registers to configure device I/O reference voltage. + + In the AON Pin Controller, the pins named PAD_RGPIO0 to PAD_GPIO15 can be + multiplexed and have configurable bias, drive strength, schmitt trigger etc. + Only peripherals in the AON domain can have their I/O go through the 16 + "PAD_RGPIOs". This includes I2C, UART, watchdog, eMMC, SDIO0, XSPI etc. + + All these peripherals can be connected to any of the 16 PAD_RGPIOs in such a way + that any iopad can be set up to be controlled by any of the peripherals. + + The pin muxing is illustrated by the diagram below. + _____________ + | | + RGPIO0 --------------| |--- PAD_RGPIO0 + RGPIO1 --------------| AON I/O MUX |--- PAD_RGPIO1 + ... | | ... + I2C8 SDA interface --| |--- PAD_RGPIO15 + | | + ------------- + + The AON Pin Controller provides syscon registers to configure + + 1. reference voltage of + - eMMC I/O interface + supported voltage - 1.8V + - SDIO0 I/O interface + supported voltage - 3.3V, 1.8V + - PAD_RGPIO bank + - 16 PAD_RGPIOs (PAD_RGPIO0 to PAD_GPIO15) + - all devices attached to PAD_RGPIOs must use I/O voltage 3.3V. + - XSPI I/O interface + supported voltage level - 3.3V + + Regulator supplies the device voltage, and each device has a corresponding syscon + register bit [1:0] that must be configured to indicate the device voltage level. + + +--------+--------+-------------------+ + | Bit[1] | Bit[0] | Reference Voltage | + +--------+--------+-------------------+ + | 0 | 0 | 3.3 V | + +--------+--------+-------------------+ + | 0 | 1 | 2.5 V | + +--------+--------+-------------------+ + | 1 | x | 1.8 V | + +--------+--------+-------------------+ + + 2. reference voltage and slew rate of GMAC0 + + Voltage level on GMAC0 interface is dependent on the PHY that it is pairing with. The + supported voltage levels are 3.3V, 2.5V, and 1.8V. + + GMAC0 has 2 set of syscon registers - + + 2.1 PAD_VREF_GMAC0_syscon - bit [1:0] must be configured to indicate the voltage level on + GMAC0 interface. The default setting is 3.3V. + + +--------+--------+-----------------------------------+ + | Bit[1] | Bit[0] | GMAC0 Interface Reference Voltage | + +--------+--------+-----------------------------------+ + | 0 | 0 | 3.3V | + +--------+--------+-----------------------------------+ + | 0 | 1 | 2.5V | + +--------+--------+-----------------------------------+ + | 1 | x | 1.8V | + +--------+--------+-----------------------------------+ + + 2.2 PAD_GMAC0_<SIGNAL_NAME>_syscon - each GMAC0 pad has a corresponding syscon bit [0] set + to 0 by default. When GMAC0 mode is RGMII and voltage level is 2.5V, the bit [0] must be + set to 1. + + +-------------+-----------------------+---------+ + | GMAC0 Mode | GMAC0 Voltage Level | Bit[0] | + +-------------+-----------------------+---------+ + | | 3.3V | 0 | + | |-----------------------+---------+ + | RGMII | 2.5V | 1 | + | |-----------------------+---------+ + | | 1.8V | 0 | + +-------------+-----------------------+---------+ + | | 3.3V | 0 | + | |-----------------------+---------+ + | RMII | 2.5V | 0 | + | |-----------------------+---------+ + | | 1.8V | 0 | + +-------------+-----------------------+---------+ + + the bit [2] can be used to configure GMAC0 signal slew rate, + + +--------+-----------+ + | Bit[2] | Slew Rate | + +--------+-----------+ + | 0 | Fast | + +--------+-----------+ + | 1 | Slow | + +--------+-----------+ + + Under any circumstances, the syscon register's reference voltage setting must not be + lower than the actual device voltage, otherwise, the device I/O pads will get damaged. + + Follow the guidelines below when configure reference voltage - + + To increase the device voltage, set bit [1:0] to the new operating state first before + raising the actual voltage to the higher operating point. + + To decrease the device voltage, hold bit [1:0] to the current operating state until + the actual voltage has stabilized at the lower operating point before changing the + setting. + + Alternatively, a device voltage change can always be initiated by first setting syscon + register bit [1:0] = 0, the safe 3.3V startup condition, before changing the device + voltage. Then once the actual voltage is changed and has stabilized at the new operating + point, bit [1:0] can be reset as appropriate. + +maintainers: + - Alex Soo <[email protected]> + +properties: + compatible: + oneOf: + - items: + - const: starfive,jh8100-aon-pinctrl + - const: syscon + - const: simple-mfd + + reg: + maxItems: 1 + + resets: + maxItems: 1 + + interrupts: + maxItems: 1 + + interrupt-controller: true + + gpio-controller: true + + '#gpio-cells': + const: 2 + + gpio-ranges: + maxItems: 1 + + wakeup-gpios: + maxItems: 1 + description: GPIO pin to be used for waking up the system from sleep mode. + + wakeup-source: + maxItems: 1 + description: to indicate pinctrl has wakeup capability. + +patternProperties: + '-grp$': + type: object + additionalProperties: false + patternProperties: + '-pins$': + type: object + description: | + A pinctrl node should contain at least one subnode representing the + pinctrl groups available in the domain. Each subnode will list the + pins it needs, and how they should be configured, with regard to + muxer configuration, bias, input enable/disable, input schmitt + trigger enable/disable, slew-rate and drive strength. + allOf: + - $ref: /schemas/pinctrl/pincfg-node.yaml + - $ref: /schemas/pinctrl/pinmux-node.yaml + additionalProperties: false + + properties: + pinmux: + description: | + The list of GPIOs and their mux settings or function select. + The GPIOMUX and PINMUX macros are used to configure the + I/O multiplexing and function selection respectively. + + bias-disable: true + + bias-pull-up: + type: boolean + + bias-pull-down: + type: boolean + + drive-strength-microamp: + enum: [ 2000, 4000, 8000, 12000 ] + + input-enable: true + + input-disable: true + + input-schmitt-enable: true + + input-schmitt-disable: true + + slew-rate: + enum: [ 0, 1 ] + default: 0 + description: | + 0: slow (half frequency) + 1: fast + +required: + - compatible + - reg + - resets + - interrupts + - interrupt-controller + - gpio-controller + - '#gpio-cells' + +additionalProperties: false + +examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + + pinctrl_aon: pinctrl@1f300000 { + compatible = "starfive,jh8100-aon-pinctrl", "syscon", "simple-mfd"; + reg = <0x0 0x1f300000 0x0 0x10000>; + resets = <&aoncrg 0>; + interrupts = <160>; + interrupt-controller; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl_aon 0 0 16>; + + i2c7_pins: i2c7-grp { + i2c7-scl-pins { + pinmux = <0x23265409>; + bias-pull-up; + input-enable; + }; + + i2c7-sda-pins { + pinmux = <0x2427580a>; + bias-pull-up; + input-enable; + }; + }; + }; + };
Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-east-pinctrl.yaml new file +223 -0
223 lines not on this page · raw message
Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-gmac-pinctrl.yaml new file +163 -0
163 lines not on this page · raw message
Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-west-pinctrl.yaml new file +220 -0
220 lines not on this page · raw message
include/dt-bindings/pinctrl/starfive,jh8100-pinctrl.h new file +103 -0
103 lines not on this page · raw message
Signature · 7 lines
2.43.0 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Re: [RFC PATCH v2 1/6] dt-bindings: pinctrl: starfive: Add JH8100 pinctrl
Quoted 4 lines · Alex Soo
Add documentation and header file for JH8100 pinctrl driver.
Signed-off-by Alex Soo <[email protected]>---
RFC? Why isn't this patch ready for review?
As requested, I will provide only brief review, not full one.
...
Documentation/devicetree/bindings/pinctrl/starfive,jh8100-aon-pinctrl.yaml line 136
Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/starfive,jh8100-aon-pinctrl.yaml new file +4
-0+ +properties: + compatible: + oneOf:
Drop
Quoted 39 lines
Documentation/devicetree/bindings/pinctrl/starfive,jh8100-aon-pinctrl.yaml new file +39
-0+ - items: + - const: starfive,jh8100-aon-pinctrl + - const: syscon + - const: simple-mfd + + reg: + maxItems: 1 + + resets: + maxItems: 1 + + interrupts: + maxItems: 1 + + interrupt-controller: true + + gpio-controller: true + + '#gpio-cells': + const: 2 + + gpio-ranges: + maxItems: 1 + + wakeup-gpios: + maxItems: 1 + description: GPIO pin to be used for waking up the system from sleep mode. + + wakeup-source: + maxItems: 1 + description: to indicate pinctrl has wakeup capability. + +patternProperties: + '-grp$': + type: object + additionalProperties: false + patternProperties: + '-pins$': + type: object
Documentation/devicetree/bindings/pinctrl/starfive,jh8100-aon-pinctrl.yaml line 185
Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/starfive,jh8100-aon-pinctrl.yaml new file +10
-0+ description: | + A pinctrl node should contain at least one subnode representing the + pinctrl groups available in the domain. Each subnode will list the + pins it needs, and how they should be configured, with regard to + muxer configuration, bias, input enable/disable, input schmitt + trigger enable/disable, slew-rate and drive strength. + allOf: + - $ref: /schemas/pinctrl/pincfg-node.yaml + - $ref: /schemas/pinctrl/pinmux-node.yaml + additionalProperties: false
NAK, nothing improved.
....
Quoted 7 lines
include/dt-bindings/pinctrl/starfive,jh8100-pinctrl.h new file +1
-0@@ -0,0 +1,103 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */
include/dt-bindings/pinctrl/starfive,jh8100-pinctrl.h line 11
Quoted 10 lines
include/dt-bindings/pinctrl/starfive,jh8100-pinctrl.h new file +10
-0+/* +* Copyright (C) 2023-2024 StarFive Technology Co., Ltd. +*/ + +#ifndef __DT_BINDINGS_PINCTRL_STARFIVE_JH8100_H__ +#define __DT_BINDINGS_PINCTRL_STARFIVE_JH8100_H__ + +/* sys_iomux_west pins */ +#define PAD_GPIO0_W 0 +#define PAD_GPIO1_W 1
NAK, read my comments.
Best regards,
Krzysztof
Conor Dooley
maintainerRe: [RFC PATCH v2 1/6] dt-bindings: pinctrl: starfive: Add JH8100 pinctrl
Quoted 8 lines · Krzysztof Kozlowski
Quoted 4 lines · Alex Soo
Add documentation and header file for JH8100 pinctrl driver.
Signed-off-by Alex Soo <[email protected]>---
RFC? Why isn't this patch ready for review?
The TL;DR is that Emil and I didn't want to apply the dts patches to support a platform that hadn't actually been taped out yet. For an SoC in that state, at least the bindings for, clock and pinctrl could be subject to changes before tapeou. I think putting RFC on those patches is a good idea, but of course the rationale should be mentioned.
Cheers,
Conor.
Re: [RFC PATCH v2 1/6] dt-bindings: pinctrl: starfive: Add JH8100 pinctrl
Quoted 8 lines · Conor Dooley
Quoted 7 lines · Krzysztof Kozlowski
Quoted 4 lines · Alex Soo
Add documentation and header file for JH8100 pinctrl driver.
Signed-off-by Alex Soo <[email protected]>---
Quoted 7 lines
Quoted 1 line
RFC? Why isn't this patch ready for review?
The TL;DR is that Emil and I didn't want to apply the dts patches to support a platform that hadn't actually been taped out yet. For an SoC in that state, at least the bindings for, clock and pinctrl could be subject to changes before tapeou. I think putting RFC on those patches is a good idea, but of course the rationale should be mentioned.
That would be useful information. We also could mark some bindings unstable and accept breaking ABI under certain conditions, like that it is early work without users for long time.
Best regards,
Krzysztof
Conor Dooley
maintainerRe: [RFC PATCH v2 1/6] dt-bindings: pinctrl: starfive: Add JH8100 pinctrl
Quoted 17 lines · Krzysztof Kozlowski
Quoted 8 lines · Conor Dooley
Quoted 7 lines · Krzysztof Kozlowski
Quoted 4 lines · Alex Soo
Add documentation and header file for JH8100 pinctrl driver.
Signed-off-by Alex Soo <[email protected]>---
Quoted 7 lines
Quoted 1 line
RFC? Why isn't this patch ready for review?
The TL;DR is that Emil and I didn't want to apply the dts patches to support a platform that hadn't actually been taped out yet. For an SoC in that state, at least the bindings for, clock and pinctrl could be subject to changes before tapeou. I think putting RFC on those patches is a good idea, but of course the rationale should be mentioned.
Quoted 3 lines
That would be useful information. We also could mark some bindings unstable and accept breaking ABI under certain conditions, like that it is early work without users for long time.
I don't want to discourage a vendor that's clearly doing a good job of working on things before they've even taped things out, which is why I suggested sending clocks/pinctrl as RFC until things are finalised. I'm not sure what a good way to mention this in the bindings would be, particularly for clock/pinctrl definitions where things could change "behind the back" of a user - I'm thinking things like U-Boot here.
Rob Herring
maintainerRe: [RFC PATCH v2 1/6] dt-bindings: pinctrl: starfive: Add JH8100 pinctrl
In reply to Krzysztof KozlowskiQuoted 17 lines · Krzysztof Kozlowski
Quoted 8 lines · Conor Dooley
Quoted 7 lines · Krzysztof Kozlowski
Quoted 4 lines · Alex Soo
Add documentation and header file for JH8100 pinctrl driver.
Signed-off-by Alex Soo <[email protected]>---
Quoted 7 lines
Quoted 1 line
RFC? Why isn't this patch ready for review?
The TL;DR is that Emil and I didn't want to apply the dts patches to support a platform that hadn't actually been taped out yet. For an SoC in that state, at least the bindings for, clock and pinctrl could be subject to changes before tapeou. I think putting RFC on those patches is a good idea, but of course the rationale should be mentioned.
Quoted 3 lines
That would be useful information. We also could mark some bindings unstable and accept breaking ABI under certain conditions, like that it is early work without users for long time.
The challenge with that is when do things get marked stable? No one has any motivation to do that (unless users complain). For example, We have a couple of platforms that have an unstable bindings statement that has been there "forever".
I would like a solution though. The only idea I have is passing SystemReady cert, but that's an Arm thing.
Rob
Re: [RFC PATCH v2 1/6] dt-bindings: pinctrl: starfive: Add JH8100 pinctrl
Quoted 18 lines · Rob Herring
Quoted 17 lines · Krzysztof Kozlowski
Quoted 15 lines · Conor Dooley
Quoted 8 lines · Krzysztof Kozlowski
Quoted 4 lines · Alex Soo
Add documentation and header file for JH8100 pinctrl driver.
Signed-off-by Alex Soo <[email protected]>---
RFC? Why isn't this patch ready for review?
The TL;DR is that Emil and I didn't want to apply the dts patches to support a platform that hadn't actually been taped out yet. For an SoC in that state, at least the bindings for, clock and pinctrl could be subject to changes before tapeou. I think putting RFC on those patches is a good idea, but of course the rationale should be mentioned.
Quoted 8 lines
Quoted 3 lines
That would be useful information. We also could mark some bindings unstable and accept breaking ABI under certain conditions, like that it is early work without users for long time.
The challenge with that is when do things get marked stable? No one has any motivation to do that (unless users complain). For example, We have a couple of platforms that have an unstable bindings statement that has been there "forever".
I see. Let's see what I can do for existing "unstable" platforms, but your argument makes sense - rarely people remember to un-unstable bindings and there aren't that many incentives for maintainer to do so.
Quoted 3 lines
I would like a solution though. The only idea I have is passing SystemReady cert, but that's an Arm thing.
Best regards,
Krzysztof
Conor Dooley
maintainerRe: [RFC PATCH v2 1/6] dt-bindings: pinctrl: starfive: Add JH8100 pinctrl
Quoted 2 lines · Krzysztof Kozlowski
Quoted 2 lines
I would like a solution though. The only idea I have is passing SystemReady cert, but that's an Arm thing.
I don't know jack about SystemReady - I had it in my head that it was a system level certification. I am wondering how you think that SystemReady certification would apply to a whole binding (I can see it being a per-compatible thing, but that would be a mess I am sure).
Rob Herring
maintainerRe: [RFC PATCH v2 1/6] dt-bindings: pinctrl: starfive: Add JH8100 pinctrl
Quoted 5 lines · Conor Dooley
Quoted 2 lines · Krzysztof Kozlowski
Quoted 2 lines
I would like a solution though. The only idea I have is passing SystemReady cert, but that's an Arm thing.
I don't know jack about SystemReady
AIUI, Risc-V is working on something similar...
The primary intent of it is to enable installing off-the-shelf OSs.
Quoted 4 lines
- I had it in my head that it was a
system level certification. I am wondering how you think that SystemReady certification would apply to a whole binding (I can see it being a per-compatible thing, but that would be a mess I am sure).
There's a lot of pieces, but I'll stick to the DT aspects (which is SystemReady IR band). Certification applies to a specific firmware build (which includes the DTB) on a specific board. The testing requirements at the moment (for 2.x) are every binding (compatible) must have a schema, but warnings are allowed.
So a "stable" tag would apply to a DTS as a whole. That of course implies that everything within the DTS is stable too.
One wrinkle is that SR has no direct requirement that the DTB come from anything upstream. Indirectly, the schemas must exist and be upstream (or acked on the lists) and various distro kernels have to actually boot. For that reason, if we had some tag, it would have to be distinct from SR.
Rob
Conor Dooley
maintainerRe: [RFC PATCH v2 1/6] dt-bindings: pinctrl: starfive: Add JH8100 pinctrl
Quoted 8 lines · Rob Herring
Quoted 5 lines · Conor Dooley
Quoted 2 lines · Krzysztof Kozlowski
Quoted 2 lines
I would like a solution though. The only idea I have is passing SystemReady cert, but that's an Arm thing.
I don't know jack about SystemReady
AIUI, Risc-V is working on something similar...
Probably, but there's a few other things they need to ratify first w.r.t. booting before they're at the point of implementing something like SR. They still seem to think they need to invent their own discovery mechanism, so my hopes aren't super high for what they produce.
Quoted 8 lines
The primary intent of it is to enable installing off-the-shelf OSs.
Quoted 4 lines
- I had it in my head that it was a
system level certification. I am wondering how you think that SystemReady certification would apply to a whole binding (I can see it being a per-compatible thing, but that would be a mess I am sure).
Quoted 8 lines
There's a lot of pieces, but I'll stick to the DT aspects (which is SystemReady IR band). Certification applies to a specific firmware build (which includes the DTB) on a specific board. The testing requirements at the moment (for 2.x) are every binding (compatible) must have a schema, but warnings are allowed.
So a "stable" tag would apply to a DTS as a whole. That of course implies that everything within the DTS is stable too.
Right, so it would be on a per-compatible basis then. I guess not altogether different from marking a compatible deprecated.
Quoted 5 lines
One wrinkle is that SR has no direct requirement that the DTB come from anything upstream. Indirectly, the schemas must exist and be upstream (or acked on the lists) and various distro kernels have to actually boot. For that reason, if we had some tag, it would have to be distinct from SR.
And for the reason that other architectures may want to use it I suppose!
RFC PATCH v2 2/6 pinctrl: starfive: jh8100: add main and sys_east driver
In reply to Alex SooAdd JH8100 pinctrl main and sys_east domain driver.
--- drivers/pinctrl/starfive/Kconfig | 21 + drivers/pinctrl/starfive/Makefile | 3 + .../pinctrl-starfive-jh8100-sys-east.c | 224 ++++ .../starfive/pinctrl-starfive-jh8100.c | 1181 +++++++++++++++++ .../starfive/pinctrl-starfive-jh8100.h | 94 ++ 5 files changed, 1523 insertions(+) create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-east.c create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100.h
drivers/pinctrl/starfive/Kconfig +21 -0
@@ -49,3 +49,24 @@ config PINCTRL_STARFIVE_JH7110_AON This also provides an interface to the GPIO pins not used by other peripherals supporting inputs, outputs, configuring pull-up/pull-down and interrupts on input changes. + +config PINCTRL_STARFIVE_JH8100 + bool + select GENERIC_PINCONF + select GENERIC_PINCTRL_GROUPS + select GENERIC_PINMUX_FUNCTIONS + select GPIOLIB + select GPIOLIB_IRQCHIP + select OF_GPIO + +config PINCTRL_STARFIVE_JH8100_SYS_EAST + tristate "StarFive JH8100 SoC System IOMUX-East pinctrl and GPIO driver" + depends on ARCH_STARFIVE || COMPILE_TEST + depends on OF + select PINCTRL_STARFIVE_JH8100 + default ARCH_STARFIVE + help + Say yes here to support system iomux-east pin control on the StarFive JH8100 SoC. + This also provides an interface to the GPIO pins not used by other + peripherals supporting inputs, outputs, configuring pull-up/pull-down + and interrupts on input changes.
drivers/pinctrl/starfive/Makefile +3 -0
@@ -5,3 +5,6 @@ obj-$(CONFIG_PINCTRL_STARFIVE_JH7100) += pinctrl-starfive-jh7100.o obj-$(CONFIG_PINCTRL_STARFIVE_JH7110) += pinctrl-starfive-jh7110.o obj-$(CONFIG_PINCTRL_STARFIVE_JH7110_SYS) += pinctrl-starfive-jh7110-sys.o obj-$(CONFIG_PINCTRL_STARFIVE_JH7110_AON) += pinctrl-starfive-jh7110-aon.o + +obj-$(CONFIG_PINCTRL_STARFIVE_JH8100) += pinctrl-starfive-jh8100.o +obj-$(CONFIG_PINCTRL_STARFIVE_JH8100_SYS_EAST) += pinctrl-starfive-jh8100-sys-east.o
drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-east.c new file +224 -0
224 lines not on this page · raw message
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c new file +1181 -0
1,181 lines not on this page · raw message
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.h new file +94 -0
94 lines not on this page · raw message
Signature · 7 lines
2.43.0 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Re: [RFC PATCH v2 2/6] pinctrl: starfive: jh8100: add main and sys_east driver
Thanks Alex,
this new version is much improved!
Quoted 3 lines · Alex Soo
Add JH8100 pinctrl main and
sys_eastdomain driver.Signed-off-by Alex Soo <[email protected]>
This commit message should at least explain what we are adding here, that it's a core driver that will be used by all the domains, what the SoC is etc etc.
Quoted 1 line
+ select
GPIOLIB_IRQCHIP
(...)
drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-east.c line 20
Quoted 3 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-east.c new file +3
-0+#include "../core.h" +#include "../pinmux.h" +#include "../pinconf.h"
Do you really need to poke around in the internals like this?
Please explain for each cross-include *why* you need to do this.
Quoted 1 line
+++
b/drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c
(...)
Quoted 1 line
+#include <
linux/of_gpio.h>
Never use this include. It is legacy and you should not be using it. Use <linux/gpio/consumer.h> solely. See comments below.
Quoted 1 line
+#include <
linux/pinctrl/consumer.h>
Why?
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c line 40
Quoted 4 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c new file +4
-0+#include "../core.h" +#include "../pinctrl-utils.h" +#include "../pinmux.h" +#include "../pinconf.h"
Again all this. Explain for each one exactly why you need this.
Quoted 4 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c new file +4
-0+static int jh8100_gpio_irq_setup (struct device *dev,struct jh8100_pinctrl *sfp) +{ +struct device_node *np = dev->of_node; +struct gpio_irq_chip *girq = &sfp->gc.irq;
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c line 926
Quoted 10 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c new file +10
-0+struct gpio_desc *gpiod; +struct irq_desc *desc; +irq_hw_number_t hwirq; +int i, ret; +int dir; + +if (!girq->domain) { + sfp->irq_domain =irq_domain_add_linear (np, sfp->gc.ngpio, + &irq_domain_simple_ops, + sfp);
When would this happen? I don't quite get it.
It looks like a probe order issue or something.
Quoted 6 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c new file +6
-0+ }else { + sfp->irq_domain = girq->domain; + } + +if (!sfp->irq_domain) { +dev_err (dev,"Couldn't allocate IRQ domain\n" );
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c line 942
Quoted 10 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c new file +10
-0+return -ENXIO ; + } + +for (i =0 ; i < sfp->gc.ngpio; i++) { +int virq =irq_create_mapping (sfp->irq_domain, i); + +irq_set_chip_and_handler (virq, &jh8100_irq_chip, + handle_edge_irq); +irq_set_chip_data (virq, &sfp->gc); + }
This duplicates core gpiolib irqchip handling, which you select using select GPIOLIB_IRQCHIP.
Can you please look into just using the gpiolib irqchip handling?
Quoted 1 line
+
sfp->wakeup_gpio=of_get_named_gpio(np, "wakeup-gpios", 0);
No using <linux/of_gpio.h> please.
Use just <linux/gpio/consumer.h> and something like:
struct gpio_desc *wakeup;
wakeup = devm_gpiod_get_optional(dev, "wakeup", GPIOD_IN);
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c line 949
Quoted 4 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c new file +4
-0+if (gpio_is_valid (sfp->wakeup_gpio)) { + hwirq =pin_to_hwirq (sfp); + sfp->wakeup_irq =irq_find_mapping (sfp->irq_domain, hwirq); + desc =irq_to_desc (sfp->wakeup_irq);
if (wakeup) {
irq = gpiod_to_irq(wakeup);
.. convert to irq descriptor etc...
Actually: is this wakeup handling something we would like to add to the gpiolib irqchip so everyone can reuse it?
In gpiochip_add_irqchip()?
At least give it a thought.
Yours,
Linus Walleij
RE: [RFC PATCH v2 2/6] pinctrl: starfive: jh8100: add main and sys_east driver
Quoted 22 lines
-----Original Message-----
From: Linus Walleij <[email protected]>
Sent: Thursday, February 29, 2024 9:03 PM
To: Yuklin Soo <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>; Hal Feng <[email protected]>; Leyfoon Tan <[email protected]>; Jianlong Huang <[email protected]>; Emil Renner Berthing <[email protected]>; Rob Herring <[email protected]>; Krzysztof Kozlowski <[email protected]>; Conor Dooley <[email protected]>; Drew Fustini <[email protected]>; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; Paul Walmsley <[email protected]>; Palmer Dabbelt <[email protected]>; Albert Ou <[email protected]>
Subject: Re: [RFC PATCH v2 2/6] pinctrl: starfive: jh8100: add main andsys_eastdriverThanks Alex,
this new version is much improved!
Quoted 8 lines
Quoted 3 lines · Alex Soo
Add JH8100 pinctrl main and
sys_eastdomain driver.Signed-off-by Alex Soo <[email protected]>This commit message should at least explain what we are adding here, that it's a core driver that will be used by all the domains, what the SoC is etc etc.
Will update the commit message of the main driver and sys_east domain subdriver to to inform what SoC they are running on, and to explain that the main driver provides common APIs to all the domain subdrivers to perform their respective tasks, and how the main driver and domain drivers work together.
Quoted 10 lines
Quoted 2 lines
+ select
GPIOLIB_IRQCHIP(...)
drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-east.c line 20
Quoted 3 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-east.c new file +3
-0+#include "../core.h" +#include "../pinmux.h" +#include "../pinconf.h" Do you really need to poke around in the internals like this?
Please explain for each cross-include *why* you need to do this.
For subdrivers: “aon”, “sys-east”, “sys-west”, and ”sys-gmac” :
The cross-include “../pinmux.h” and “../pinconf.h” are redundant.
The cross-include “../core.h” provides reference to functions:
int pinctrl_force_sleep(struct pinctrl_dev *pctldev); int pinctrl_force_default(struct pinctrl_dev *pctldev);
Remove all cross-include “../core.h”, "../pinmux.h" and "../pinconf.h" from the subdrivers, and move "#include "../core.h" to driver header file “pinctrl-starfive-jh8100.h”.
Quoted 7 lines
Quoted 2 lines
+++
b/drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c(...)
Quoted 1 line
+#include <
linux/of_gpio.h>Never use this include. It is legacy and you should not be using it. Use <
linux/gpio/consumer.h> solely. See comments below.
The header <linux/of_gpio.h> is removed and use only the gpiod interfaces in <linux/gpio/consumer.h>.
Quoted 11 lines
Quoted 2 lines
+#include <
linux/pinctrl/consumer.h>Why?
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c line 40
Quoted 4 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c new file +4
-0+#include "../core.h" +#include "../pinctrl-utils.h" +#include "../pinmux.h" +#include "../pinconf.h" Again all this. Explain for each one exactly why you need this.
Cross-includes:
“../core.h” --
provides definitions for “struct pinctrl_dev” and “struct group_desc”.
also, provides reference to functions:
pinctrl_generic_get_group_countpinctrl_generic_get_group_namepinctrl_generic_get_group_pinspinctrl_generic_get_grouppinctrl_generic_add_group
Suggest to move “../core.h” to the driver header file “pinctrl-starfive-jh8100.h”
“../pinctrl-utils.h” --
provides reference to function:
pinctrl_utils_free_map
Suggest removing “../pinctrl-utils.h” and add the “pinctrl_utils_free_map” function prototype to the driver header file “pinctrl-starfive-jh8100.h”.
“../pinmux.h” –
provides reference to functions:
pinmux_generic_get_function_countpinmux_generic_get_function_namepinmux_generic_get_function_groupspinmux_generic_add_function
Suggest removing “../pinmux.h” and add the above “pinmux_generic_*” function prototypes to the driver header file “pinctrl-starfive-jh8100.h”.
“../pinconf.h” –
provides reference to function:
pinconf_generic_parse_dt_config
Suggest removing “../pinconf.h” and add the above “pinconf_generic_parse_dt_config” function prototype to driver header file “pinctrl-starfive-jh8100.h”.
Quoted 18 lines
Quoted 5 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c new file +4
-0+static int jh8100_gpio_irq_setup (struct device *dev,struct +jh8100_pinctrl *sfp) { +struct device_node *np = dev->of_node; +struct gpio_irq_chip *girq = &sfp->gc.irq;drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c line 926
Quoted 10 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c new file +10
-0+struct gpio_desc *gpiod; +struct irq_desc *desc; +irq_hw_number_t hwirq; +int i, ret; +int dir; + +if (!girq->domain) { + sfp->irq_domain =irq_domain_add_linear (np, sfp->gc.ngpio, + &irq_domain_simple_ops, + sfp);When would this happen? I don't quite get it.
Quoted 1 line
It looks like a probe order issue or something.
This condition is unlikely to happen. Will remove this if statement.
Quoted 21 lines
Quoted 7 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c new file +6
-0+ }else { + sfp->irq_domain = girq->domain; + } + +if (!sfp->irq_domain) { +dev_err (dev,"Couldn't allocate IRQ domain\n" );drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c line 942
Quoted 10 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c new file +10
-0+return -ENXIO ; + } + +for (i =0 ; i < sfp->gc.ngpio; i++) { +int virq =irq_create_mapping (sfp->irq_domain, i); + +irq_set_chip_and_handler (virq, &jh8100_irq_chip, + handle_edge_irq); +irq_set_chip_data (virq, &sfp->gc); + }This duplicates core gpiolib irqchip handling, which you select using select
GPIOLIB_IRQCHIP.
Quoted 1 line
Can you please look into just using the gpiolib irqchip handling?
Yes, will use the gpiolib irqchip handling. Please see the implementation in function gpiochip_wakeup_irq_setup() in drivers/gpio/gpiolib.c.
Quoted 9 lines
Quoted 2 lines
+
sfp->wakeup_gpio=of_get_named_gpio(np, "wakeup-gpios", 0);No using <
linux/of_gpio.h> please.Use just <
linux/gpio/consumer.h> and something like:struct
gpio_desc*wakeup;
wakeup =devm_gpiod_get_optional(dev, "wakeup", GPIOD_IN);
Will use only descriptor-based interface to handle the wakeup_gpio since the integer-based interface is obsolete. Please see the implementation in function gpiochip_wakeup_irq_setup() in drivers/gpio/gpiolib.c.
Quoted 6 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c line 949
Quoted 5 lines
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c new file +4
-0+if (gpio_is_valid (sfp->wakeup_gpio)) { + hwirq =pin_to_hwirq (sfp); + sfp->wakeup_irq =irq_find_mapping (sfp->irq_domain, hwirq); + desc =irq_to_desc (sfp->wakeup_irq);
Quoted 8 lines
if (wakeup) {
irq =gpiod_to_irq(wakeup);
.. convert to irq descriptor etc...Actually: is this wakeup handling something we would like to add to the gpiolib irqchip so everyone can reuse it?
Ingpiochip_add_irqchip()?
At least give it a thought.
I have removed the function jh8100_gpio_irq_setup() and the GPIO wakeup irq enablement in probe function from the main driver.
The function gpiochip_wakeup_irq_setup() is created in gpiolib core "drivers/gpio/gpiolib.c" as a replacement of the codes removed from the main driver. This function is a wakeup handling that automatically set up the gpio wakeup irq if user had the “wakeup-source” and “wakeup-gpios” properties defined in their device tree.
Initially, I tried to call gpiochip_wakeup_irq_setup() from function gpiochip_add_irqchip(), but gpiod_to_irq() returns -517 (EPROBE_DEFER) when convert hwirq to virq. Eventually, this function is called at the end of function gpiochip_add_data_with_key(). The testing showed that when the GPIO logic level is toggled, the interrupt triggered can wake up the system from sleep.
Quoted 3 lines
Yours,
Linus Walleij
RFC PATCH v2 3/6 pinctrl: starfive: jh8100: add pinctrl driver for sys_west domain
In reply to Alex SooAdd pinctrl driver for sys_west domain.
--- drivers/pinctrl/starfive/Kconfig | 12 ++ drivers/pinctrl/starfive/Makefile | 1 + .../pinctrl-starfive-jh8100-sys-west.c | 168 ++++++++++++++++++ .../starfive/pinctrl-starfive-jh8100.h | 4 + 4 files changed, 185 insertions(+) create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-west.c
drivers/pinctrl/starfive/Kconfig +12 -0
@@ -70,3 +70,15 @@ config PINCTRL_STARFIVE_JH8100_SYS_EAST This also provides an interface to the GPIO pins not used by other peripherals supporting inputs, outputs, configuring pull-up/pull-down and interrupts on input changes. + +config PINCTRL_STARFIVE_JH8100_SYS_WEST + tristate "StarFive JH8100 SoC System IOMUX-West pinctrl and GPIO driver" + depends on ARCH_STARFIVE || COMPILE_TEST + depends on OF + select PINCTRL_STARFIVE_JH8100 + default ARCH_STARFIVE + help + Say yes here to support system iomux-west pin control on the StarFive JH8100 SoC. + This also provides an interface to the GPIO pins not used by other + peripherals supporting inputs, outputs, configuring pull-up/pull-down + and interrupts on input changes.
drivers/pinctrl/starfive/Makefile +1 -0
@@ -8,3 +8,4 @@ obj-$(CONFIG_PINCTRL_STARFIVE_JH7110_AON) += pinctrl-starfive-jh7110-aon.o obj-$(CONFIG_PINCTRL_STARFIVE_JH8100) += pinctrl-starfive-jh8100.o obj-$(CONFIG_PINCTRL_STARFIVE_JH8100_SYS_EAST) += pinctrl-starfive-jh8100-sys-east.o +obj-$(CONFIG_PINCTRL_STARFIVE_JH8100_SYS_WEST) += pinctrl-starfive-jh8100-sys-west.o
drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-west.c new file +168 -0
168 lines not on this page · raw message
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.h +4 -0
@@ -13,10 +13,13 @@#include <linux/pinctrl/pinconf-generic.h> #include <linux/pinctrl/pinmux.h> +#define JH8100_SYS_W_DOMAIN_NAME "jh8100-sys-west"#define JH8100_SYS_E_DOMAIN_NAME "jh8100-sys-east" +#define JH8100_SYS_W_REG_NUM 44#define JH8100_SYS_E_REG_NUM 116 +#define JH8100_SYS_W_GPO_PDA_00_15_CFG 0x074#define JH8100_SYS_E_GPO_PDA_00_47_CFG 0x114struct jh8100_pinctrl {
@@ -29,6 +32,7 @@ struct jh8100_pinctrl {/* register read/write mutex */ struct mutex mutex;const struct jh8100_pinctrl_domain_info *info; +unsigned int jh8100_sys_west_regs[JH8100_SYS_W_REG_NUM ];unsigned int jh8100_sys_east_regs[JH8100_SYS_E_REG_NUM ];/* wakeup */ int wakeup_gpio;
Signature · 7 lines
2.43.0 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
RFC PATCH v2 4/6 pinctrl: starfive: jh8100: add pinctrl driver for sys_gmac domain
In reply to Alex SooAdd pinctrl driver for sys_gmac domain.
--- drivers/pinctrl/starfive/Kconfig | 12 +++ drivers/pinctrl/starfive/Makefile | 1 + .../pinctrl-starfive-jh8100-sys-gmac.c | 93 +++++++++++++++++++ .../starfive/pinctrl-starfive-jh8100.h | 3 + 4 files changed, 109 insertions(+) create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-gmac.c
drivers/pinctrl/starfive/Kconfig +12 -0
@@ -82,3 +82,15 @@ config PINCTRL_STARFIVE_JH8100_SYS_WEST This also provides an interface to the GPIO pins not used by other peripherals supporting inputs, outputs, configuring pull-up/pull-down and interrupts on input changes. + +config PINCTRL_STARFIVE_JH8100_SYS_GMAC + tristate "StarFive JH8100 SoC System IOMUX-GMAC pinctrl and GPIO driver" + depends on ARCH_STARFIVE || COMPILE_TEST + depends on OF + select PINCTRL_STARFIVE_JH8100 + default ARCH_STARFIVE + help + Say yes here to support system iomux-gmac pin control on the StarFive JH8100 SoC. + This provides syscon registers to indicate voltage level on SDIO1/GMAC1, to indicate + GMAC1 pads voltage level under different GMAC interface modes, and to configure + GMAC1 interface slew rate.
drivers/pinctrl/starfive/Makefile +1 -0
@@ -9,3 +9,4 @@ obj-$(CONFIG_PINCTRL_STARFIVE_JH7110_AON) += pinctrl-starfive-jh7110-aon.o obj-$(CONFIG_PINCTRL_STARFIVE_JH8100) += pinctrl-starfive-jh8100.o obj-$(CONFIG_PINCTRL_STARFIVE_JH8100_SYS_EAST) += pinctrl-starfive-jh8100-sys-east.o obj-$(CONFIG_PINCTRL_STARFIVE_JH8100_SYS_WEST) += pinctrl-starfive-jh8100-sys-west.o +obj-$(CONFIG_PINCTRL_STARFIVE_JH8100_SYS_GMAC) += pinctrl-starfive-jh8100-sys-gmac.o
drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-gmac.c new file +93 -0
93 lines not on this page · raw message
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.h +3 -0
@@ -15,9 +15,11 @@#define JH8100_SYS_W_DOMAIN_NAME "jh8100-sys-west"#define JH8100_SYS_E_DOMAIN_NAME "jh8100-sys-east" +#define JH8100_SYS_G_DOMAIN_NAME "jh8100-sys-gmac"#define JH8100_SYS_W_REG_NUM 44#define JH8100_SYS_E_REG_NUM 116 +#define JH8100_SYS_G_REG_NUM 19#define JH8100_SYS_W_GPO_PDA_00_15_CFG 0x074#define JH8100_SYS_E_GPO_PDA_00_47_CFG 0x114
@@ -34,6 +36,7 @@ struct jh8100_pinctrl {const struct jh8100_pinctrl_domain_info *info;unsigned int jh8100_sys_west_regs[JH8100_SYS_W_REG_NUM ];unsigned int jh8100_sys_east_regs[JH8100_SYS_E_REG_NUM ]; +unsigned int jh8100_sys_gmac_regs[JH8100_SYS_G_REG_NUM ];/* wakeup */ int wakeup_gpio;int wakeup_irq;
Signature · 7 lines
2.43.0 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
RFC PATCH v2 5/6 pinctrl: starfive: jh8100: add pinctrl driver for AON domain
In reply to Alex SooAdd pinctrl driver for AON (always-on) domain.
--- MAINTAINERS | 7 + drivers/pinctrl/starfive/Kconfig | 14 ++ drivers/pinctrl/starfive/Makefile | 1 + .../starfive/pinctrl-starfive-jh8100-aon.c | 154 ++++++++++++++++++ .../starfive/pinctrl-starfive-jh8100.h | 4 + 5 files changed, 180 insertions(+) create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-aon.c
MAINTAINERS +7 -0
@@ -20975,6 +20975,13 @@ S: Maintained F: drivers/reset/starfive/reset-starfive-jh81* F: include/dt-bindings/reset/starfive?jh81*.h +STARFIVE JH8100 PINCTRL DRIVERS +M: Alex Soo <[email protected]> +S: Supported +F: Documentation/devicetree/bindings/pinctrl/starfive,jh81*.yaml +F: drivers/pinctrl/starfive/pinctrl-starfive-jh81* +F: include/dt-bindings/pinctrl/starfive,jh8100-pinctrl.h + STATIC BRANCH/CALL M: Peter Zijlstra <[email protected]> M: Josh Poimboeuf <[email protected]>
drivers/pinctrl/starfive/Kconfig +14 -0
@@ -94,3 +94,17 @@ config PINCTRL_STARFIVE_JH8100_SYS_GMAC This provides syscon registers to indicate voltage level on SDIO1/GMAC1, to indicate GMAC1 pads voltage level under different GMAC interface modes, and to configure GMAC1 interface slew rate. + +config PINCTRL_STARFIVE_JH8100_AON + tristate "Always-on pinctrl and GPIO driver for the StarFive JH8100 SoC" + depends on ARCH_STARFIVE || COMPILE_TEST + depends on OF + select PINCTRL_STARFIVE_JH8100 + default ARCH_STARFIVE + help + Say yes here to support always-on pin control on the StarFive JH8100 SoC. + This provides an interface to the RGPIO pins not used by other peripherals + supporting inputs, outputs, configuring pull-up/pull-down and interrupts + on input changes. And also, the syscon registers to indicate voltage level + on eMMC/SDIO0/XSPI/RGPIOs/GMAC0, to indicate GMAC0 pads voltage level under + different GMAC interface modes, and to configure GMAC0 interface slew rate.
drivers/pinctrl/starfive/Makefile +1 -0
@@ -10,3 +10,4 @@ obj-$(CONFIG_PINCTRL_STARFIVE_JH8100) += pinctrl-starfive-jh8100.o obj-$(CONFIG_PINCTRL_STARFIVE_JH8100_SYS_EAST) += pinctrl-starfive-jh8100-sys-east.o obj-$(CONFIG_PINCTRL_STARFIVE_JH8100_SYS_WEST) += pinctrl-starfive-jh8100-sys-west.o obj-$(CONFIG_PINCTRL_STARFIVE_JH8100_SYS_GMAC) += pinctrl-starfive-jh8100-sys-gmac.o +obj-$(CONFIG_PINCTRL_STARFIVE_JH8100_AON) += pinctrl-starfive-jh8100-aon.o
drivers/pinctrl/starfive/pinctrl-starfive-jh8100-aon.c new file +154 -0
154 lines not on this page · raw message
drivers/pinctrl/starfive/pinctrl-starfive-jh8100.h +4 -0
@@ -16,13 +16,16 @@#define JH8100_SYS_W_DOMAIN_NAME "jh8100-sys-west"#define JH8100_SYS_E_DOMAIN_NAME "jh8100-sys-east"#define JH8100_SYS_G_DOMAIN_NAME "jh8100-sys-gmac" +#define JH8100_AON_DOMAIN_NAME "jh8100-aon"#define JH8100_SYS_W_REG_NUM 44#define JH8100_SYS_E_REG_NUM 116#define JH8100_SYS_G_REG_NUM 19 +#define JH8100_AON_REG_NUM 65#define JH8100_SYS_W_GPO_PDA_00_15_CFG 0x074#define JH8100_SYS_E_GPO_PDA_00_47_CFG 0x114 +#define JH8100_AON_GPO_PDA_00_15_CFG 0x90struct jh8100_pinctrl {struct device *dev;
@@ -37,6 +40,7 @@ struct jh8100_pinctrl {unsigned int jh8100_sys_west_regs[JH8100_SYS_W_REG_NUM ];unsigned int jh8100_sys_east_regs[JH8100_SYS_E_REG_NUM ];unsigned int jh8100_sys_gmac_regs[JH8100_SYS_G_REG_NUM ]; +unsigned int jh8100_aon_regs[JH8100_AON_REG_NUM ];/* wakeup */ int wakeup_gpio;int wakeup_irq;
Signature · 7 lines
2.43.0 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
RFC PATCH v2 6/6 riscv: dts: starfive: jh8100: add pinctrl device tree nodes
In reply to Alex SooAdd pinctrl_east/pinctrl_west/pinctrl_gmac/pinctrl_aon device tree nodes for JH8100 SoC.
--- arch/riscv/boot/dts/starfive/jh8100-evb.dts | 5 + arch/riscv/boot/dts/starfive/jh8100-pinfunc.h | 418 ++++++++++++++++++ arch/riscv/boot/dts/starfive/jh8100.dtsi | 47 ++ 3 files changed, 470 insertions(+) create mode 100644 arch/riscv/boot/dts/starfive/jh8100-pinfunc.h
arch/riscv/boot/dts/starfive/jh8100-evb.dts +5 -0
@@ -26,3 +26,8 @@ memory@40000000 { &uart0 { status = "okay"; }; + +&pinctrl_aon { + wakeup-gpios = <&pinctrl_aon PAD_RGPIO1 GPIO_ACTIVE_HIGH>; + wakeup-source; +};
arch/riscv/boot/dts/starfive/jh8100-pinfunc.h new file +418 -0
418 lines not on this page · raw message
arch/riscv/boot/dts/starfive/jh8100.dtsi +47 -0
77 lines not on this page · raw message
Signature · 7 lines
2.43.0 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv