Support Pensando Elba SoC
Subsystems (8)
cover Support Pensando Elba SoC
This series enables support for Pensando Elba SoC based platforms. The Elba SoC has the following features:
- Sixteen ARM64 A72 cores
- Dual DDR 4/5 memory controllers
- 32 lanes of PCIe Gen3/4 to the Host
- Network interfaces: Dual 200GE, Quad 100GE, 50GE, 25GE, 10GE and also a single 1GE management port.
- Storage/crypto offloads and 144 programmable P4 cores.
- QSPI and EMMC for SoC storage
- Two SPI interfaces for peripheral management
- I2C bus for platform management
This is a respin based on review inputs. The version of dtschema used is 2022.3.2. Changes from V3:
0001-dt-bindings-arm-add-Pensando-boards.patch
- Add description and board compatible
0003-dt-bindings-mmc-Add-Pensando-Elba-SoC-binding.patch
- Change from elba-emmc to elba-sd4hc to match file convention
- Use minItems: 1 and maxItems: 2 to pass schema check
0005-dt-bindings-spi-dw-Add-Pensando-Elba-SoC-SPI-Control.patch
- Add required property pensando,syscon-spics to go with pensando,elba-spi
0006-MAINTAINERS-Add-entry-for-PENSANDO.patch
- Change Maintained to Supported
0007-arm64-Add-config-for-Pensando-SoC-platforms.patch
- Fix a typo on interface max speed
0008-spi-cadence-quadspi-Add-compatible-for-Pensando-Elba.patch
- Update due to spi-cadence-quadspi.c changes
0009-mmc-sdhci-cadence-Add-Pensando-Elba-SoC-support.patch
- Change from elba-emmc to elba-sd4hc to match file convention
0010-spi-dw-Add-support-for-Pensando-Elba-SoC.patch
- Use more descriptive dt property pensando,syscon-spics
- Minor changes from review input
0011-arm64-dts-Add-Pensando-Elba-SoC-support.patch
- Changed to dual copyright (GPL-2.0+ OR MIT)
- Minor changes from review input
Brad Larson (11):
dt-bindings: arm: add Pensando boards
dt-bindings: Add vendor prefix for Pensando Systems
dt-bindings: mmc: Add Pensando Elba SoC binding
dt-bindings: spi: Add compatible for Pensando Elba SoC
dt-bindings: spi: dw: Add Pensando Elba SoC SPI Controller bindings
MAINTAINERS: Add entry for PENSANDO
arm64: Add config for Pensando SoC platforms
spi: cadence-quadspi: Add compatible for Pensando Elba SoC
mmc: sdhci-cadence: Add Pensando Elba SoC support
spi: dw: Add support for Pensando Elba SoC
arm64: dts: Add Pensando Elba SoC support
.../bindings/arm/pensando,elba.yaml | 26 +++ .../devicetree/bindings/mmc/cdns,sdhci.yaml | 4 +- .../bindings/spi/cdns,qspi-nor.yaml | 3 +- .../bindings/spi/snps,dw-apb-ssi.yaml | 17 ++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 7 + arch/arm64/Kconfig.platforms | 12 ++ arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/pensando/Makefile | 3 + arch/arm64/boot/dts/pensando/elba-16core.dtsi | 189 ++++++++++++++++++ .../boot/dts/pensando/elba-asic-common.dtsi | 98 +++++++++ arch/arm64/boot/dts/pensando/elba-asic.dts | 28 +++ .../boot/dts/pensando/elba-flash-parts.dtsi | 106 ++++++++++ arch/arm64/boot/dts/pensando/elba.dtsi | 189 ++++++++++++++++++ drivers/mmc/host/Kconfig | 1 + drivers/mmc/host/sdhci-cadence.c | 148 ++++++++++++-- drivers/spi/spi-cadence-quadspi.c | 19 ++ drivers/spi/spi-dw-mmio.c | 85 ++++++++ 18 files changed, 922 insertions(+), 16 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/pensando,elba.yaml create mode 100644 arch/arm64/boot/dts/pensando/Makefile create mode 100644 arch/arm64/boot/dts/pensando/elba-16core.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba-asic-common.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba-asic.dts create mode 100644 arch/arm64/boot/dts/pensando/elba-flash-parts.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba.dtsi
Signature · 1 line
2.17.1
PATCH 1/11 dt-bindings: arm: add Pensando boards
Document the compatible for Pensando Elba SoC boards.
---
Change from V3:
- Add description and board compatible
.../bindings/arm/pensando,elba.yaml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/pensando,elba.yaml
Documentation/devicetree/bindings/arm/pensando,elba.yaml new file +26 -0
@@ -0,0 +1,26 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/pensando,elba.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Pensando Elba SoC Platforms Device Tree Bindings + +maintainers: + - Brad Larson <[email protected]> + +properties: + $nodename: + const: "/" + compatible: + oneOf: + + - description: Boards with Elba SoC + items: + - enum: + - pensando,elba-ortano + - const: pensando,elba + +additionalProperties: true + +...
Signature · 1 line
2.17.1
Re: [PATCH 01/11] dt-bindings: arm: add Pensando boards
Quoted 6 lines · Brad Larson
Document the compatible for Pensando Elba SoC boards.
Signed-off-by Brad Larson <[email protected]>---
Change from V3:
- Add description and board compatible
That's a bit confusing... the subject is for v1.
Quoted 11 lines
.../bindings/arm/pensando,elba.yaml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/pensando,elba.yamlDocumentation/devicetree/bindings/arm/pensando,elba.yaml new file +0
-0
Documentation/devicetree/bindings/arm/pensando,elba.yaml line 4
Quoted 4 lines
Documentation/devicetree/bindings/arm/pensando,elba.yaml new file +4
-0@@ -0,0 +1,26 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/pensando,elba.yaml#
I propose just pensando.yaml, unless there is going to be hundreds of different families of SoC from Pensando?
This patch should be after adding the vendor prefix.
Best regards,
Krzysztof
Re: [PATCH 01/11] dt-bindings: arm: add Pensando boards
Quoted 4 lines · Krzysztof Kozlowski
Quoted 2 lines
Change from V3:
- Add description and board compatibleThat's a bit confusing... the subject is for v1.
Goal was to identify in the cover letter patch the key changes from the V3 patchset to this V4 patchset. Then in each patch that had a material change highlight that in the patch itself. Will try and make it more clear.
Quoted 6 lines
Quoted 1 line
I propose just
pensando.yaml, unless there is going to be hundreds of different families of SoC from Pensando?This patch should be after adding the vendor prefix.
pensando.yaml is good, I'll change it to that. I'll order this patch to be after the vendor prefix addition in the next submission.
Best,
Brad
Re: [PATCH 01/11] dt-bindings: arm: add Pensando boards
Quoted 11 lines · Brad Larson
Quoted 4 lines · Krzysztof Kozlowski
Quoted 2 lines
Change from V3:
- Add description and board compatibleThat's a bit confusing... the subject is for v1.
Goal was to identify in the cover letter patch the key changes from the V3 patchset to this V4 patchset. Then in each patch that had a material change highlight that in the patch itself. Will try and make it more clear.
This is fine, I am talking about the subject - it is marked as a v1, so it's confusing to see a changelog.
One way to achieve this is: "git format-patch -v4 -11 ..."
Best regards,
Krzysztof
Re: [PATCH 01/11] dt-bindings: arm: add Pensando boards
Quoted 14 lines · Krzysztof Kozlowski
Quoted 11 lines · Brad Larson
Quoted 4 lines · Krzysztof Kozlowski
Quoted 2 lines
Change from V3:
- Add description and board compatibleThat's a bit confusing... the subject is for v1.
Goal was to identify in the cover letter patch the key changes from the V3 patchset to this V4 patchset. Then in each patch that had a material change highlight that in the patch itself. Will try and make it more clear.
Quoted 4 lines
This is fine, I am talking about the subject - it is marked as a v1, so it's confusing to see a changelog.
One way to achieve this is: "git format-patch -v4 -11 ..."
v2 was submitted by Brad one year ago:
https://patches.linaro.org/project/linux-spi/cover/[email protected]/
most likely he has just forgotten to add the proper suffix.
-Sergey
Quoted 3 lines
Best regards,
Krzysztof
Re: [PATCH 01/11] dt-bindings: arm: add Pensando boards
In reply to Krzysztof KozlowskiHi Krzysztof,
Quoted 14 lines · Krzysztof Kozlowski
Quoted 11 lines · Brad Larson
Quoted 4 lines · Krzysztof Kozlowski
Quoted 2 lines
Change from V3:
- Add description and board compatibleThat's a bit confusing... the subject is for v1.
Goal was to identify in the cover letter patch the key changes from the V3 patchset to this V4 patchset. Then in each patch that had a material change highlight that in the patch itself. Will try and make it more clear.
Quoted 4 lines
This is fine, I am talking about the subject - it is marked as a v1, so it's confusing to see a changelog.
One way to achieve this is: "git format-patch -v4 -11 ..."
That was the problem, thanks! Missed including -v4 in last use of format-patch. Sorry for the confusion.
Regards,
Brad
Re: [PATCH 01/11] dt-bindings: arm: add Pensando boards
In reply to Brad LarsonDocumentation/devicetree/bindings/arm/pensando,elba.yaml
Quoted 12 lines · Brad Larson
Document the compatible for Pensando Elba SoC boards.
Signed-off-by Brad Larson <[email protected]>---
Change from V3:
- Add description and board compatible.../bindings/arm/pensando,elba.yaml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/pensando,elba.yamlDocumentation/devicetree/bindings/arm/pensando,elba.yaml +0
-0
It seems you ignored to Cc devicetree binding maintainers for all your devicetree bindings patches.
Please rebase on a recent kernel tree and use scripts/get_maintainers.pl to get list of people to Cc. Your tree could not have my address, but why Rob is missing is a surprise...
Best regards,
Krzysztof
Re: [PATCH 01/11] dt-bindings: arm: add Pensando boards
Quoted 8 lines · Krzysztof Kozlowski
Documentation/devicetree/bindings/arm/pensando,elba.yaml
Quoted 1 line
Documentation/devicetree/bindings/arm/pensando,elba.yaml +0
-0It seems you ignored to Cc devicetree binding maintainers for all your devicetree bindings patches.
Please rebase on a recent kernel tree and use
scripts/get_maintainers.plto get list of people to Cc. Your tree could not have my address, but why Rob is missing is a surprise...
Hi Krzysztof,
Thanks for pointing this out. I used get_maintainers.pl on the original patchset that has evolved. I will redo the list for the next submission.
Best,
Brad
PATCH 2/11 dt-bindings: Add vendor prefix for Pensando Systems
In reply to Brad LarsonAdd vendor prefix for Pensando Systems: https://pensando.io
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -936,6 +936,8 @@ patternProperties: description: Parade Technologies Inc. "^parallax,.*": description: Parallax Inc. + "^pensando,.*": + description: Pensando Systems Inc. "^pda,.*": description: Precision Design Associates, Inc. "^pericom,.*":
Signature · 1 line
2.17.1
Re: [PATCH 02/11] dt-bindings: Add vendor prefix for Pensando Systems
Quoted 12 lines · Brad Larson
Add vendor prefix for Pensando Systems: https://pensando.io
Signed-off-by Brad Larson <[email protected]>--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)Documentation/devicetree/bindings/vendor-prefixes.yaml +0
-0
Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 940
Quoted 5 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2
-0@@ -936,6 +936,8 @@ patternProperties: description: Parade Technologies Inc. "^parallax,.*": description: Parallax Inc. + "^pensando,.*": + description: Pensando Systems Inc.
List is ordered alphabetically, so this goes one further.
Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 943
Quoted 3 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +0
-0"^pda,.*": description: Precision Design Associates, Inc. "^pericom,.*":
Best regards,
Krzysztof
Re: [PATCH 02/11] dt-bindings: Add vendor prefix for Pensando Systems
Quoted 8 lines · Krzysztof Kozlowski
Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 940
Quoted 2 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2
-0+ "^pensando,.*": + description: Pensando Systems Inc.List is ordered alphabetically, so this goes one further.
Quoted 3 lines
"^pda,.*": description: Precision Design Associates, Inc. "^pericom,.*":
Hi Krzysztof,
Ahh yes, pda, pen, ... I was looking at the company name. Moving it down one.
Best,
Brad
PATCH 3/11 dt-bindings: mmc: Add Pensando Elba SoC binding
In reply to Brad LarsonPensando Elba ARM 64-bit SoC is integrated with this IP and explicitly controls byte-lane enables resulting in an additional reg property resource.
---
Change from V3:
- Change from elba-emmc to elba-sd4hc to match file convention
- Use minItems: 1 and maxItems: 2 to pass schema check
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml +3 -1
@@ -19,10 +19,12 @@ properties: - enum: - microchip,mpfs-sd4hc - socionext,uniphier-sd4hc + - pensando,elba-sd4hc - const: cdns,sd4hc reg: - maxItems: 1 + minItems: 1 + maxItems: 2 interrupts: maxItems: 1
Signature · 1 line
2.17.1
Arnd Bergmann
maintainerRe: [PATCH 03/11] dt-bindings: mmc: Add Pensando Elba SoC binding
Quoted 20 lines · Brad Larson
Pensando Elba ARM 64-bit SoC is integrated with this IP and explicitly controls byte-lane enables resulting in an additional reg property resource.
Signed-off-by Brad Larson <[email protected]>---
Change from V3:
- Change from elba-emmc to elba-sd4hc to match file convention
- Use minItems: 1 and maxItems: 2 to pass schema checkDocumentation/devicetree/bindings/mmc/cdns,sdhci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml +0
-0@@ -19,10 +19,12 @@ properties: - enum:
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml properties: · line 28
Quoted 10 lines
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml +3
-1- microchip,mpfs-sd4hc - socionext,uniphier-sd4hc + - pensando,elba-sd4hc - const: cdns,sd4hc reg: - maxItems: 1 + minItems: 1 + maxItems: 2
Shouldn't the binding describe what the register areas are? If there is only one of them, it is fairly clear, but when you have the choice between one and two, it gets ambiguous, and there is a risk that another SoC might have a different register area in the second entry, making it incompatible.
Arnd
Re: [PATCH 03/11] dt-bindings: mmc: Add Pensando Elba SoC binding
Hi Arnd,
Quoted 12 lines · Arnd Bergmann
Quoted 10 lines · Brad Larson
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml +1
-0@@ -19,10 +19,12 @@ properties: - enum: - microchip,mpfs-sd4hc - socionext,uniphier-sd4hc + - pensando,elba-sd4hc - const: cdns,sd4hc
Quoted 11 lines
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml properties: · line 28
Quoted 5 lines
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml +2
-1reg: - maxItems: 1 + minItems: 1 + maxItems: 2Shouldn't the binding describe what the register areas are? If there is only one of them, it is fairly clear, but when you have the choice between one and two, it gets ambiguous, and there is a risk that another SoC might have a different register area in the second entry, making it incompatible.
Thanks for the review. Changing this to allOf:if:then in updated patchset. The second item is particular to Elba SoC.
Regards,
Brad
Re: [PATCH 03/11] dt-bindings: mmc: Add Pensando Elba SoC binding
In reply to Brad LarsonQuoted 18 lines · Brad Larson
Pensando Elba ARM 64-bit SoC is integrated with this IP and explicitly controls byte-lane enables resulting in an additional reg property resource.
Signed-off-by Brad Larson <[email protected]>---
Change from V3:
- Change from elba-emmc to elba-sd4hc to match file convention
- Use minItems: 1 and maxItems: 2 to pass schema checkDocumentation/devicetree/bindings/mmc/cdns,sdhci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml +0
-0
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml properties: · line 22
Quoted 4 lines
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml +1
-0@@ -19,10 +19,12 @@ properties: - enum: - microchip,mpfs-sd4hc - socionext,uniphier-sd4hc + - pensando,elba-sd4hc
Put your entry in alphabetical order.
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml properties: · line 27
Quoted 6 lines
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml +2
-1- const: cdns,sd4hc reg: - maxItems: 1 + minItems: 1 + maxItems: 2
This needs allOf:if:then: which sets constraint on number of items per different compatible.
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml properties: · line 30
Quoted 3 lines
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml +0
-0interrupts: maxItems: 1
Best regards,
Krzysztof
Re: [PATCH 03/11] dt-bindings: mmc: Add Pensando Elba SoC binding
Hi Krzysztof,
Quoted 12 lines · Krzysztof Kozlowski
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml properties: · line 22
Quoted 8 lines · Brad Larson
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml +1
-0@@ -19,10 +19,12 @@ properties: - enum: - microchip,mpfs-sd4hc - socionext,uniphier-sd4hc + - pensando,elba-sd4hcPut your entry in alphabetical order.
Yes, will order alphabetical.
Quoted 13 lines
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml properties: · line 27
Quoted 6 lines
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml +2
-1- const: cdns,sd4hc reg: - maxItems: 1 + minItems: 1 + maxItems: 2This needs allOf:if:then: which sets constraint on number of items per different compatible.
Quoted 3 lines
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml +0
-0interrupts: maxItems: 1
Thanks for the recommendation. Changing to this approach as the second item is only for Elba SoC.
Regards,
Brad
PATCH 4/11 dt-bindings: spi: Add compatible for Pensando Elba SoC
In reply to Brad LarsonDocument the cadence qspi controller compatible for Pensando Elba SoC boards. The Elba qspi fifo size is 1024.
--- Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml +2 -1
@@ -30,6 +30,7 @@ properties: - intel,lgm-qspi - xlnx,versal-ospi-1.0 - intel,socfpga-qspi + - pensando,elba-qspi - const: cdns,qspi-nor - const: cdns,qspi-nor
@@ -48,7 +49,7 @@ properties: description: Size of the data FIFO in words. $ref: "/schemas/types.yaml#/definitions/uint32" - enum: [ 128, 256 ] + enum: [ 128, 256, 1024 ] default: 128 cdns,fifo-width:
Signature · 1 line
2.17.1
Re: [PATCH 04/11] dt-bindings: spi: Add compatible for Pensando Elba SoC
Quoted 21 lines · Brad Larson
Document the cadence qspi controller compatible for Pensando Elba SoC boards. The Elba qspi fifo size is 1024.
Signed-off-by Brad Larson <[email protected]>--- Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml +1
-0@@ -30,6 +30,7 @@ properties: - intel,lgm-qspi - xlnx,versal-ospi-1.0 - intel,socfpga-qspi + - pensando,elba-qspi - const: cdns,qspi-nor - const: cdns,qspi-nor
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml properties: · line 52
Quoted 5 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml +1
-1@@ -48,7 +49,7 @@ properties: description: Size of the data FIFO in words. $ref: "/schemas/types.yaml#/definitions/uint32" - enum: [ 128, 256 ] + enum: [ 128, 256, 1024 ]
Is 1024 valid for other controllers? If not, then probably this should be further constraint in allOf:if:then...
Best regards,
Krzysztof
Re: [PATCH 04/11] dt-bindings: spi: Add compatible for Pensando Elba SoC
Hi Krzysztof,
Quoted 6 lines · Krzysztof Kozlowski
Quoted 3 lines · Brad Larson
Document the cadence qspi controller compatible for Pensando Elba SoC boards. The Elba qspi fifo size is 1024.
Quoted 9 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml properties: · line 52
Quoted 6 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml +1
-1@@ -48,7 +49,7 @@ properties: description: Size of the data FIFO in words. $ref: "/schemas/types.yaml#/definitions/uint32" - enum: [ 128, 256 ] + enum: [ 128, 256, 1024 ]Is 1024 valid for other controllers? If not, then probably this should be further constraint in allOf:if:then...
I'll change this to allOf:if:then so that the 1024 deep FIFO is specific to Elba SoC.
Regards,
Brad
Re: [PATCH 04/11] dt-bindings: spi: Add compatible for Pensando Elba SoC
In reply to Brad LarsonQuoted 1 line
[PATCH 04/11] dt-bindings: spi: Add compatible for Pensando Elba SoC
I think you need to be more specific in the patch title to what bindings you are adding the new compatible string. Something like this "dt-bindings: spi: cdns: ..."
The same concerns the patch "[PATCH 03/11] dt-bindings: mmc: Add Pensando Elba SoC binding".
Otherwise it isn't clear to what schema you are adding the Elba SoC support to.
-Sergey
Quoted 32 lines · Brad Larson
Document the cadence qspi controller compatible for Pensando Elba SoC boards. The Elba qspi fifo size is 1024.
Signed-off-by Brad Larson <[email protected]>--- Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml +2
-1@@ -30,6 +30,7 @@ properties: - intel,lgm-qspi - xlnx,versal-ospi-1.0 - intel,socfpga-qspi + - pensando,elba-qspi - const: cdns,qspi-nor - const: cdns,qspi-nor@@ -48,7 +49,7 @@ properties: description: Size of the data FIFO in words. $ref: "/schemas/types.yaml#/definitions/uint32" - enum: [ 128, 256 ] + enum: [ 128, 256, 1024 ] default: 128 cdns,fifo-width:Signature · 1 line
2.17.1
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH 04/11] dt-bindings: spi: Add compatible for Pensando Elba SoC
Hi Sergey,
Quoted 10 lines · Serge Semin
Quoted 2 lines
[PATCH 04/11] dt-bindings: spi: Add compatible for Pensando Elba SoC
I think you need to be more specific in the patch title to what bindings you are adding the new compatible string. Something like this "dt-bindings: spi: cdns: ..."
The same concerns the patch "[PATCH 03/11] dt-bindings: mmc: Add Pensando Elba SoC binding".
Otherwise it isn't clear to what schema you are adding the Elba SoC support to.
Thanks for the review, I'll add more specifics to the bindings patch title.
Regards,
Brad
PATCH 5/11 dt-bindings: spi: dw: Add Pensando Elba SoC SPI Controller bindings
In reply to Brad LarsonThe Pensando Elba SoC has integrated the DW APB SPI Controller and requires the property pensando,syscon-spics for access to the spics control register.
---
Change from V3:
- Add required property pensando,syscon-spics to go with pensando,elba-spi
.../bindings/spi/snps,dw-apb-ssi.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +17 -0
@@ -37,6 +37,21 @@ allOf: else: required: - interrupts + - if: + properties: + compatible: + contains: + enum: + - pensando,elba-spi + then: + properties: + pensando,syscon-spics: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the system control device node which provides access to + the spics control register + required: + - pensando,syscon-spics properties: compatible:
@@ -73,6 +88,8 @@ properties: - renesas,r9a06g032-spi # RZ/N1D - renesas,r9a06g033-spi # RZ/N1S - const: renesas,rzn1-spi # RZ/N1 + - description: Pensando SoC SPI Controller + const: pensando,elba-spi reg: minItems: 1
Signature · 1 line
2.17.1
Re: [PATCH 05/11] dt-bindings: spi: dw: Add Pensando Elba SoC SPI Controller bindings
Quoted 9 lines · Brad Larson
The Pensando Elba SoC has integrated the DW APB SPI Controller and requires the property pensando,syscon-spics for access to the spics control register.
Signed-off-by Brad Larson <[email protected]>---
Change from V3:
- Add required property pensando,syscon-spics to go with pensando,elba-spi
Thank you for your patch. There is something to discuss/improve.
Quoted 14 lines
.../bindings/spi/snps,dw-apb-ssi.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +3
-0@@ -37,6 +37,21 @@ allOf: else: required: - interrupts + - if: + properties: + compatible:
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml allOf: · line 52
Quoted 10 lines
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +10
-0+ contains: + enum: + - pensando,elba-spi + then: + properties: + pensando,syscon-spics: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the system control device node which provides access to + the spics control register
It looks you only need to poke one register from spics, so it could be something like:
items:
- items:
- description: Phandle to the system control device node
- description: spics control register offset
Best regards,
Krzysztof
Re: [PATCH 05/11] dt-bindings: spi: dw: Add Pensando Elba SoC SPI Controller bindings
Quoted 43 lines · Krzysztof Kozlowski
Quoted 9 lines · Brad Larson
The Pensando Elba SoC has integrated the DW APB SPI Controller and requires the property pensando,syscon-spics for access to the spics control register.
Signed-off-by Brad Larson <[email protected]>---
Change from V3:
- Add required property pensando,syscon-spics to go with pensando,elba-spiThank you for your patch. There is something to discuss/improve.
Quoted 14 lines
.../bindings/spi/snps,dw-apb-ssi.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +3
-0@@ -37,6 +37,21 @@ allOf: else: required: - interrupts + - if: + properties: + compatible:Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml allOf: · line 52
Quoted 10 lines
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +10
-0+ contains: + enum: + - pensando,elba-spi + then: + properties: + pensando,syscon-spics: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the system control device node which provides access to + the spics control registerIt looks you only need to poke one register from spics, so it could be something like:
Quoted 4 lines
items:
- items:
- description: Phandle to the system control device node
- description: spics control register offset
Right, especially seeing that's the way the elba-specific part of the DW APB SSI driver expects the property being initialized.
-Sergey
Quoted 4 lines
Best regards,
Krzysztof
Re: [PATCH 05/11] dt-bindings: spi: dw: Add Pensando Elba SoC SPI Controller bindings
In reply to Krzysztof KozlowskiHi Krzysztof,
Quoted 25 lines · Krzysztof Kozlowski
Quoted 9 lines · Brad Larson
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +3
-0@@ -37,6 +37,21 @@ allOf: else: required: - interrupts + - if: + properties: + compatible:Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml allOf: · line 52
Quoted 10 lines
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +10
-0+ contains: + enum: + - pensando,elba-spi + then: + properties: + pensando,syscon-spics: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the system control device node which provides access to + the spics control registerIt looks you only need to poke one register from spics, so it could be something like:
Quoted 4 lines
items:
- items:
- description: Phandle to the system control device node
- description: spics control register offset
This looks better, I'll change to this approach for updated patchset.
Regards,
Brad
Re: [PATCH 05/11] dt-bindings: spi: dw: Add Pensando Elba SoC SPI Controller bindings
In reply to Brad LarsonQuoted 21 lines · Brad Larson
The Pensando Elba SoC has integrated the DW APB SPI Controller and requires the property pensando,syscon-spics for access to the spics control register.
Signed-off-by Brad Larson <[email protected]>---
Change from V3:
- Add required property pensando,syscon-spics to go with pensando,elba-spi.../bindings/spi/snps,dw-apb-ssi.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +0
-0@@ -37,6 +37,21 @@ allOf: else: required: - interrupts
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml allOf: · line 49
Quoted 10 lines
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +9
-0+ - if: + properties: + compatible: + contains: + enum: + - pensando,elba-spi + then: + properties: + pensando,syscon-spics:
Please see my comment to the "[PATCH 11/11] arm64: dts: Add Pensando Elba SoC support" patch regarding this property implementation.
-Sergey
Quoted 21 lines
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +6
-0+ $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the system control device node which provides access to + the spics control register + required: + - pensando,syscon-spics properties:compatible:
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +2
-0@@ -73,6 +88,8 @@ properties: - renesas,r9a06g032-spi # RZ/N1D - renesas,r9a06g033-spi # RZ/N1S - const: renesas,rzn1-spi # RZ/N1 + - description: Pensando SoC SPI Controller + const: pensando,elba-spi reg: minItems: 1Signature · 1 line
2.17.1
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 6/11 MAINTAINERS: Add entry for PENSANDO
In reply to Brad LarsonAdd entry for PENSANDO maintainer and files
---
Change from V3:
- Change Maintained to Supported
MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+)
MAINTAINERS +7 -0
@@ -2509,6 +2509,13 @@ S: Maintained W: http://hackndev.com F: arch/arm/mach-pxa/palmz72.* +ARM/PENSANDO ARM64 ARCHITECTURE +M: Brad Larson <[email protected]> +L: [email protected] (moderated for non-subscribers) +S: Supported +F: Documentation/devicetree/bindings/*/pensando* +F: arch/arm64/boot/dts/pensando/ + ARM/PLEB SUPPORT M: Peter Chubb <[email protected]> S: Maintained
Signature · 1 line
2.17.1
PATCH 7/11 arm64: Add config for Pensando SoC platforms
In reply to Brad LarsonAdd ARCH_PENSANDO configuration option for Pensando SoC based platforms.
---
Change from V3:
- Fix a typo on interface max speed
arch/arm64/Kconfig.platforms | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm64/Kconfig.platforms +12 -0
@@ -203,6 +203,18 @@ config ARCH_MXC This enables support for the ARMv8 based SoCs in the NXP i.MX family. +config ARCH_PENSANDO + bool "Pensando Platforms" + help + This enables support for the ARMv8 based Pensando SoC + family to include the Elba SoC. + + Pensando SoCs support a range of Distributed Services + Cards in PCIe format installed into servers. The Elba + SoC includes 16 A-72 CPU cores, 144 programmable P4 + cores for a minimal latency/jitter datapath, and network + interfaces up to 200 Gb/s. + config ARCH_QCOM bool "Qualcomm Platforms" select GPIOLIB
Signature · 1 line
2.17.1
PATCH 8/11 spi: cadence-quadspi: Add compatible for Pensando Elba SoC
In reply to Brad LarsonThe Pensando Elba SoC has the Cadence QSPI controller integrated.
The quirk CQSPI_NEEDS_APB_AHB_HAZARD_WAR is added and if enabled a dummy readback from the controller is performed to ensure synchronization.
---
Change from V3:
- Update due to spi-cadence-quadspi.c changes
drivers/spi/spi-cadence-quadspi.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/spi/spi-cadence-quadspi.c +19 -0
@@ -38,6 +38,7 @@#define CQSPI_DISABLE_DAC_MODE BIT(1)#define CQSPI_SUPPORT_EXTERNAL_DMA BIT(2)#define CQSPI_NO_SUPPORT_WR_COMPLETION BIT(3) +#define CQSPI_NEEDS_APB_AHB_HAZARD_WAR BIT(4)/* Capabilities */ #define CQSPI_SUPPORTS_OCTAL BIT(0)
@@ -88,6 +89,7 @@ struct cqspi_st {bool use_dma_read;u32 pd_dev_id;bool wr_completion; +bool apb_ahb_hazard; };struct cqspi_driver_platdata {
@@ -1043,6 +1045,13 @@ static int cqspi_indirect_write_execute(struct cqspi_flash_pdata *f_pdata,if (cqspi->wr_delay)ndelay (cqspi->wr_delay); +/* +* If a hazard exists between the APB and AHB interfaces, perform a +* dummy readback from the controller to ensure synchronization. +*/ +if (cqspi->apb_ahb_hazard) + (void )readl (reg_base +CQSPI_REG_INDIRECTWR ); +while (remaining >0 ) {size_t write_words, mod_bytes;
@@ -1759,6 +1768,8 @@ static int cqspi_probe(struct platform_device *pdev) cqspi->use_dma_read = true;if (ddata->quirks &CQSPI_NO_SUPPORT_WR_COMPLETION ) cqspi->wr_completion = false; +if (ddata->quirks &CQSPI_NEEDS_APB_AHB_HAZARD_WAR ) + cqspi->apb_ahb_hazard = true;if (of_device_is_compatible (pdev->dev.of_node,"xlnx,versal-ospi-1.0" ))
@@ -1882,6 +1893,10 @@ static const struct cqspi_driver_platdata versal_ospi = { .get_dma_status = cqspi_get_versal_dma_status, }; +static const struct cqspi_driver_platdata pen_cdns_qspi = { + .quirks =CQSPI_NEEDS_APB_AHB_HAZARD_WAR |CQSPI_DISABLE_DAC_MODE , +}; +static const struct of_device_id cqspi_dt_ids[] = { { .compatible ="cdns,qspi-nor" ,
@@ -1907,6 +1922,10 @@ static const struct of_device_id cqspi_dt_ids[] = { .compatible = "intel,socfpga-qspi", .data = (void *)&socfpga_qspi, }, + { + .compatible = "pensando,elba-qspi", + .data = &pen_cdns_qspi, + }, {/* end of table */ } };
Signature · 1 line
2.17.1
PATCH 9/11 mmc: sdhci-cadence: Add Pensando Elba SoC support
In reply to Brad LarsonAdd support for Pensando Elba SoC which explicitly controls byte-lane enables on writes. Add priv_write_l() which is used on Elba platforms for byte-lane control.
Select MMC_SDHCI_IO_ACCESSORS for MMC_SDHCI_CADENCE which allows Elba SoC sdhci_elba_ops to overwrite the SDHCI IO memory accessors.
---
Change from V3:
- Change from elba-emmc to elba-sd4hc to match file convention
drivers/mmc/host/Kconfig | 1 + drivers/mmc/host/sdhci-cadence.c | 148 ++++++++++++++++++++++++++++--- 2 files changed, 135 insertions(+), 14 deletions(-)
drivers/mmc/host/Kconfig +1 -0
@@ -243,6 +243,7 @@ config MMC_SDHCI_CADENCE tristate "SDHCI support for the Cadence SD/SDIO/eMMC controller" depends on MMC_SDHCI_PLTFM depends on OF + select MMC_SDHCI_IO_ACCESSORS help This selects the Cadence SD/SDIO/eMMC driver.
drivers/mmc/host/sdhci-cadence.c +134 -14
233 lines not on this page · raw message
Signature · 1 line
2.17.1
Arnd Bergmann
maintainerRe: [PATCH 09/11] mmc: sdhci-cadence: Add Pensando Elba SoC support
Quoted 23 lines · Brad Larson
drivers/mmc/host/sdhci-cadence.c +3
-3@@ -350,7 +461,7 @@ static void sdhci_cdns_hs400_enhanced_strobe(struct mmc_host *mmc,static int sdhci_cdns_probe (struct platform_device *pdev) {struct sdhci_host *host; -const struct sdhci_pltfm_data *data; +const struct sdhci_cdns_drv_data *data;struct sdhci_pltfm_host *pltfm_host;struct sdhci_cdns_priv *priv;struct clk *clk;@@ -369,10 +480,10 @@ static int sdhci_cdns_probe(struct platform_device *pdev) data =of_device_get_match_data (dev);if (!data) - data = &sdhci_cdns_pltfm_data; + data = &sdhci_cdns_drv_data; nr_phy_params =sdhci_cdns_phy_param_count (dev->of_node); - host =sdhci_pltfm_init (pdev, data, + host =sdhci_pltfm_init (pdev, &data->pltfm_data,struct_size (priv, phy_params, nr_phy_params));if (IS_ERR (host)) { ret =PTR_ERR (host);
drivers/mmc/host/sdhci-cadence.c static int sdhci_cdns_probe(struct platform_device *pdev) · line 509
Quoted 10 lines
drivers/mmc/host/sdhci-cadence.c +5
-0@@ -389,6 +500,11 @@ static int sdhci_cdns_probe(struct platform_device *pdev) host->ioaddr +=SDHCI_CDNS_SRS_BASE ; host->mmc_host_ops.hs400_enhanced_strobe = sdhci_cdns_hs400_enhanced_strobe; +if (data->init) { + ret = data->init (pdev); +if (ret) + goto free; + }sdhci_enable_v4_mode (host);__sdhci_read_caps (host, &version,NULL ,NULL );
I'm not sure about the abstraction here. The approach of having a single driver with some platform specific quirks like you do here works fine if the differences between hardware implementations are fairly minor, but if there are a larger number of variants, or the differences become too big, the better approach is to have separate top-level driver instances that call into a more generic driver, continuing the call chain
elba_drv_init()
-> sdhci_cdns_probe()
-> sdhci_pltfm_init()
-> sdhci_add_host()
-> mmc_add_host()with each one being a more specific version of the one below it. At the moment, it doesn't quite require having a custom driver, but I fear that it it would get hard to rework if it continues to grow other front-ends. It may be better to do the abstraction right away, even if the elba driver becomes rather trivial.
Ulf, any preferences?
Arnd
Adrian Hunter
maintainerRe: [PATCH 09/11] mmc: sdhci-cadence: Add Pensando Elba SoC support
Quoted 48 lines · Arnd Bergmann
Quoted 23 lines · Brad Larson
drivers/mmc/host/sdhci-cadence.c +3
-3@@ -350,7 +461,7 @@ static void sdhci_cdns_hs400_enhanced_strobe(struct mmc_host *mmc,static int sdhci_cdns_probe (struct platform_device *pdev) {struct sdhci_host *host; -const struct sdhci_pltfm_data *data; +const struct sdhci_cdns_drv_data *data;struct sdhci_pltfm_host *pltfm_host;struct sdhci_cdns_priv *priv;struct clk *clk;@@ -369,10 +480,10 @@ static int sdhci_cdns_probe(struct platform_device *pdev) data =of_device_get_match_data (dev);if (!data) - data = &sdhci_cdns_pltfm_data; + data = &sdhci_cdns_drv_data; nr_phy_params =sdhci_cdns_phy_param_count (dev->of_node); - host =sdhci_pltfm_init (pdev, data, + host =sdhci_pltfm_init (pdev, &data->pltfm_data,struct_size (priv, phy_params, nr_phy_params));if (IS_ERR (host)) { ret =PTR_ERR (host);drivers/mmc/host/sdhci-cadence.c static int sdhci_cdns_probe(struct platform_device *pdev) · line 509
Quoted 10 lines
drivers/mmc/host/sdhci-cadence.c +5
-0@@ -389,6 +500,11 @@ static int sdhci_cdns_probe(struct platform_device *pdev) host->ioaddr +=SDHCI_CDNS_SRS_BASE ; host->mmc_host_ops.hs400_enhanced_strobe = sdhci_cdns_hs400_enhanced_strobe; +if (data->init) { + ret = data->init (pdev); +if (ret) + goto free; + }sdhci_enable_v4_mode (host);__sdhci_read_caps (host, &version,NULL ,NULL );I'm not sure about the abstraction here. The approach of having a single driver with some platform specific quirks like you do here works fine if the differences between hardware implementations are fairly minor, but if there are a larger number of variants, or the differences become too big, the better approach is to have separate top-level driver instances that call into a more generic driver, continuing the call chain
elba_drv_init()
->sdhci_cdns_probe()-> sdhci_pltfm_init() -> sdhci_add_host() -> mmc_add_host()
Quoted 8 lines
with each one being a more specific version of the one below it. At the moment, it doesn't quite require having a custom driver, but I fear that it it would get hard to rework if it continues to grow other front-ends. It may be better to do the abstraction right away, even if the elba driver becomes rather trivial.
Ulf, any preferences?
What is the relationship between cadence and pensando elba?
Re: [PATCH 09/11] mmc: sdhci-cadence: Add Pensando Elba SoC support
Quoted 2 lines · Adrian Hunter
What is the relationship between cadence and pensando elba?
Pensando licensed the cadence controller, its 100% cadence IP. The integration issue we ran into was with the accessors where we have the workaround. The initial patch added a separate Elba driver file but the feedback was the Elba support didn't justify doing that and to add to sdhci-cacence.c.
Regards,
Brad
Arnd Bergmann
maintainerRe: [PATCH 09/11] mmc: sdhci-cadence: Add Pensando Elba SoC support
Quoted 9 lines · Brad Larson
Quoted 2 lines · Adrian Hunter
What is the relationship between cadence and pensando elba?
Pensando licensed the cadence controller, its 100% cadence IP. The integration issue we ran into was with the accessors where we have the workaround. The initial patch added a separate Elba driver file but the feedback was the Elba support didn't justify doing that and to add to
sdhci-cacence.c.
I looked back at the earlier reviews now, I think the main problem with versions 1 and 2 was that it had the abstraction the wrong way around, so you added the complexity of having multiple files, without the benefits.
I still think that the cleanest approach would be to have it the way I suggested in my reply to v1, with an elba specific platform driver that calls into the generic cadence code, but the generic code knowing nothing about the front-end.
Then again, it sounds like there was already an agreement about the approach you took here, so let's stay with that and hope we don't get any other chips with the same IP block in the future.
Arnd
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH 09/11] mmc: sdhci-cadence: Add Pensando Elba SoC support
Hi Arnd,
Quoted 16 lines · Arnd Bergmann
Quoted 9 lines · Brad Larson
Quoted 2 lines · Adrian Hunter
What is the relationship between cadence and pensando elba?
Pensando licensed the cadence controller, its 100% cadence IP. The integration issue we ran into was with the accessors where we have the workaround. The initial patch added a separate Elba driver file but the feedback was the Elba support didn't justify doing that and to add to
sdhci-cacence.c.I looked back at the earlier reviews now, I think the main problem with versions 1 and 2 was that it had the abstraction the wrong way around, so you added the complexity of having multiple files, without the benefits.
Quoted 8 lines
I still think that the cleanest approach would be to have it the way I suggested in my reply to v1, with an elba specific platform driver that calls into the generic cadence code, but the generic code knowing nothing about the front-end.
Then again, it sounds like there was already an agreement about the approach you took here, so let's stay with that and hope we don't get any other chips with the same IP block in the future.
Thanks for looking this over. I won't change for now in the patch update in process. This will likely get another look as I've added a node to the device tree to enable an added reset driver which can hardware reset the emmc. The current cadence sdhci driver does not include this and I've currently added filling out mmc_host_ops.card_hw_reset like below, yet one more thing different for our platforms not in the common driver.
@@ -404,6 +550,17 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
if (ret)
goto free;+ if (host->mmc->caps & MMC_CAP_HW_RESET) {
+ priv->rst_hw =devm_reset_control_get_optional_exclusive(dev, "hw");
+ if (IS_ERR(priv->rst_hw)) {
+ ret = PTR_ERR(priv->rst_hw);
+ if (ret == -ENOENT)
+ priv->rst_hw = NULL;
+ } else {
+ host->mmc_host_ops.card_hw_reset = sdhci_mmc_hw_reset;
+ }
+ }
+
ret = sdhci_add_host(host);
Regards,
Brad
PATCH 10/11 spi: dw: Add support for Pensando Elba SoC
In reply to Brad LarsonThe Pensando Elba SoC includes a DW apb_ssi v4 controller with device specific chip-select control. The Elba SoC provides four chip-selects where the native DW IP supports two chip-selects. The Elba DW_SPI instance has two native CS signals that are always overridden.
---
Change from V3:
- Use more descriptive dt property pensando,syscon-spics
- Minor changes from review input
drivers/spi/spi-dw-mmio.c | 85 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+)
drivers/spi/spi-dw-mmio.c +85 -0
@@ -53,6 +53,24 @@ struct dw_spi_mscc {void __iomem *spi_mst;/* Not sparx5 */ }; +struct dw_spi_elba { +struct regmap *regmap; +unsigned int reg; +}; + +/* +* Elba SoC does not use ssi, pin override is used for cs 0,1 and +* gpios for cs 2,3 as defined in the device tree. +* +* cs: | 1 0 +* bit: |---3-------2-------1-------0 +* | cs1 cs1_ovr cs0 cs0_ovr +*/ +#define ELBA_SPICS_SHIFT (cs) (2 * (cs)) +#define ELBA_SPICS_MASK (cs) (0x3 << ELBA_SPICS_SHIFT(cs)) +#define ELBA_SPICS_SET (cs, val) \ + ((((val) << 1) | 0x1) << ELBA_SPICS_SHIFT(cs)) +/* * The Designware SPI controller (referred to as master in the documentation) * automatically deasserts chip select when the tx fifo is empty. The chip
@@ -238,6 +256,72 @@ static int dw_spi_canaan_k210_init(struct platform_device *pdev,return 0 ; } +static void elba_spics_set_cs (struct dw_spi_elba *dwselba,int cs,int enable) +{ +regmap_update_bits (dwselba->regmap, dwselba->reg,ELBA_SPICS_MASK (cs), +ELBA_SPICS_SET (cs, enable)); +} + +static void dw_spi_elba_set_cs (struct spi_device *spi,bool enable) +{ +struct dw_spi *dws =spi_master_get_devdata (spi->master); + struct dw_spi_mmio *dwsmmio = container_of(dws, struct dw_spi_mmio, dws); +struct dw_spi_elba *dwselba = dwsmmio->priv; +u8 cs; + + cs = spi->chip_select; +if (cs <2 ) { +/* overridden native chip-select */ +elba_spics_set_cs (dwselba, spi->chip_select, enable); + } + +/* +* The DW SPI controller needs a native CS bit selected to start +* the serial engine and the platform may have fewer native CSs +* than needed, so use CS0 always. +*/ + spi->chip_select =0 ; +dw_spi_set_cs (spi, enable); + spi->chip_select = cs; +} + +static int dw_spi_elba_init (struct platform_device *pdev, +struct dw_spi_mmio *dwsmmio) +{ +struct of_phandle_args args; +struct dw_spi_elba *dwselba; +struct regmap *regmap; +int rc; + + rc =of_parse_phandle_with_fixed_args (pdev->dev.of_node, +"pensando,syscon-spics" ,1 ,0 , &args); +if (rc) { +dev_err (&pdev->dev,"could not find spics\n" ); +return rc; + } + + regmap =syscon_node_to_regmap (args.np); +if (IS_ERR (regmap)) +return dev_err_probe (&pdev->dev,PTR_ERR (regmap), +"could not map spics" ); + + dwselba =devm_kzalloc (&pdev->dev,sizeof (*dwselba),GFP_KERNEL ); +if (!dwselba) +return -ENOMEM ; + + dwselba->regmap = regmap; + dwselba->reg = args.args[0 ]; + +/* deassert cs */ +elba_spics_set_cs (dwselba,0 ,1 ); +elba_spics_set_cs (dwselba,1 ,1 ); + + dwsmmio->priv = dwselba; + dwsmmio->dws.set_cs = dw_spi_elba_set_cs; + +return 0 ; +} +static int dw_spi_mmio_probe (struct platform_device *pdev) { int (*init_func)(struct platform_device *pdev,
@@ -352,6 +436,7 @@ static const struct of_device_id dw_spi_mmio_of_match[] = { { .compatible = "intel,keembay-ssi", .data = dw_spi_keembay_init}, { .compatible = "microchip,sparx5-spi", dw_spi_mscc_sparx5_init}, { .compatible = "canaan,k210-spi", dw_spi_canaan_k210_init}, + { .compatible = "pensando,elba-spi", .data = dw_spi_elba_init}, { /* end of table */} };MODULE_DEVICE_TABLE (of, dw_spi_mmio_of_match);
Signature · 1 line
2.17.1
Re: [PATCH 10/11] spi: dw: Add support for Pensando Elba SoC
Quoted 46 lines · Brad Larson
The Pensando Elba SoC includes a DW
apb_ssiv4 controller with device specific chip-select control. The Elba SoC provides four chip-selects where the native DW IP supports two chip-selects. The ElbaDW_SPIinstance has two native CS signals that are always overridden.Signed-off-by Brad Larson <[email protected]>---
Change from V3:
- Use more descriptive dt property pensando,syscon-spics
- Minor changes from review inputdrivers/spi/spi-dw-mmio.c | 85 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+)drivers/spi/spi-dw-mmio.c +18
-0@@ -53,6 +53,24 @@ struct dw_spi_mscc {void __iomem *spi_mst;/* Not sparx5 */ }; +struct dw_spi_elba { +struct regmap *regmap; +unsigned int reg; +}; + +/* +* Elba SoC does not use ssi, pin override is used for cs 0,1 and +* gpios for cs 2,3 as defined in the device tree. +* +* cs: | 1 0 +* bit: |---3-------2-------1-------0 +* | cs1 cs1_ovr cs0 cs0_ovr +*/ +#define ELBA_SPICS_SHIFT (cs) (2 * (cs)) +#define ELBA_SPICS_MASK (cs) (0x3 << ELBA_SPICS_SHIFT(cs)) +#define ELBA_SPICS_SET (cs, val) \ + ((((val) << 1) | 0x1) << ELBA_SPICS_SHIFT(cs)) +/* * The Designware SPI controller (referred to as master in the documentation) * automatically deasserts chip select when the tx fifo is empty. The chip @@ -238,6 +256,72 @@ static int dw_spi_canaan_k210_init(struct platform_device *pdev,return 0 ;
drivers/spi/spi-dw-mmio.c static int dw_spi_canaan_k210_init(struct platform_device *pdev, · line 266
Quoted 10 lines
drivers/spi/spi-dw-mmio.c +7
-0} +static void elba_spics_set_cs (struct dw_spi_elba *dwselba,int cs,int enable) +{ +regmap_update_bits (dwselba->regmap, dwselba->reg,ELBA_SPICS_MASK (cs), +ELBA_SPICS_SET (cs, enable)); +} + +static void dw_spi_elba_set_cs (struct spi_device *spi,bool enable)
The methods naming is ambiguous. Moreover it breaks this module naming convention. Could you change them to something like:dw_spi_elba_override_cs()
anddw_spi_elba_set_cs()
?
Quoted 43 lines
drivers/spi/spi-dw-mmio.c +43
-0+{ +struct dw_spi *dws =spi_master_get_devdata (spi->master); + struct dw_spi_mmio *dwsmmio = container_of(dws, struct dw_spi_mmio, dws); +struct dw_spi_elba *dwselba = dwsmmio->priv; +u8 cs; + + cs = spi->chip_select; +if (cs <2 ) { +/* overridden native chip-select */ +elba_spics_set_cs (dwselba, spi->chip_select, enable); + } + +/* +* The DW SPI controller needs a native CS bit selected to start +* the serial engine and the platform may have fewer native CSs +* than needed, so use CS0 always. +*/ + spi->chip_select =0 ; +dw_spi_set_cs (spi, enable); + spi->chip_select = cs; +} + +static int dw_spi_elba_init (struct platform_device *pdev, +struct dw_spi_mmio *dwsmmio) +{ +struct of_phandle_args args; +struct dw_spi_elba *dwselba; +struct regmap *regmap; +int rc; + + rc =of_parse_phandle_with_fixed_args (pdev->dev.of_node, +"pensando,syscon-spics" ,1 ,0 , &args); +if (rc) { +dev_err (&pdev->dev,"could not find spics\n" ); +return rc; + } + + regmap =syscon_node_to_regmap (args.np); +if (IS_ERR (regmap)) +return dev_err_probe (&pdev->dev,PTR_ERR (regmap), +"could not map spics" ); + + dwselba =devm_kzalloc (&pdev->dev,sizeof (*dwselba),GFP_KERNEL );
drivers/spi/spi-dw-mmio.c static int dw_spi_canaan_k210_init(struct platform_device *pdev, · line 317
Quoted 10 lines
drivers/spi/spi-dw-mmio.c +9
-0+if (!dwselba) +return -ENOMEM ; + + dwselba->regmap = regmap; + dwselba->reg = args.args[0 ]; + +/* deassert cs */ +elba_spics_set_cs (dwselba,0 ,1 ); +elba_spics_set_cs (dwselba,1 ,1 );
What if the CS lines are of the active-high type? In that case basically you get to do the opposite to what you claim in the comment here.
Note the CS setting into the deactivated state is done in the spi_setup() method anyway, at the moment of the peripheral SPI device registration stage (see its calling the spi_set_cs() function). Thus what you are doing here is redundant.
-Sergey
Quoted 21 lines
drivers/spi/spi-dw-mmio.c +7
-0+ + dwsmmio->priv = dwselba; + dwsmmio->dws.set_cs = dw_spi_elba_set_cs; + +return 0 ; +} +static int dw_spi_mmio_probe (struct platform_device *pdev){
drivers/spi/spi-dw-mmio.c +1
-0int (*init_func)(struct platform_device *pdev,@@ -352,6 +436,7 @@ static const struct of_device_id dw_spi_mmio_of_match[] = { { .compatible = "intel,keembay-ssi", .data = dw_spi_keembay_init}, { .compatible = "microchip,sparx5-spi", dw_spi_mscc_sparx5_init}, { .compatible = "canaan,k210-spi", dw_spi_canaan_k210_init}, + { .compatible = "pensando,elba-spi", .data = dw_spi_elba_init}, { /* end of table */} };MODULE_DEVICE_TABLE (of, dw_spi_mmio_of_match);Signature · 1 line
2.17.1
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH 10/11] spi: dw: Add support for Pensando Elba SoC
Hi Sergey,
Quoted 15 lines · Serge Semin
drivers/spi/spi-dw-mmio.c static int dw_spi_canaan_k210_init(struct platform_device *pdev, · line 265
Quoted 8 lines
drivers/spi/spi-dw-mmio.c +7
-0+static void elba_spics_set_cs (struct dw_spi_elba *dwselba,int cs,int enable) +{ +regmap_update_bits (dwselba->regmap, dwselba->reg,ELBA_SPICS_MASK (cs), +ELBA_SPICS_SET (cs, enable)); +} + +static void dw_spi_elba_set_cs (struct spi_device *spi,bool enable)The methods naming is ambiguous. Moreover it breaks this module naming convention. Could you change them to something like:
dw_spi_elba_override_cs()
anddw_spi_elba_set_cs()
?
Yes, changed elba_spics_set_cs() -> dw_spi_elba_override_cs()
Quoted 5 lines
drivers/spi/spi-dw-mmio.c static int dw_spi_canaan_k210_init(struct platform_device *pdev, · line 317
Quoted 4 lines
drivers/spi/spi-dw-mmio.c +3
-0+/* deassert cs */ +elba_spics_set_cs (dwselba,0 ,1 ); +elba_spics_set_cs (dwselba,1 ,1 );
Quoted 7 lines
What if the CS lines are of the active-high type? In that case basically you get to do the opposite to what you claim in the comment here.
Note the CS setting into the deactivated state is done in the
spi_setup()method anyway, at the moment of the peripheral SPI device registration stage (see its calling thespi_set_cs()function). Thus what you are doing here is redundant.
Yes this is a redundant initialization and is removed. For Elba these CS lines are active-low only.
Regards,
Brad
PATCH 11/11 arm64: dts: Add Pensando Elba SoC support
In reply to Brad LarsonAdd Pensando common and Elba SoC specific device nodes
---
Change from V3:
- Changed to dual copyright (GPL-2.0+ OR MIT)
- Minor changes from review input
arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/pensando/Makefile | 3 + arch/arm64/boot/dts/pensando/elba-16core.dtsi | 189 ++++++++++++++++++ .../boot/dts/pensando/elba-asic-common.dtsi | 98 +++++++++ arch/arm64/boot/dts/pensando/elba-asic.dts | 28 +++ .../boot/dts/pensando/elba-flash-parts.dtsi | 106 ++++++++++ arch/arm64/boot/dts/pensando/elba.dtsi | 189 ++++++++++++++++++ 7 files changed, 614 insertions(+) create mode 100644 arch/arm64/boot/dts/pensando/Makefile create mode 100644 arch/arm64/boot/dts/pensando/elba-16core.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba-asic-common.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba-asic.dts create mode 100644 arch/arm64/boot/dts/pensando/elba-flash-parts.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba.dtsi
arch/arm64/boot/dts/Makefile +1 -0
@@ -20,6 +20,7 @@ subdir-y += marvell subdir-y += mediatek subdir-y += microchip subdir-y += nvidia +subdir-y += pensando subdir-y += qcom subdir-y += realtek subdir-y += renesas
arch/arm64/boot/dts/pensando/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +dtb-$(CONFIG_ARCH_PENSANDO) += elba-asic.dtb
arch/arm64/boot/dts/pensando/elba-16core.dtsi new file +189 -0
189 lines not on this page · raw message
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +98 -0
98 lines not on this page · raw message
arch/arm64/boot/dts/pensando/elba-asic.dts new file +28 -0
@@ -0,0 +1,28 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Device Tree file for Pensando Elba Board. + * + * Copyright (c) 2020-2022 Pensando Systems Inc. + */ + +/dts-v1/; + +#include "elba.dtsi" +#include "elba-16core.dtsi" +#include "elba-asic-common.dtsi" +#include "elba-flash-parts.dtsi" + +/ { + model = "Pensando Elba Board"; + compatible = "pensando,elba-ortano", "pensando,elba"; + + aliases { + serial0 = &uart0; + spi0 = &spi0; + spi1 = &qspi; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +};
arch/arm64/boot/dts/pensando/elba-flash-parts.dtsi new file +106 -0
106 lines not on this page · raw message
arch/arm64/boot/dts/pensando/elba.dtsi new file +189 -0
189 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [PATCH 11/11] arm64: dts: Add Pensando Elba SoC support
Quoted 23 lines · Brad Larson
Add Pensando common and Elba SoC specific device nodes
Signed-off-by Brad Larson <[email protected]>---
Change from V3:
- Changed to dual copyright (GPL-2.0+ OR MIT)
- Minor changes from review inputarch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/pensando/Makefile | 3 + arch/arm64/boot/dts/pensando/elba-16core.dtsi | 189 ++++++++++++++++++ .../boot/dts/pensando/elba-asic-common.dtsi | 98 +++++++++ arch/arm64/boot/dts/pensando/elba-asic.dts | 28 +++ .../boot/dts/pensando/elba-flash-parts.dtsi | 106 ++++++++++ arch/arm64/boot/dts/pensando/elba.dtsi | 189 ++++++++++++++++++ 7 files changed, 614 insertions(+) create mode 100644 arch/arm64/boot/dts/pensando/Makefile create mode 100644 arch/arm64/boot/dts/pensando/elba-16core.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba-asic-common.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba-asic.dts create mode 100644 arch/arm64/boot/dts/pensando/elba-flash-parts.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba.dtsi
[...]
Quoted 6 lines
arch/arm64/boot/dts/pensando/elba.dtsi new file +0
-0
[...]
arch/arm64/boot/dts/pensando/elba.dtsi line 153
Quoted 9 lines
arch/arm64/boot/dts/pensando/elba.dtsi new file +9
-0+ gic: interrupt-controller@800000 { + compatible = "arm,gic-v3"; + #interrupt-cells = <3>; + #address-cells = <2>; + #size-cells = <2>; + ranges; + interrupt-controller; + reg = <0x0 0x800000 0x0 0x200000>, /* GICD */ + <0x0 0xa00000 0x0 0x200000>; /* GICR */
You are still missing the GICV and GICH regions that are provided by the CPU. I already pointed that out in [1].
The Cortex-A72 TRM will tell you where to find them (at an offset from PERIPHBASE).
Please fix this.
M.
[1] https://lore.kernel.org/all/[email protected]
Signature · 1 line
Jazz is not dead. It just smells funny...
Re: [PATCH 11/11] arm64: dts: Add Pensando Elba SoC support
Quoted 11 lines · Marc Zyngier
arch/arm64/boot/dts/pensando/elba.dtsi line 153
Quoted 10 lines
arch/arm64/boot/dts/pensando/elba.dtsi new file +9
-0+ gic: interrupt-controller@800000 { + compatible = "arm,gic-v3"; + #interrupt-cells = <3>; + #address-cells = <2>; + #size-cells = <2>; + ranges; + interrupt-controller; + reg = <0x0 0x800000 0x0 0x200000>, /* GICD */ + <0x0 0xa00000 0x0 0x200000>; /* GICR */
Quoted 5 lines
You are still missing the GICV and GICH regions that are provided by the CPU. I already pointed that out in [1].
The Cortex-A72 TRM will tell you where to find them (at an offset from PERIPHBASE).
Hi Marc,
Got the addresses, neither region is used, and will be included in the next submission.
Best,
Brad
Re: [PATCH 11/11] arm64: dts: Add Pensando Elba SoC support
Quoted 16 lines · Brad Larson
Quoted 14 lines · Marc Zyngier
arch/arm64/boot/dts/pensando/elba.dtsi line 153
Quoted 10 lines
arch/arm64/boot/dts/pensando/elba.dtsi new file +9
-0+ gic: interrupt-controller@800000 { + compatible = "arm,gic-v3"; + #interrupt-cells = <3>; + #address-cells = <2>; + #size-cells = <2>; + ranges; + interrupt-controller; + reg = <0x0 0x800000 0x0 0x200000>, /* GICD */ + <0x0 0xa00000 0x0 0x200000>; /* GICR */You are still missing the GICV and GICH regions that are provided by the CPU. I already pointed that out in [1].
Quoted 7 lines
Quoted 2 lines
The Cortex-A72 TRM will tell you where to find them (at an offset from PERIPHBASE).
Hi Marc,
Got the addresses, neither region is used, and will be included in the next submission.
Not sure what you mean by these regions being unused here (the Linux kernel definitely makes use of them). Note that you'll also need to add GICC (which I forgot to mention above).
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
Re: [PATCH 11/11] arm64: dts: Add Pensando Elba SoC support
Hi Marc,
Quoted 11 lines · Marc Zyngier
Quoted 8 lines · Brad Larson
Quoted 7 lines
You are still missing the GICV and GICH regions that are provided by the CPU. I already pointed that out in [1].
The Cortex-A72 TRM will tell you where to find them (at an offset from PERIPHBASE).
Quoted 8 lines
Quoted 4 lines
Hi Marc,
Got the addresses, neither region is used, and will be included in the next submission.
Not sure what you mean by these regions being unused here (the Linux kernel definitely makes use of them). Note that you'll also need to add GICC (which I forgot to mention above).
Added missing GICV, GICH and GICC regions.
Regards,
Brad
Re: [PATCH 11/11] arm64: dts: Add Pensando Elba SoC support
In reply to Brad LarsonQuoted 7 lines · Brad Larson
Add Pensando common and Elba SoC specific device nodes
Signed-off-by Brad Larson <[email protected]>---
Change from V3:
- Changed to dual copyright (GPL-2.0+ OR MIT)
- Minor changes from review input
Thank you for your patch. There is something to discuss/improve.
(...)
Quoted 5 lines
+&i2c0 {
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +4
-0+ clock-frequency = <100000>; + status = "okay"; + rtc@51 { + compatible = "nxp,pcf85263";
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi line 65
Quoted 10 lines
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +10
-0+ reg = <0x51>; + }; +}; + +&spi0 { + num-cs = <4>; + cs-gpios = <0>, <0>, <&porta 1 GPIO_ACTIVE_LOW>, + <&porta 7 GPIO_ACTIVE_LOW>; + status = "okay"; + spi0_cs0@0 {
Generic node name needed matching the class of a devicxe.
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi line 66
Quoted 1 line
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +1
-0+ compatible = "semtech,sx1301"; /* Enable spidev */
This comment is a bit odd... did you just use random compatible from spidev instead of defining proper compatible?
Review
Quoted 2 lines
(quoted diff) +2
-0+ #address-cells = <1>; + #size-cells = <1>;
Why address/size cells?
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi line 70
Quoted 2 lines
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +2
-0+ spi-max-frequency = <12000000>; + reg = <0>;
Please put reg just after compatible. It's the most common pattern.
Quoted 10 lines
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +10
-0+ }; + + spi0_cs1@1 { + compatible = "semtech,sx1301"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <12000000>; + reg = <1>; + }; +
(...)
Quoted 6 lines
arch/arm64/boot/dts/pensando/elba.dtsi new file +6
-0+ + emmc: mmc@30440000 { + compatible = "pensando,elba-sd4hc", "cdns,sd4hc"; + clocks = <&emmc_clk>; + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0 0x30440000 0x0 0x10000>,
arch/arm64/boot/dts/pensando/elba.dtsi line 184
Quoted 10 lines
arch/arm64/boot/dts/pensando/elba.dtsi new file +10
-0+ <0x0 0x30480044 0x0 0x4>; /* byte-lane ctrl */ + cdns,phy-input-delay-sd-highspeed = <0x4>; + cdns,phy-input-delay-legacy = <0x4>; + cdns,phy-input-delay-sd-uhs-sdr50 = <0x6>; + cdns,phy-input-delay-sd-uhs-ddr50 = <0x16>; + mmc-ddr-1_8v; + status = "disabled"; + }; + + mssoc: mssoc@307c0000 {
Generic node name.
arch/arm64/boot/dts/pensando/elba.dtsi line 185
Quoted 1 line
arch/arm64/boot/dts/pensando/elba.dtsi new file +1
-0+ compatible = "syscon", "simple-mfd";
This does not look correct. Syscon is okay, but why do you need simple-mfd (there are no children here)?
arch/arm64/boot/dts/pensando/elba.dtsi line 189
Quoted 4 lines
arch/arm64/boot/dts/pensando/elba.dtsi new file +4
-0+ reg = <0x0 0x307c0000 0x0 0x3000>; + }; + }; +};
Best regards,
Krzysztof
Re: [PATCH 11/11] arm64: dts: Add Pensando Elba SoC support
Hi Krzysztof,
Quoted 4 lines · Krzysztof Kozlowski
Quoted 2 lines · Brad Larson
Add Pensando common and Elba SoC specific device nodes
Quoted 8 lines
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi line 65
Quoted 6 lines
+&spi0 {
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +5
-0+ num-cs = <4>; + cs-gpios = <0>, <0>, <&porta 1 GPIO_ACTIVE_LOW>, + <&porta 7 GPIO_ACTIVE_LOW>; + status = "okay"; + spi0_cs0@0 {Generic node name needed matching the class of a devicxe.
The device on this spi bus is a FPGA with 4 functions and looking at other projects I've changed it to a resource-controller node name. On cs0 there is a sub-device reset-controller added in the upcoming patchset to enable hardware reset of the eMMC device.
Quoted 4 lines
Quoted 1 line
+ compatible = "semtech,sx1301"; /* Enable spidev */
This comment is a bit odd... did you just use random compatible from spidev instead of defining proper compatible?
Yes, because adding a compatible was nacked. We have a driver added (two actually, mfd and reset driver) for the next patch update.
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ #address-cells = <1>; + #size-cells = <1>;Why address/size cells?
Removed where not needed
Quoted 4 lines
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi line 70
Quoted 2 lines
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +2
-0+ spi-max-frequency = <12000000>; + reg = <0>;Please put reg just after compatible. It's the most common pattern.
Yes, moved reg to be right after compatible
Quoted 10 lines
Quoted 10 lines
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +10
-0+ }; + + spi0_cs1@1 { + compatible = "semtech,sx1301"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <12000000>; + reg = <1>; + }; +
(...)
Quoted 4 lines
arch/arm64/boot/dts/pensando/elba.dtsi line 184
Quoted 2 lines
arch/arm64/boot/dts/pensando/elba.dtsi new file +2
-0+ + mssoc: mssoc@307c0000 {Generic node name.
Changed to syscon
Quoted 4 lines
Quoted 1 line
+ compatible = "syscon", "simple-mfd";
This does not look correct. Syscon is okay, but why do you need simple-mfd (there are no children here)?
Yes, removed "simple-mfd"
Regards,
Brad
Re: [PATCH 11/11] arm64: dts: Add Pensando Elba SoC support
Quoted 22 lines · Brad Larson
Hi Krzysztof,
Quoted 4 lines · Krzysztof Kozlowski
Quoted 2 lines · Brad Larson
Add Pensando common and Elba SoC specific device nodes
Quoted 8 lines
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi line 65
Quoted 6 lines
+&spi0 {
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +5
-0+ num-cs = <4>; + cs-gpios = <0>, <0>, <&porta 1 GPIO_ACTIVE_LOW>, + <&porta 7 GPIO_ACTIVE_LOW>; + status = "okay"; + spi0_cs0@0 {Generic node name needed matching the class of a devicxe.
The device on this spi bus is a FPGA with 4 functions and looking at other projects I've changed it to a resource-controller node name. On cs0 there is a sub-device reset-controller added in the upcoming patchset to enable hardware reset of the eMMC device.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
+ compatible = "semtech,sx1301"; /* Enable spidev */
This comment is a bit odd... did you just use random compatible from spidev instead of defining proper compatible?
Yes, because adding a compatible was nacked. We have a driver added (two actually, mfd and reset driver) for the next patch update.
Yeah, but using some other one is also not correct.
Best regards,
Krzysztof
Re: [PATCH 11/11] arm64: dts: Add Pensando Elba SoC support
In reply to Brad LarsonQuoted 7 lines · Brad Larson
Add Pensando common and Elba SoC specific device nodes
Signed-off-by Brad Larson <[email protected]>---
Change from V3:
- Changed to dual copyright (GPL-2.0+ OR MIT)
- Minor changes from review input
Thank you for your patch. There is something to discuss/improve.
(...)
Quoted 5 lines
+&i2c0 {
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +4
-0+ clock-frequency = <100000>; + status = "okay"; + rtc@51 { + compatible = "nxp,pcf85263";
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi line 65
Quoted 10 lines
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +10
-0+ reg = <0x51>; + }; +}; + +&spi0 { + num-cs = <4>; + cs-gpios = <0>, <0>, <&porta 1 GPIO_ACTIVE_LOW>, + <&porta 7 GPIO_ACTIVE_LOW>; + status = "okay"; + spi0_cs0@0 {
Generic node name needed matching the class of a devicxe.
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi line 66
Quoted 1 line
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +1
-0+ compatible = "semtech,sx1301"; /* Enable spidev */
This comment is a bit odd... did you just use random compatible from spidev instead of defining proper compatible?
Review
Quoted 2 lines
(quoted diff) +2
-0+ #address-cells = <1>; + #size-cells = <1>;
Why address/size cells?
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi line 70
Quoted 2 lines
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +2
-0+ spi-max-frequency = <12000000>; + reg = <0>;
Please put reg just after compatible. It's the most common pattern.
Quoted 10 lines
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +10
-0+ }; + + spi0_cs1@1 { + compatible = "semtech,sx1301"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <12000000>; + reg = <1>; + }; +
(...)
Quoted 6 lines
arch/arm64/boot/dts/pensando/elba.dtsi new file +6
-0+ + emmc: mmc@30440000 { + compatible = "pensando,elba-sd4hc", "cdns,sd4hc"; + clocks = <&emmc_clk>; + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0 0x30440000 0x0 0x10000>,
arch/arm64/boot/dts/pensando/elba.dtsi line 184
Quoted 10 lines
arch/arm64/boot/dts/pensando/elba.dtsi new file +10
-0+ <0x0 0x30480044 0x0 0x4>; /* byte-lane ctrl */ + cdns,phy-input-delay-sd-highspeed = <0x4>; + cdns,phy-input-delay-legacy = <0x4>; + cdns,phy-input-delay-sd-uhs-sdr50 = <0x6>; + cdns,phy-input-delay-sd-uhs-ddr50 = <0x16>; + mmc-ddr-1_8v; + status = "disabled"; + }; + + mssoc: mssoc@307c0000 {
Generic node name.
arch/arm64/boot/dts/pensando/elba.dtsi line 185
Quoted 1 line
arch/arm64/boot/dts/pensando/elba.dtsi new file +1
-0+ compatible = "syscon", "simple-mfd";
This does not look correct. Syscon is okay, but why do you need simple-mfd (there are no children here)?
arch/arm64/boot/dts/pensando/elba.dtsi line 189
Quoted 4 lines
arch/arm64/boot/dts/pensando/elba.dtsi new file +4
-0+ reg = <0x0 0x307c0000 0x0 0x3000>; + }; + }; +};
Best regards,
Krzysztof
Re: [PATCH 11/11] arm64: dts: Add Pensando Elba SoC support
In reply to Brad LarsonQuoted 23 lines · Brad Larson
Add Pensando common and Elba SoC specific device nodes
Signed-off-by Brad Larson <[email protected]>---
Change from V3:
- Changed to dual copyright (GPL-2.0+ OR MIT)
- Minor changes from review inputarch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/pensando/Makefile | 3 + arch/arm64/boot/dts/pensando/elba-16core.dtsi | 189 ++++++++++++++++++ .../boot/dts/pensando/elba-asic-common.dtsi | 98 +++++++++ arch/arm64/boot/dts/pensando/elba-asic.dts | 28 +++ .../boot/dts/pensando/elba-flash-parts.dtsi | 106 ++++++++++ arch/arm64/boot/dts/pensando/elba.dtsi | 189 ++++++++++++++++++ 7 files changed, 614 insertions(+) create mode 100644 arch/arm64/boot/dts/pensando/Makefile create mode 100644 arch/arm64/boot/dts/pensando/elba-16core.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba-asic-common.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba-asic.dts create mode 100644 arch/arm64/boot/dts/pensando/elba-flash-parts.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba.dtsi
[...]
Quoted 104 lines
arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file +98
-0@@ -0,0 +1,98 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2020-2022, Pensando Systems Inc. + */ + +&ahb_clk { + clock-frequency = <400000000>; +}; + +&emmc_clk { + clock-frequency = <200000000>; +}; + +&flash_clk { + clock-frequency = <400000000>; +}; + +&ref_clk { + clock-frequency = <156250000>; +}; + +&qspi { + status = "okay"; + flash0: flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + spi-rx-bus-width = <2>; + m25p,fast-read; + cdns,read-delay = <0>; + cdns,tshsl-ns = <0>; + cdns,tsd2d-ns = <0>; + cdns,tchsh-ns = <0>; + cdns,tslch-ns = <0>; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&emmc { + bus-width = <8>; + status = "okay"; +}; + +&wdt0 { + status = "okay"; +}; + +&i2c0 { + clock-frequency = <100000>; + status = "okay"; + rtc@51 { + compatible = "nxp,pcf85263"; + reg = <0x51>; + }; +}; + +&spi0 { + num-cs = <4>; + cs-gpios = <0>, <0>, <&porta 1 GPIO_ACTIVE_LOW>, + <&porta 7 GPIO_ACTIVE_LOW>; + status = "okay"; + spi0_cs0@0 { + compatible = "semtech,sx1301"; /* Enable spidev */ + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <12000000>; + reg = <0>; + }; + + spi0_cs1@1 { + compatible = "semtech,sx1301"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <12000000>; + reg = <1>; + }; + + spi0_cs2@2 { + compatible = "semtech,sx1301"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <12000000>; + reg = <2>; + interrupt-parent = <&porta>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; + + spi0_cs3@3 { + compatible = "semtech,sx1301"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <12000000>; + reg = <3>; + }; +};
[...]
Quoted 96 lines
arch/arm64/boot/dts/pensando/elba.dtsi new file +90
-0@@ -0,0 +1,189 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2020-2022, Pensando Systems Inc. + */ + +#include <dt-bindings/gpio/gpio.h> +#include "dt-bindings/interrupt-controller/arm-gic.h" + +/ { + model = "Elba ASIC Board"; + compatible = "pensando,elba"; + interrupt-parent = <&gic>; + #address-cells = <2>; + #size-cells = <2>; + + dma-coherent; + + ahb_clk: oscillator0 { + compatible = "fixed-clock"; + #clock-cells = <0>; + }; + + emmc_clk: oscillator2 { + compatible = "fixed-clock"; + #clock-cells = <0>; + }; + + flash_clk: oscillator3 { + compatible = "fixed-clock"; + #clock-cells = <0>; + }; + + ref_clk: oscillator4 { + compatible = "fixed-clock"; + #clock-cells = <0>; + }; + + psci { + compatible = "arm,psci-0.2"; + method = "smc"; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>, + <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>, + <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>, + <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>; + }; + + pmu { + compatible = "arm,cortex-a72-pmu"; + interrupts = <GIC_PPI 7 IRQ_TYPE_LEVEL_LOW>; + }; + + soc: soc { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + i2c0: i2c@400 { + compatible = "snps,designware-i2c"; + reg = <0x0 0x400 0x0 0x100>; + clocks = <&ahb_clk>; + #address-cells = <1>; + #size-cells = <0>; + i2c-sda-hold-time-ns = <480>; + snps,sda-timeout-ms = <750>; + interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + wdt0: watchdog@1400 { + compatible = "snps,dw-wdt"; + reg = <0x0 0x1400 0x0 0x100>; + clocks = <&ahb_clk>; + interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + qspi: spi@2400 { + compatible = "pensando,elba-qspi", "cdns,qspi-nor"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x2400 0x0 0x400>, + <0x0 0x7fff0000 0x0 0x1000>; + interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&flash_clk>; + cdns,fifo-depth = <1024>;
arch/arm64/boot/dts/pensando/elba.dtsi line 99
Quoted 10 lines
arch/arm64/boot/dts/pensando/elba.dtsi new file +9
-0+ cdns,fifo-width = <4>; + cdns,trigger-address = <0x7fff0000>; + status = "disabled"; + }; + + spi0: spi@2800 { + compatible = "pensando,elba-spi"; + reg = <0x0 0x2800 0x0 0x100>; + pensando,syscon-spics = <&mssoc 0x2468>;
I am wondering do you really need to define the "pensando,syscon-spics" property as accepting a phandle with an additional argument? That would have been justified if you had at least two SPI controllers with different CS override registers. AFAICS you've got only one here. So you can simplify the bindings by defining the property like "pensando,syscon" (with no "spics" suffix) which accepts the syscon phandle alone. Respective SPICS offset can be locally declared in the driver as a macro with respective name.
-Sergey
Quoted 93 lines
arch/arm64/boot/dts/pensando/elba.dtsi new file +90
-0+ clocks = <&ahb_clk>; + interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; + #address-cells = <1>; + #size-cells = <0>; + num-cs = <2>; + status = "disabled"; + }; + + gpio0: gpio@4000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dw-apb-gpio"; + reg = <0x0 0x4000 0x0 0x78>; + status = "disabled"; + + porta: gpio-port@0 { + compatible = "snps,dw-apb-gpio-port"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + ngpios = <8>; + interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>; + interrupt-controller; + interrupt-parent = <&gic>; + #interrupt-cells = <2>; + }; + + portb: gpio-port@1 { + compatible = "snps,dw-apb-gpio-port"; + reg = <1>; + gpio-controller; + #gpio-cells = <2>; + ngpios = <8>; + }; + }; + + uart0: serial@4800 { + compatible = "ns16550a"; + reg = <0x0 0x4800 0x0 0x100>; + clocks = <&ref_clk>; + interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + }; + + gic: interrupt-controller@800000 { + compatible = "arm,gic-v3"; + #interrupt-cells = <3>; + #address-cells = <2>; + #size-cells = <2>; + ranges; + interrupt-controller; + reg = <0x0 0x800000 0x0 0x200000>, /* GICD */ + <0x0 0xa00000 0x0 0x200000>; /* GICR */ + interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>; + + /* + * Elba specific pre-ITS is enabled using the + * existing property socionext,synquacer-pre-its + */ + gic_its: msi-controller@820000 { + compatible = "arm,gic-v3-its"; + msi-controller; + #msi-cells = <1>; + reg = <0x0 0x820000 0x0 0x10000>; + socionext,synquacer-pre-its = + <0xc00000 0x1000000>; + }; + }; + + emmc: mmc@30440000 { + compatible = "pensando,elba-sd4hc", "cdns,sd4hc"; + clocks = <&emmc_clk>; + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0 0x30440000 0x0 0x10000>, + <0x0 0x30480044 0x0 0x4>; /* byte-lane ctrl */ + cdns,phy-input-delay-sd-highspeed = <0x4>; + cdns,phy-input-delay-legacy = <0x4>; + cdns,phy-input-delay-sd-uhs-sdr50 = <0x6>; + cdns,phy-input-delay-sd-uhs-ddr50 = <0x16>; + mmc-ddr-1_8v; + status = "disabled"; + }; + + mssoc: mssoc@307c0000 { + compatible = "syscon", "simple-mfd"; + reg = <0x0 0x307c0000 0x0 0x3000>; + }; + }; +};Signature · 1 line
2.17.1
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH 11/11] arm64: dts: Add Pensando Elba SoC support
Hi Sergey,
Quoted 9 lines · Serge Semin
arch/arm64/boot/dts/pensando/elba.dtsi line 99
Quoted 5 lines · Brad Larson
arch/arm64/boot/dts/pensando/elba.dtsi new file +4
-0+ spi0: spi@2800 { + compatible = "pensando,elba-spi"; + reg = <0x0 0x2800 0x0 0x100>; + pensando,syscon-spics = <&mssoc 0x2468>;
Quoted 8 lines
I am wondering do you really need to define the "pensando,syscon-spics" property as accepting a phandle with an additional argument? That would have been justified if you had at least two SPI controllers with different CS override registers. AFAICS you've got only one here. So you can simplify the bindings by defining the property like "pensando,syscon" (with no "spics" suffix) which accepts the syscon phandle alone. Respective SPICS offset can be locally declared in the driver as a macro with respective name.
Yes this can be simplified and doing that in updated patchset. Only this API call is needed in dw_spi_elba_init().
syscon_regmap_lookup_by_phandle(np, "pensando,syscon");
Regards,
Brad