Skip to contentSkip to conversation

StarFive's SDIO/eMMC driver support

PATCH Superseded William Qiu 4 participants 7 messages Mar 7, 2023 – Mar 9, 2023

Subsystems (6)

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

William Qiu

author maintainer
#0 lore raw

v5 cover StarFive's SDIO/eMMC driver support

Hi,

This patchset adds initial rudimentary support for the StarFive designware mobile storage host controller driver. And this driver will be used in StarFive's VisionFive 2 board. The main purpose of adding this driver is to accommodate the ultra-high speed mode of eMMC.

Changes v4->v5:
- Added a incremental updates to fix a bug that prev_err is uninitialized.
- Dropped the merged patches.
- Dropped the dts patch.
- Sorted compatible alphabetically in yaml.

Changes v3->v4:
- Added documentation to describe StarFive System Controller Registers.
- Added aon_syscon and stg_syscon node.
- Fixed some checkpatch errors/warnings.

Changes v2->v3:
- Wraped commit message according to Linux coding style.
- Rephrased the description of the patches.
- Changed the description of syscon regsiter.
- Dropped redundant properties.

Changes v1->v2:
- Renamed the dt-binding 'starfive,jh7110-sdio.yaml' to 'starfive,jh7110-mmc.yaml'.
- Changed the type of 'starfive,syscon' and modify its description.
- Deleted unused head files like '#include <linux/gpio.h>'.
- Added comment for the 'rise_point' and 'fall_point'.
- Changed the API 'num_caps' to 'common_caps'.
- Changed the node name 'sys_syscon' to 'syscon'.
- Changed the node name 'sdio' to 'mmc'.

The patch series is based on v6.1.

William Qiu (2):
dt-bindings: syscon: Add StarFive syscon doc
mmc: starfive: Add initialization of prev_err

 .../bindings/soc/starfive/jh7110-syscon.yaml  | 41 +++++++++++++++++++
 MAINTAINERS                                   |  5 +++
 drivers/mmc/host/dw_mmc-starfive.c            |  2 +-
 3 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml

--
2.34.1

author maintainer
#1 lore raw

PATCH v5 1/2 dt-bindings: syscon: Add StarFive syscon doc

Add documentation to describe StarFive System Controller Registers.

---
 .../bindings/soc/starfive/jh7110-syscon.yaml  | 41 +++++++++++++++++++
 MAINTAINERS                                   |  5 +++
 2 files changed, 46 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +41 -0
new file mode 100644
index 000000000000..72c8850602b5
@@ -0,0 +1,41 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/starfive/jh7110-syscon.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: StarFive JH7110 SoC system controller
+
+maintainers:
+  - William Qiu <[email protected]>
+
+description: |
+  The StarFive JH7110 SoC system controller provides register information such
+  as offset, mask and shift to configure related modules such as MMC and PCIe.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - starfive,jh7110-aon-syscon
+          - starfive,jh7110-stg-syscon
+          - starfive,jh7110-sys-syscon
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    syscon@10240000 {
+        compatible = "starfive,jh7110-stg-syscon", "syscon";
+        reg = <0x10240000 0x1000>;
+    };
+
+...
MAINTAINERS +5 -0
index 644ac9479a6e..fc9d1781516a 100644
@@ -19665,6 +19665,11 @@ F:	Documentation/devicetree/bindings/reset/starfive,jh7100-reset.yaml
 F:	drivers/reset/starfive/reset-starfive-jh71*
 F:	include/dt-bindings/reset/starfive?jh71*.h
 
+STARFIVE JH7110 SYSCON
+M:	William Qiu <[email protected]>
+S:	Supported
+F:	Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml
+
 STATIC BRANCH/CALL
 M:	Peter Zijlstra <[email protected]>
 M:	Josh Poimboeuf <[email protected]>
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v5 1/2] dt-bindings: syscon: Add StarFive syscon doc

Quoted 1 line · William Qiu

Add documentation to describe StarFive System Controller Registers.

Use subject prefixes matching the subsystem (which you can get for example with git log --oneline -- DIRECTORY_OR_FILE on the directory your patch is touching). This is not "syscon" subsystem, but rather starfive.

Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml

Quoted 14 lines
---
 .../bindings/soc/starfive/jh7110-syscon.yaml  | 41 +++++++++++++++++++
 MAINTAINERS                                   |  5 +++
 2 files changed, 46 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +0 -0
new file mode 100644
index 000000000000..72c8850602b5

Filename: starfive,jh7110-syscon.yaml

Best regards,
Krzysztof

author maintainer
#3 lore raw

Re: [PATCH v5 1/2] dt-bindings: syscon: Add StarFive syscon doc

Quoted 8 lines · Krzysztof Kozlowski
Quoted 1 line · William Qiu

Add documentation to describe StarFive System Controller Registers.

Use subject prefixes matching the subsystem (which you can get for example with git log --oneline -- DIRECTORY_OR_FILE on the directory your patch is touching). This is not "syscon" subsystem, but rather starfive.

Will update.

Quoted 9 lines
Quoted 9 lines
---
 .../bindings/soc/starfive/jh7110-syscon.yaml  | 41 +++++++++++++++++++
 MAINTAINERS                                   |  5 +++
 2 files changed, 46 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml
Quoted 8 lines

Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml

Quoted 5 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +0 -0
new file mode 100644
index 000000000000..72c8850602b5

Filename: starfive,jh7110-syscon.yaml

Will update.
Thanks for taking times to review this patch series.

Best regards
William

Quoted 5 lines

Best regards,
Krzysztof

author maintainer
#4 lore raw

PATCH v5 2/2 mmc: starfive: Add initialization of prev_err

In reply to William Qiu

Add a incremental updates to fix a bug that prev_err is uninitialized.

---
 drivers/mmc/host/dw_mmc-starfive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/dw_mmc-starfive.c +1 -1
index 40f5969b07a6..dab1508bf83c 100644
@@ -51,7 +51,7 @@ static int dw_mci_starfive_execute_tuning(struct dw_mci_slot *slot,
 	struct dw_mci *host = slot->host;
 	struct starfive_priv *priv = host->priv;
 	int rise_point = -1, fall_point = -1;
-	int err, prev_err;
+	int err, prev_err = 0;
 	int i;
 	bool found = 0;
 	u32 regval;
Signature · 1 line
2.34.1
Reviewed-by on v5 2/2
#5 lore raw

Re: [PATCH v5 2/2] mmc: starfive: Add initialization of prev_err

Quoted 4 lines · William Qiu

Add a incremental updates to fix a bug that prev_err is uninitialized.

Quoted 21 lines
---
 drivers/mmc/host/dw_mmc-starfive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/dw_mmc-starfive.c +1 -2
index 40f5969b07a6..dab1508bf83c 100644
@@ -51,7 +51,7 @@ static int dw_mci_starfive_execute_tuning(struct dw_mci_slot *slot,
        struct dw_mci *host = slot->host;
        struct starfive_priv *priv = host->priv;
        int rise_point = -1, fall_point = -1;
-       int err, prev_err;
+       int err, prev_err = 0;
        int i;
        bool found = 0;
        u32 regval;
--

2.34.1

Quoted 4 lines

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#6 lore raw

Re: [PATCH v5 2/2] mmc: starfive: Add initialization of prev_err

In reply to William Qiu
Quoted 5 lines · William Qiu

Add a incremental updates to fix a bug that prev_err is uninitialized.

I took the liberty of updating the commit message a bit, to try to further clarify things. Moreover, future wise, let's use the prefix, "mmc: dw_mmc-starfive" for the commit message header, to be consistent with the other dw_mmc drivers.

So, applied for fixes and by adding a fixes tag, thanks!

Kind regards
Uffe

Quoted 20 lines
---
 drivers/mmc/host/dw_mmc-starfive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/dw_mmc-starfive.c +1 -2
index 40f5969b07a6..dab1508bf83c 100644
@@ -51,7 +51,7 @@ static int dw_mci_starfive_execute_tuning(struct dw_mci_slot *slot,
        struct dw_mci *host = slot->host;
        struct starfive_priv *priv = host->priv;
        int rise_point = -1, fall_point = -1;
-       int err, prev_err;
+       int err, prev_err = 0;
        int i;
        bool found = 0;
        u32 regval;
--

2.34.1