Add SPI module for StarFive JH7110 SoC
Subsystems (5)
v2 cover Add SPI module for StarFive JH7110 SoC
Hi,
This patchset adds initial rudimentary support for the StarFive SPI controller. And this driver will be used in StarFive's VisionFive 2 board. The first patch constrain minItems of clocks for JH7110 SPI and Patch 2 adds support for StarFive JH7110 SPI.
Changes v1->v2:
- Rebaed to v6.5rc1.
- Submitted reference file separately.
- Dropped 'status' node as it was 'okay' by default.
- Dropped Co-developed-by message.
The patch series is based on v6.5rc1.
William Qiu (3):
dt-bindings: spi: add reference file to YAML
dt-bindings: spi: constrain minItems of clocks and clock-names
riscv: dts: starfive: Add spi node for JH7110 SoC
.../devicetree/bindings/spi/spi-pl022.yaml | 11 ++- .../jh7110-starfive-visionfive-2.dtsi | 50 ++++++++++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 98 +++++++++++++++++++ 3 files changed, 156 insertions(+), 3 deletions(-)
--
2.34.1
PATCH v2 1/3 dt-bindings: spi: add reference file to YAML
Add primecell.yaml as a refereence file to YAML.
--- Documentation/devicetree/bindings/spi/spi-pl022.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/spi/spi-pl022.yaml +1 -0
@@ -11,6 +11,7 @@ maintainers: allOf: - $ref: spi-controller.yaml# + - $ref: /schemas/arm/primecell.yaml# # We need a select here so we don't match all nodes with 'arm,primecell' select:
Signature · 1 line
2.34.1
Re: [PATCH v2 1/3] dt-bindings: spi: add reference file to YAML
Quoted 1 line · William Qiu
Add
primecell.yamlas a refereence file to YAML.
This we see from the diff, but why you are doing it? Please provide rationale and answer to "why" in your commits.
Also typo: reference.
Quoted 11 lines
Signed-off-by William Qiu <[email protected]>--- Documentation/devicetree/bindings/spi/spi-pl022.yaml | 1 + 1 file changed, 1 insertion(+)Documentation/devicetree/bindings/spi/spi-pl022.yaml +0
-0
Documentation/devicetree/bindings/spi/spi-pl022.yaml maintainers: · line 17
Quoted 7 lines
Documentation/devicetree/bindings/spi/spi-pl022.yaml +1
-0@@ -11,6 +11,7 @@ maintainers: allOf: - $ref: spi-controller.yaml# + - $ref: /schemas/arm/primecell.yaml# # We need a select here so we don't match all nodes with 'arm,primecell' select:
Best regards,
Krzysztof
Re: [PATCH v2 1/3] dt-bindings: spi: add reference file to YAML
Quoted 24 lines · Krzysztof Kozlowski
Quoted 1 line · William Qiu
Add
primecell.yamlas a refereence file to YAML.This we see from the diff, but why you are doing it? Please provide rationale and answer to "why" in your commits.
Also typo: reference.
Quoted 16 lines
Signed-off-by William Qiu <[email protected]>--- Documentation/devicetree/bindings/spi/spi-pl022.yaml | 1 + 1 file changed, 1 insertion(+)Documentation/devicetree/bindings/spi/spi-pl022.yaml +1
-0@@ -11,6 +11,7 @@ maintainers: allOf: - $ref: spi-controller.yaml# + - $ref: /schemas/arm/primecell.yaml#
Quoted 6 lines
Documentation/devicetree/bindings/spi/spi-pl022.yaml maintainers: · line 17
Quoted 2 lines
Documentation/devicetree/bindings/spi/spi-pl022.yaml +0
-0# We need a select here so we don't match all nodes with 'arm,primecell' select:Best regards,
Krzysztof
I will explain it in next version.
Best regards,
William
PATCH v2 2/3 dt-bindings: spi: constrain minItems of clocks and clock-names
In reply to William QiuThe SPI controller only need apb_pclk clock to work properly on JH7110 SoC, so there add minItems whose value is equal to 1. Other platforms do not have this constraint.
--- Documentation/devicetree/bindings/spi/spi-pl022.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/spi/spi-pl022.yaml +7 -3
@@ -35,12 +35,16 @@ properties: maxItems: 1 clocks: + minItems: 1 maxItems: 2 clock-names: - items: - - const: sspclk - - const: apb_pclk + oneOf: + - items: + - const: apb_pclk + - items: + - const: sspclk + - const: apb_pclk pl022,autosuspend-delay: description: delay in ms following transfer completion before the
Signature · 1 line
2.34.1
Re: [PATCH v2 2/3] dt-bindings: spi: constrain minItems of clocks and clock-names
Quoted 6 lines · William Qiu
The SPI controller only need
apb_pclkclock to work properly on JH7110 SoC, so there add minItems whose value is equal to 1. Other platforms do not have this constraint.Signed-off-by William Qiu <[email protected]>---
Best regards,
Krzysztof
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Mark Brown
maintainerRe: [PATCH v2 2/3] dt-bindings: spi: constrain minItems of clocks and clock-names
In reply to William QiuQuoted 3 lines · William Qiu
The SPI controller only need
apb_pclkclock to work properly on JH7110 SoC, so there add minItems whose value is equal to 1. Other platforms do not have this constraint.
Presumably this means that this is some variant of the usual pl022 IP, or that the clock is in fact present but is not modelled in your DT?
Re: [PATCH v2 2/3] dt-bindings: spi: constrain minItems of clocks and clock-names
Quoted 7 lines · Mark Brown
Quoted 3 lines · William Qiu
The SPI controller only need
apb_pclkclock to work properly on JH7110 SoC, so there add minItems whose value is equal to 1. Other platforms do not have this constraint.Presumably this means that this is some variant of the usual pl022 IP,
Hm, in such case this could mean we need dedicated compatible.
Quoted 1 line
or that the clock is in fact present but is not modelled in your DT?
Best regards,
Krzysztof
Mark Brown
maintainerRe: [PATCH v2 2/3] dt-bindings: spi: constrain minItems of clocks and clock-names
Quoted 10 lines · Krzysztof Kozlowski
Quoted 7 lines · Mark Brown
Quoted 3 lines · William Qiu
The SPI controller only need
apb_pclkclock to work properly on JH7110 SoC, so there add minItems whose value is equal to 1. Other platforms do not have this constraint.Presumably this means that this is some variant of the usual pl022 IP,
Hm, in such case this could mean we need dedicated compatible.
Yes, indeed.
Rob Herring
maintainerRe: [PATCH v2 2/3] dt-bindings: spi: constrain minItems of clocks and clock-names
In reply to Krzysztof KozlowskiQuoted 10 lines · Krzysztof Kozlowski
Quoted 7 lines · Mark Brown
Quoted 3 lines · William Qiu
The SPI controller only need
apb_pclkclock to work properly on JH7110 SoC, so there add minItems whose value is equal to 1. Other platforms do not have this constraint.Presumably this means that this is some variant of the usual pl022 IP,
Hm, in such case this could mean we need dedicated compatible.
Except the vendor in the ID registers should be different if the IP is modified.
I suspect that PCLK and SSPCLK are tied to the same clock source. There must be an SSPCLK because that is the one used to clock the SPI bus and we need to know the frequency of it.
Rob
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Re: [PATCH v2 2/3] dt-bindings: spi: constrain minItems of clocks and clock-names
Quoted 12 lines · Rob Herring
Quoted 10 lines · Krzysztof Kozlowski
Quoted 7 lines · Mark Brown
Quoted 3 lines · William Qiu
The SPI controller only need
apb_pclkclock to work properly on JH7110 SoC, so there add minItems whose value is equal to 1. Other platforms do not have this constraint.Presumably this means that this is some variant of the usual pl022 IP,
Hm, in such case this could mean we need dedicated compatible.
Quoted 8 lines
Except the vendor in the ID registers should be different if the IP is modified.
I suspect that PCLK and SSPCLK are tied to the same clock source. There must be an SSPCLK because that is the one used to clock the SPI bus and we need to know the frequency of it.
Rob
After communicating with colleagues in SoC FE, I learned that PCLK and SSPCLK were homologous on JH7110. He said that SSPCLK would divide the frequency internally anyway, and there was no need for external part frequency, so he directly gave them together.
So, should I call this clock ssp_apb or keep it SSPCLK?
Best regards,
William
Mark Brown
maintainerRe: [PATCH v2 2/3] dt-bindings: spi: constrain minItems of clocks and clock-names
Quoted 6 lines · William Qiu
Quoted 3 lines · Rob Herring
I suspect that PCLK and SSPCLK are tied to the same clock source. There must be an SSPCLK because that is the one used to clock the SPI bus and we need to know the frequency of it.
Quoted 6 lines
After communicating with colleagues in SoC FE, I learned that PCLK and SSPCLK were homologous on JH7110. He said that SSPCLK would divide the frequency internally anyway, and there was no need for external part frequency, so he directly gave them together.
So, should I call this clock
ssp_apbor keep it SSPCLK?
I'd expect this to be handled in the DTS for the SoC - connect both clocks the binding requires to whatever the upstream clock is, it's not clear to me that any binding change is required.
Re: [PATCH v2 2/3] dt-bindings: spi: constrain minItems of clocks and clock-names
Quoted 12 lines · Mark Brown
Quoted 10 lines · William Qiu
Quoted 3 lines · Rob Herring
I suspect that PCLK and SSPCLK are tied to the same clock source. There must be an SSPCLK because that is the one used to clock the SPI bus and we need to know the frequency of it.
After communicating with colleagues in SoC FE, I learned that PCLK and SSPCLK were homologous on JH7110. He said that SSPCLK would divide the frequency internally anyway, and there was no need for external part frequency, so he directly gave them together.
Quoted 5 lines
Quoted 1 line
So, should I call this clock
ssp_apbor keep it SSPCLK?I'd expect this to be handled in the DTS for the SoC - connect both clocks the binding requires to whatever the upstream clock is, it's not clear to me that any binding change is required.
You mean binding two clocks, with the same clock source? Then there is no need to modify YAML.
Best regards,
William
Mark Brown
maintainerRe: [PATCH v2 2/3] dt-bindings: spi: constrain minItems of clocks and clock-names
Quoted 8 lines · William Qiu
Quoted 6 lines · Mark Brown
Quoted 4 lines · William Qiu
After communicating with colleagues in SoC FE, I learned that PCLK and SSPCLK were homologous on JH7110. He said that SSPCLK would divide the frequency internally anyway, and there was no need for external part frequency, so he directly gave them together.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
So, should I call this clock
ssp_apbor keep it SSPCLK?I'd expect this to be handled in the DTS for the SoC - connect both clocks the binding requires to whatever the upstream clock is, it's not clear to me that any binding change is required.
You mean binding two clocks, with the same clock source? Then there is no need to modify YAML.
Yes, exactly.
PATCH v2 3/3 riscv: dts: starfive: Add spi node for JH7110 SoC
In reply to William QiuAdd spi node for JH7110 SoC.
--- .../jh7110-starfive-visionfive-2.dtsi | 50 ++++++++++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 98 +++++++++++++++++++ 2 files changed, 148 insertions(+)
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +50 -0
@@ -143,6 +143,18 @@ &i2c6 { status = "okay"; }; +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins>; + status = "okay"; + + spi_dev0: flash@0 { + compatible = "rohm,dh2228fv"; + reg = <0>; + spi-max-frequency = <10000000>; + }; +}; + &sysgpio { i2c0_pins: i2c0-0 { i2c-pins {
@@ -200,6 +212,44 @@ GPOEN_SYS_I2C6_DATA, }; }; + spi0_pins: spi0-0 { + mosi-pins { + pinmux = <GPIOMUX(52, GPOUT_SYS_SPI0_TXD, + GPOEN_ENABLE, + GPI_NONE)>; + bias-disable; + input-disable; + input-schmitt-disable; + }; + + miso-pins { + pinmux = <GPIOMUX(53, GPOUT_LOW, + GPOEN_DISABLE, + GPI_SYS_SPI0_RXD)>; + bias-pull-up; + input-enable; + input-schmitt-enable; + }; + + sck-pins { + pinmux = <GPIOMUX(48, GPOUT_SYS_SPI0_CLK, + GPOEN_ENABLE, + GPI_SYS_SPI0_CLK)>; + bias-disable; + input-disable; + input-schmitt-disable; + }; + + ss-pins { + pinmux = <GPIOMUX(48, GPOUT_SYS_SPI0_FSS, + GPOEN_ENABLE, + GPI_SYS_SPI0_FSS)>; + bias-disable; + input-disable; + input-schmitt-disable; + }; + }; + uart0_pins: uart0-0 { tx-pins { pinmux = <GPIOMUX(5, GPOUT_SYS_UART0_TX,
arch/riscv/boot/dts/starfive/jh7110.dtsi +98 -0
110 lines not on this page · raw message
Signature · 1 line
2.34.1
Mark Brown
maintainerRe: (subset) [PATCH v2 0/3] Add SPI module for StarFive JH7110 SoC
In reply to William QiuQuoted 5 lines · William Qiu
This patchset adds initial rudimentary support for the StarFive SPI controller. And this driver will be used in StarFive's VisionFive 2 board. The first patch constrain minItems of clocks for JH7110 SPI and Patch 2 adds support for StarFive JH7110 SPI.
Quoted 7 lines
Changes
v1->v2:
- Rebaed to v6.5rc1.
- Submitted reference file separately.
- Dropped 'status' node as it was 'okay' by default.
- Dropped Co-developed-by message.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/3] dt-bindings: spi: add reference file to YAML
commit: 8858babff615ee366bf570c1facfbd0845dd924e
[2/3] dt-bindings: spi: constrain minItems of clocks and clock-names
(no commit info)
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark