linux-sunxi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 00/11] ARM: suniv: USB and two new boards support
@ 2023-01-11  1:53 Andre Przywara
  2023-01-11  1:53 ` [PATCH v5 01/11] dt-bindings: usb: sunxi-musb: add F1C100s MUSB compatible string Andre Przywara
                   ` (11 more replies)
  0 siblings, 12 replies; 16+ messages in thread
From: Andre Przywara @ 2023-01-11  1:53 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, Bin Liu
  Cc: Icenowy Zheng, Greg Kroah-Hartman, devicetree, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

Hi,

this is mostly a rebase of the former v4 series.
It is based on top of v6.2-rc1, and builds cleanly there. For passing
make dtbs_check, the PHY binding patch, part of a separate series[1], is
needed. For USB functionality, patch 2/3 from there is needed as well.

I put a tree with both series combined here:
https://github.com/apritzel/linux/commits/f1c100s-usb-v5

There were no changes to the actual patches, this is just a resend since
the series missed the previous merge window.

Cheers,
Andre

[1] https://lore.kernel.org/linux-phy/20230109012223.4079299-1-andre.przywara@arm.com/

================
This patchset introduces support for F1C100s' USB, and the SourceParts
PopStick and Lctech Pi boards.

The DT binding and driver support for SUNIV USB MUSB device are added, in
addition to DT changes to the DTSI and Lichee Nano DT. New DTs are added
for the SourceParts PopStick v1.1 and Lctech Pi boards.

Changelog v4 ... v5:
- Rebase on top to v6.2-rc1

Changelog v3 ... v4:
- Dropped the PHY patches, they go via a different tree and need a
  different base
- rebased on top of linux-sunxi/sunxi/for-next (provides H616 USB)
- musb DT binding: use enum
- musb cleanup: use musb_hdrc_config config pointer directly
- musb cleanup: use const where possible
- drop partitions from Popstick DTS file
- clarify Popstick has a USB type-A *plug*
- add tags

Changelog v2 ... v3:
- remove redundant "Device Tree Bindings" suffix in DT binding doc title
- add BSD license to binding doc file (as per checkpatch)
- fix some commit message title prefixes
- use proper plural spelling for usb0_id_det-gpios
- popstick.dts: Reorder otg_sram node reference alphabetically
- popstick.dts: Add regulator- prefix to 3.3V regulator node name
- popstick.dts: Fix status, compatible and reg property order
- popstick.dts: Drop unneeded mmc0 and spi0 aliases
- add patch to clean up sunxi MUSB driver
- add Acks and Reviewed-by's

Changelog v1 ... v2:
- USB PHY binding: clarify the relation with other phy-sun4i-usb bindings
- Add Popstick binding and .dts patches


Andre Przywara (4):
  usb: musb: sunxi: Introduce config struct
  dt-bindings: vendor-prefixes: add Lctech name
  dt-bindings: arm: sunxi: add compatible strings for Lctech Pi
  ARM: dts: suniv: Add Lctech Pi F1C200s devicetree

Icenowy Zheng (7):
  dt-bindings: usb: sunxi-musb: add F1C100s MUSB compatible string
  usb: musb: sunxi: add support for the F1C100s MUSB controller
  ARM: dts: suniv: add USB-related device nodes
  ARM: dts: suniv: licheepi-nano: enable USB
  dt-bindings: vendor-prefixes: add Source Parts
  dt-binding: arm: sunxi: add compatible strings for PopStick v1.1
  ARM: dts: suniv: add device tree for PopStick v1.1

 .../devicetree/bindings/arm/sunxi.yaml        | 13 +++
 .../usb/allwinner,sun4i-a10-musb.yaml         | 10 +-
 .../devicetree/bindings/vendor-prefixes.yaml  |  4 +
 arch/arm/boot/dts/Makefile                    |  4 +-
 .../boot/dts/suniv-f1c100s-licheepi-nano.dts  | 16 +++
 arch/arm/boot/dts/suniv-f1c100s.dtsi          | 32 ++++++
 arch/arm/boot/dts/suniv-f1c200s-lctech-pi.dts | 76 ++++++++++++++
 .../boot/dts/suniv-f1c200s-popstick-v1.1.dts  | 81 +++++++++++++++
 drivers/usb/musb/sunxi.c                      | 99 +++++++++++++------
 9 files changed, 301 insertions(+), 34 deletions(-)
 create mode 100644 arch/arm/boot/dts/suniv-f1c200s-lctech-pi.dts
 create mode 100644 arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts


base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
prerequisite-patch-id: 7734c0032dcc073e59f0217ee47ff023f0b47bcf
-- 
2.25.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v5 01/11] dt-bindings: usb: sunxi-musb: add F1C100s MUSB compatible string
  2023-01-11  1:53 [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
@ 2023-01-11  1:53 ` Andre Przywara
  2023-01-11  1:53 ` [PATCH v5 02/11] usb: musb: sunxi: add support for the F1C100s MUSB controller Andre Przywara
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andre Przywara @ 2023-01-11  1:53 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, Bin Liu
  Cc: Icenowy Zheng, Greg Kroah-Hartman, devicetree, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

From: Icenowy Zheng <uwu@icenowy.me>

Allwinner F1C100s has a hybrid MUSB controller between the A10 one and
the A33 one.

Add a compatible string for it.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 .../bindings/usb/allwinner,sun4i-a10-musb.yaml         | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/allwinner,sun4i-a10-musb.yaml b/Documentation/devicetree/bindings/usb/allwinner,sun4i-a10-musb.yaml
index 8992eff6ce387..f972ce976e860 100644
--- a/Documentation/devicetree/bindings/usb/allwinner,sun4i-a10-musb.yaml
+++ b/Documentation/devicetree/bindings/usb/allwinner,sun4i-a10-musb.yaml
@@ -13,10 +13,12 @@ maintainers:
 properties:
   compatible:
     oneOf:
-      - const: allwinner,sun4i-a10-musb
-      - const: allwinner,sun6i-a31-musb
-      - const: allwinner,sun8i-a33-musb
-      - const: allwinner,sun8i-h3-musb
+      - enum:
+          - allwinner,sun4i-a10-musb
+          - allwinner,sun6i-a31-musb
+          - allwinner,sun8i-a33-musb
+          - allwinner,sun8i-h3-musb
+          - allwinner,suniv-f1c100s-musb
       - items:
           - enum:
               - allwinner,sun8i-a83t-musb
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 02/11] usb: musb: sunxi: add support for the F1C100s MUSB controller
  2023-01-11  1:53 [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
  2023-01-11  1:53 ` [PATCH v5 01/11] dt-bindings: usb: sunxi-musb: add F1C100s MUSB compatible string Andre Przywara
@ 2023-01-11  1:53 ` Andre Przywara
  2023-01-31 22:52   ` Andre Przywara
  2023-01-11  1:53 ` [PATCH v5 03/11] usb: musb: sunxi: Introduce config struct Andre Przywara
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 16+ messages in thread
From: Andre Przywara @ 2023-01-11  1:53 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, Bin Liu
  Cc: Icenowy Zheng, Greg Kroah-Hartman, devicetree, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

From: Icenowy Zheng <uwu@icenowy.me>

The suniv SoC has a MUSB controller like the one in A33, but with a SRAM
region to be claimed.

Add support for it.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 drivers/usb/musb/sunxi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c
index 7f9a999cd5ff1..4b368d16a73ad 100644
--- a/drivers/usb/musb/sunxi.c
+++ b/drivers/usb/musb/sunxi.c
@@ -722,14 +722,17 @@ static int sunxi_musb_probe(struct platform_device *pdev)
 	INIT_WORK(&glue->work, sunxi_musb_work);
 	glue->host_nb.notifier_call = sunxi_musb_host_notifier;
 
-	if (of_device_is_compatible(np, "allwinner,sun4i-a10-musb"))
+	if (of_device_is_compatible(np, "allwinner,sun4i-a10-musb") ||
+	    of_device_is_compatible(np, "allwinner,suniv-f1c100s-musb")) {
 		set_bit(SUNXI_MUSB_FL_HAS_SRAM, &glue->flags);
+	}
 
 	if (of_device_is_compatible(np, "allwinner,sun6i-a31-musb"))
 		set_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags);
 
 	if (of_device_is_compatible(np, "allwinner,sun8i-a33-musb") ||
-	    of_device_is_compatible(np, "allwinner,sun8i-h3-musb")) {
+	    of_device_is_compatible(np, "allwinner,sun8i-h3-musb") ||
+	    of_device_is_compatible(np, "allwinner,suniv-f1c100s-musb")) {
 		set_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags);
 		set_bit(SUNXI_MUSB_FL_NO_CONFIGDATA, &glue->flags);
 	}
@@ -815,6 +818,7 @@ static const struct of_device_id sunxi_musb_match[] = {
 	{ .compatible = "allwinner,sun6i-a31-musb", },
 	{ .compatible = "allwinner,sun8i-a33-musb", },
 	{ .compatible = "allwinner,sun8i-h3-musb", },
+	{ .compatible = "allwinner,suniv-f1c100s-musb", },
 	{}
 };
 MODULE_DEVICE_TABLE(of, sunxi_musb_match);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 03/11] usb: musb: sunxi: Introduce config struct
  2023-01-11  1:53 [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
  2023-01-11  1:53 ` [PATCH v5 01/11] dt-bindings: usb: sunxi-musb: add F1C100s MUSB compatible string Andre Przywara
  2023-01-11  1:53 ` [PATCH v5 02/11] usb: musb: sunxi: add support for the F1C100s MUSB controller Andre Przywara
@ 2023-01-11  1:53 ` Andre Przywara
  2023-01-27 20:22   ` Jernej Škrabec
  2023-01-11  1:53 ` [PATCH v5 04/11] ARM: dts: suniv: add USB-related device nodes Andre Przywara
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 16+ messages in thread
From: Andre Przywara @ 2023-01-11  1:53 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, Bin Liu
  Cc: Icenowy Zheng, Greg Kroah-Hartman, devicetree, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

Currently the probe routine explicitly compares the compatible string of
the device node to figure out which features and quirks a certain
Allwinner MUSB model requires. This gets harder to maintain for new
SoCs.

Add a struct sunxi_musb_cfg that names the features and quirks
explicitly, and create instances of this struct for every type of MUSB
device we support. Then bind this to the compatible strings via the OF
data feature.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 drivers/usb/musb/sunxi.c | 103 ++++++++++++++++++++++++++-------------
 1 file changed, 70 insertions(+), 33 deletions(-)

diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c
index 4b368d16a73ad..9b622cd9b2bd5 100644
--- a/drivers/usb/musb/sunxi.c
+++ b/drivers/usb/musb/sunxi.c
@@ -15,6 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/phy/phy-sun4i-usb.h>
 #include <linux/platform_device.h>
 #include <linux/reset.h>
@@ -67,6 +68,13 @@
 #define SUNXI_MUSB_FL_NO_CONFIGDATA		7
 #define SUNXI_MUSB_FL_PHY_MODE_PEND		8
 
+struct sunxi_musb_cfg {
+	const struct musb_hdrc_config *hdrc_config;
+	bool has_sram;
+	bool has_reset;
+	bool no_configdata;
+};
+
 /* Our read/write methods need access and do not get passed in a musb ref :| */
 static struct musb *sunxi_musb;
 
@@ -621,11 +629,10 @@ static const struct musb_platform_ops sunxi_musb_ops = {
 	.post_root_reset_end = sunxi_musb_post_root_reset_end,
 };
 
-/* Allwinner OTG supports up to 5 endpoints */
-#define SUNXI_MUSB_MAX_EP_NUM	6
 #define SUNXI_MUSB_RAM_BITS	11
 
-static struct musb_fifo_cfg sunxi_musb_mode_cfg[] = {
+/* Allwinner OTG supports up to 5 endpoints */
+static struct musb_fifo_cfg sunxi_musb_mode_cfg_5eps[] = {
 	MUSB_EP_FIFO_SINGLE(1, FIFO_TX, 512),
 	MUSB_EP_FIFO_SINGLE(1, FIFO_RX, 512),
 	MUSB_EP_FIFO_SINGLE(2, FIFO_TX, 512),
@@ -639,9 +646,7 @@ static struct musb_fifo_cfg sunxi_musb_mode_cfg[] = {
 };
 
 /* H3/V3s OTG supports only 4 endpoints */
-#define SUNXI_MUSB_MAX_EP_NUM_H3	5
-
-static struct musb_fifo_cfg sunxi_musb_mode_cfg_h3[] = {
+static struct musb_fifo_cfg sunxi_musb_mode_cfg_4eps[] = {
 	MUSB_EP_FIFO_SINGLE(1, FIFO_TX, 512),
 	MUSB_EP_FIFO_SINGLE(1, FIFO_RX, 512),
 	MUSB_EP_FIFO_SINGLE(2, FIFO_TX, 512),
@@ -652,31 +657,33 @@ static struct musb_fifo_cfg sunxi_musb_mode_cfg_h3[] = {
 	MUSB_EP_FIFO_SINGLE(4, FIFO_RX, 512),
 };
 
-static const struct musb_hdrc_config sunxi_musb_hdrc_config = {
-	.fifo_cfg       = sunxi_musb_mode_cfg,
-	.fifo_cfg_size  = ARRAY_SIZE(sunxi_musb_mode_cfg),
+static const struct musb_hdrc_config sunxi_musb_hdrc_config_5eps = {
+	.fifo_cfg       = sunxi_musb_mode_cfg_5eps,
+	.fifo_cfg_size  = ARRAY_SIZE(sunxi_musb_mode_cfg_5eps),
 	.multipoint	= true,
 	.dyn_fifo	= true,
-	.num_eps	= SUNXI_MUSB_MAX_EP_NUM,
+	/* Two FIFOs per endpoint, plus ep_0. */
+	.num_eps	= (ARRAY_SIZE(sunxi_musb_mode_cfg_5eps) / 2) + 1,
 	.ram_bits	= SUNXI_MUSB_RAM_BITS,
 };
 
-static struct musb_hdrc_config sunxi_musb_hdrc_config_h3 = {
-	.fifo_cfg       = sunxi_musb_mode_cfg_h3,
-	.fifo_cfg_size  = ARRAY_SIZE(sunxi_musb_mode_cfg_h3),
+static const struct musb_hdrc_config sunxi_musb_hdrc_config_4eps = {
+	.fifo_cfg       = sunxi_musb_mode_cfg_4eps,
+	.fifo_cfg_size  = ARRAY_SIZE(sunxi_musb_mode_cfg_4eps),
 	.multipoint	= true,
 	.dyn_fifo	= true,
-	.num_eps	= SUNXI_MUSB_MAX_EP_NUM_H3,
+	/* Two FIFOs per endpoint, plus ep_0. */
+	.num_eps	= (ARRAY_SIZE(sunxi_musb_mode_cfg_4eps) / 2) + 1,
 	.ram_bits	= SUNXI_MUSB_RAM_BITS,
 };
 
-
 static int sunxi_musb_probe(struct platform_device *pdev)
 {
 	struct musb_hdrc_platform_data	pdata;
 	struct platform_device_info	pinfo;
 	struct sunxi_glue		*glue;
 	struct device_node		*np = pdev->dev.of_node;
+	const struct sunxi_musb_cfg	*cfg;
 	int ret;
 
 	if (!np) {
@@ -713,29 +720,25 @@ static int sunxi_musb_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 	pdata.platform_ops	= &sunxi_musb_ops;
-	if (!of_device_is_compatible(np, "allwinner,sun8i-h3-musb"))
-		pdata.config = &sunxi_musb_hdrc_config;
-	else
-		pdata.config = &sunxi_musb_hdrc_config_h3;
+
+	cfg = of_device_get_match_data(&pdev->dev);
+	if (!cfg)
+		return -EINVAL;
+
+	pdata.config = cfg->hdrc_config;
 
 	glue->dev = &pdev->dev;
 	INIT_WORK(&glue->work, sunxi_musb_work);
 	glue->host_nb.notifier_call = sunxi_musb_host_notifier;
 
-	if (of_device_is_compatible(np, "allwinner,sun4i-a10-musb") ||
-	    of_device_is_compatible(np, "allwinner,suniv-f1c100s-musb")) {
+	if (cfg->has_sram)
 		set_bit(SUNXI_MUSB_FL_HAS_SRAM, &glue->flags);
-	}
 
-	if (of_device_is_compatible(np, "allwinner,sun6i-a31-musb"))
+	if (cfg->has_reset)
 		set_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags);
 
-	if (of_device_is_compatible(np, "allwinner,sun8i-a33-musb") ||
-	    of_device_is_compatible(np, "allwinner,sun8i-h3-musb") ||
-	    of_device_is_compatible(np, "allwinner,suniv-f1c100s-musb")) {
-		set_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags);
+	if (cfg->no_configdata)
 		set_bit(SUNXI_MUSB_FL_NO_CONFIGDATA, &glue->flags);
-	}
 
 	glue->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(glue->clk)) {
@@ -813,12 +816,46 @@ static int sunxi_musb_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct sunxi_musb_cfg sun4i_a10_musb_cfg = {
+	.hdrc_config = &sunxi_musb_hdrc_config_5eps,
+	.has_sram = true,
+};
+
+static const struct sunxi_musb_cfg sun6i_a31_musb_cfg = {
+	.hdrc_config = &sunxi_musb_hdrc_config_5eps,
+	.has_reset = true,
+};
+
+static const struct sunxi_musb_cfg sun8i_a33_musb_cfg = {
+	.hdrc_config = &sunxi_musb_hdrc_config_5eps,
+	.has_reset = true,
+	.no_configdata = true,
+};
+
+static const struct sunxi_musb_cfg sun8i_h3_musb_cfg = {
+	.hdrc_config = &sunxi_musb_hdrc_config_4eps,
+	.has_reset = true,
+	.no_configdata = true,
+};
+
+static const struct sunxi_musb_cfg suniv_f1c100s_musb_cfg = {
+	.hdrc_config = &sunxi_musb_hdrc_config_5eps,
+	.has_sram = true,
+	.has_reset = true,
+	.no_configdata = true,
+};
+
 static const struct of_device_id sunxi_musb_match[] = {
-	{ .compatible = "allwinner,sun4i-a10-musb", },
-	{ .compatible = "allwinner,sun6i-a31-musb", },
-	{ .compatible = "allwinner,sun8i-a33-musb", },
-	{ .compatible = "allwinner,sun8i-h3-musb", },
-	{ .compatible = "allwinner,suniv-f1c100s-musb", },
+	{ .compatible = "allwinner,sun4i-a10-musb",
+	  .data = &sun4i_a10_musb_cfg, },
+	{ .compatible = "allwinner,sun6i-a31-musb",
+	  .data = &sun6i_a31_musb_cfg, },
+	{ .compatible = "allwinner,sun8i-a33-musb",
+	  .data = &sun8i_a33_musb_cfg, },
+	{ .compatible = "allwinner,sun8i-h3-musb",
+	  .data = &sun8i_h3_musb_cfg, },
+	{ .compatible = "allwinner,suniv-f1c100s-musb",
+	  .data = &suniv_f1c100s_musb_cfg, },
 	{}
 };
 MODULE_DEVICE_TABLE(of, sunxi_musb_match);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 04/11] ARM: dts: suniv: add USB-related device nodes
  2023-01-11  1:53 [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
                   ` (2 preceding siblings ...)
  2023-01-11  1:53 ` [PATCH v5 03/11] usb: musb: sunxi: Introduce config struct Andre Przywara
@ 2023-01-11  1:53 ` Andre Przywara
  2023-01-11  1:53 ` [PATCH v5 05/11] ARM: dts: suniv: licheepi-nano: enable USB Andre Przywara
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andre Przywara @ 2023-01-11  1:53 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, Bin Liu
  Cc: Icenowy Zheng, Greg Kroah-Hartman, devicetree, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

From: Icenowy Zheng <uwu@icenowy.me>

The suniv SoC has a USB OTG controller and a USB PHY like other
Allwinner SoCs.

Add their device tree node.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/arm/boot/dts/suniv-f1c100s.dtsi | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/arch/arm/boot/dts/suniv-f1c100s.dtsi b/arch/arm/boot/dts/suniv-f1c100s.dtsi
index 9455d27e516ee..111f8bbc2a805 100644
--- a/arch/arm/boot/dts/suniv-f1c100s.dtsi
+++ b/arch/arm/boot/dts/suniv-f1c100s.dtsi
@@ -133,6 +133,32 @@ mmc1: mmc@1c10000 {
 			#size-cells = <0>;
 		};
 
+		usb_otg: usb@1c13000 {
+			compatible = "allwinner,suniv-f1c100s-musb";
+			reg = <0x01c13000 0x0400>;
+			clocks = <&ccu CLK_BUS_OTG>;
+			resets = <&ccu RST_BUS_OTG>;
+			interrupts = <26>;
+			interrupt-names = "mc";
+			phys = <&usbphy 0>;
+			phy-names = "usb";
+			extcon = <&usbphy 0>;
+			allwinner,sram = <&otg_sram 1>;
+			status = "disabled";
+		};
+
+		usbphy: phy@1c13400 {
+			compatible = "allwinner,suniv-f1c100s-usb-phy";
+			reg = <0x01c13400 0x10>;
+			reg-names = "phy_ctrl";
+			clocks = <&ccu CLK_USB_PHY0>;
+			clock-names = "usb0_phy";
+			resets = <&ccu RST_USB_PHY0>;
+			reset-names = "usb0_reset";
+			#phy-cells = <1>;
+			status = "disabled";
+		};
+
 		ccu: clock@1c20000 {
 			compatible = "allwinner,suniv-f1c100s-ccu";
 			reg = <0x01c20000 0x400>;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 05/11] ARM: dts: suniv: licheepi-nano: enable USB
  2023-01-11  1:53 [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
                   ` (3 preceding siblings ...)
  2023-01-11  1:53 ` [PATCH v5 04/11] ARM: dts: suniv: add USB-related device nodes Andre Przywara
@ 2023-01-11  1:53 ` Andre Przywara
  2023-01-11  1:53 ` [PATCH v5 06/11] dt-bindings: vendor-prefixes: add Source Parts Andre Przywara
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andre Przywara @ 2023-01-11  1:53 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, Bin Liu
  Cc: Icenowy Zheng, Greg Kroah-Hartman, devicetree, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

From: Icenowy Zheng <uwu@icenowy.me>

Lichee Pi Nano has a Micro-USB connector, with its D+, D- pins connected
to the USB pins of the SoC and ID pin connected to PE2 GPIO.

Enable the USB functionality.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 .../arm/boot/dts/suniv-f1c100s-licheepi-nano.dts | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dts b/arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dts
index 04e59b8381cb8..43896723a994c 100644
--- a/arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dts
+++ b/arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dts
@@ -6,6 +6,8 @@
 /dts-v1/;
 #include "suniv-f1c100s.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Lichee Pi Nano";
 	compatible = "licheepi,licheepi-nano", "allwinner,suniv-f1c100s";
@@ -50,8 +52,22 @@ flash@0 {
 	};
 };
 
+&otg_sram {
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pe_pins>;
 	status = "okay";
 };
+
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usbphy {
+	usb0_id_det-gpios = <&pio 4 2 GPIO_ACTIVE_HIGH>; /* PE2 */
+	status = "okay";
+};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 06/11] dt-bindings: vendor-prefixes: add Source Parts
  2023-01-11  1:53 [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
                   ` (4 preceding siblings ...)
  2023-01-11  1:53 ` [PATCH v5 05/11] ARM: dts: suniv: licheepi-nano: enable USB Andre Przywara
@ 2023-01-11  1:53 ` Andre Przywara
  2023-01-11  1:53 ` [PATCH v5 07/11] dt-binding: arm: sunxi: add compatible strings for PopStick v1.1 Andre Przywara
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andre Przywara @ 2023-01-11  1:53 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, Bin Liu
  Cc: Icenowy Zheng, Greg Kroah-Hartman, devicetree, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

From: Icenowy Zheng <uwu@icenowy.me>

Source Parts Inc. [1] is a company that makes a series of SBCs, SoMs,
etc under a brand called Popcorn Computer [2].

Add it to the vendor prefixes list.

[1] https://source.parts/
[2] https://popcorncomputer.com/

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 70ffb3780621b..36a5c230b0197 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -1223,6 +1223,8 @@ patternProperties:
     description: Solomon Systech Limited
   "^sony,.*":
     description: Sony Corporation
+  "^sourceparts,.*":
+    description: Source Parts Inc.
   "^spansion,.*":
     description: Spansion Inc.
   "^sparkfun,.*":
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 07/11] dt-binding: arm: sunxi: add compatible strings for PopStick v1.1
  2023-01-11  1:53 [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
                   ` (5 preceding siblings ...)
  2023-01-11  1:53 ` [PATCH v5 06/11] dt-bindings: vendor-prefixes: add Source Parts Andre Przywara
@ 2023-01-11  1:53 ` Andre Przywara
  2023-01-11  1:53 ` [PATCH v5 08/11] ARM: dts: suniv: add device tree " Andre Przywara
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andre Przywara @ 2023-01-11  1:53 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, Bin Liu
  Cc: Icenowy Zheng, Greg Kroah-Hartman, devicetree, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

From: Icenowy Zheng <uwu@icenowy.me>

SourceParts PopStick is a F1C200s-based stick-shaped SBC.

Add a compatible string list for its v1.1 version (the first public
one).

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 Documentation/devicetree/bindings/arm/sunxi.yaml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml
index 3ad1cd50e3fe0..c6e0ad7f461dd 100644
--- a/Documentation/devicetree/bindings/arm/sunxi.yaml
+++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
@@ -807,6 +807,13 @@ properties:
           - const: sinlinx,sina33
           - const: allwinner,sun8i-a33
 
+      - description: SourceParts PopStick v1.1
+        items:
+          - const: sourceparts,popstick-v1.1
+          - const: sourceparts,popstick
+          - const: allwinner,suniv-f1c200s
+          - const: allwinner,suniv-f1c100s
+
       - description: SL631 Action Camera with IMX179
         items:
           - const: allwinner,sl631-imx179
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 08/11] ARM: dts: suniv: add device tree for PopStick v1.1
  2023-01-11  1:53 [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
                   ` (6 preceding siblings ...)
  2023-01-11  1:53 ` [PATCH v5 07/11] dt-binding: arm: sunxi: add compatible strings for PopStick v1.1 Andre Przywara
@ 2023-01-11  1:53 ` Andre Przywara
  2023-01-11  1:53 ` [PATCH v5 09/11] dt-bindings: vendor-prefixes: add Lctech name Andre Przywara
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andre Przywara @ 2023-01-11  1:53 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, Bin Liu
  Cc: Icenowy Zheng, Greg Kroah-Hartman, devicetree, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

From: Icenowy Zheng <uwu@icenowy.me>

PopStick is a minimal Allwinner F1C200s dongle, with its USB controller
wired to a USB Type-A plug, a SD slot and a SPI NAND flash on board, and
an on-board CH340 USB-UART converted connected to F1C200s's UART0.

Add a device tree for it. As F1C200s is just F1C100s with a different
DRAM chip co-packaged, directly use F1C100s DTSI here.

This commit covers the v1.1 version of this board, which is now shipped.
v1.0 is some internal sample that have not been shipped at all.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/arm/boot/dts/Makefile                    |  3 +-
 .../boot/dts/suniv-f1c200s-popstick-v1.1.dts  | 81 +++++++++++++++++++
 2 files changed, 83 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d08a3c450ce72..b100053182d35 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1399,7 +1399,8 @@ dtb-$(CONFIG_MACH_SUN9I) += \
 	sun9i-a80-optimus.dtb \
 	sun9i-a80-cubieboard4.dtb
 dtb-$(CONFIG_MACH_SUNIV) += \
-	suniv-f1c100s-licheepi-nano.dtb
+	suniv-f1c100s-licheepi-nano.dtb \
+	suniv-f1c200s-popstick-v1.1.dtb
 dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += \
 	tegra20-acer-a500-picasso.dtb \
 	tegra20-asus-tf101.dtb \
diff --git a/arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts b/arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts
new file mode 100644
index 0000000000000..184c245041a6e
--- /dev/null
+++ b/arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Icenowy Zheng <uwu@icenowy.me>
+ */
+
+/dts-v1/;
+#include "suniv-f1c100s.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "Popcorn Computer PopStick v1.1";
+	compatible = "sourceparts,popstick-v1.1", "sourceparts,popstick",
+		     "allwinner,suniv-f1c200s", "allwinner,suniv-f1c100s";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&pio 4 6 GPIO_ACTIVE_HIGH>; /* PE6 */
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
+	reg_vcc3v3: regulator-3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+};
+
+&mmc0 {
+	cd-gpios = <&pio 4 3 GPIO_ACTIVE_LOW>; /* PE3 */
+	bus-width = <4>;
+	disable-wp;
+	vmmc-supply = <&reg_vcc3v3>;
+	status = "okay";
+};
+
+&otg_sram {
+	status = "okay";
+};
+
+&spi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_pc_pins>;
+	status = "okay";
+
+	flash@0 {
+		compatible = "spi-nand";
+		reg = <0>;
+		spi-max-frequency = <40000000>;
+	};
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pe_pins>;
+	status = "okay";
+};
+
+&usb_otg {
+	dr_mode = "peripheral";
+	status = "okay";
+};
+
+&usbphy {
+	status = "okay";
+};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 09/11] dt-bindings: vendor-prefixes: add Lctech name
  2023-01-11  1:53 [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
                   ` (7 preceding siblings ...)
  2023-01-11  1:53 ` [PATCH v5 08/11] ARM: dts: suniv: add device tree " Andre Przywara
@ 2023-01-11  1:53 ` Andre Przywara
  2023-01-11  1:53 ` [PATCH v5 10/11] dt-bindings: arm: sunxi: add compatible strings for Lctech Pi Andre Przywara
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andre Przywara @ 2023-01-11  1:53 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, Bin Liu
  Cc: Icenowy Zheng, Greg Kroah-Hartman, devicetree, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

Shenzen LC Technology [1] is a company making various boards and related
products around IoT and AI technology.
They used to use the "Cherry Pi" brand before.

Add it to the vendor prefixes list.

[1] http://www.chinalctech.com

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 36a5c230b0197..f84f9c90a27d5 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -709,6 +709,8 @@ patternProperties:
     description: Lantiq Semiconductor
   "^lattice,.*":
     description: Lattice Semiconductor
+  "^lctech,.*":
+    description: Shenzen LC Technology Co., Ltd.
   "^leadtek,.*":
     description: Shenzhen Leadtek Technology Co., Ltd.
   "^leez,.*":
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 10/11] dt-bindings: arm: sunxi: add compatible strings for Lctech Pi
  2023-01-11  1:53 [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
                   ` (8 preceding siblings ...)
  2023-01-11  1:53 ` [PATCH v5 09/11] dt-bindings: vendor-prefixes: add Lctech name Andre Przywara
@ 2023-01-11  1:53 ` Andre Przywara
  2023-01-11  1:53 ` [PATCH v5 11/11] ARM: dts: suniv: Add Lctech Pi F1C200s devicetree Andre Przywara
  2023-01-18 12:11 ` [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
  11 siblings, 0 replies; 16+ messages in thread
From: Andre Przywara @ 2023-01-11  1:53 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, Bin Liu
  Cc: Icenowy Zheng, Greg Kroah-Hartman, devicetree, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

The Lctech Pi F1C200s is a small development board using the Allwinner
F1C200s SoC.

Add the compatible string list to the bindings documentation.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/arm/sunxi.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml
index c6e0ad7f461dd..cbdfc1c247a2b 100644
--- a/Documentation/devicetree/bindings/arm/sunxi.yaml
+++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
@@ -366,6 +366,12 @@ properties:
           - const: lamobo,lamobo-r1
           - const: allwinner,sun7i-a20
 
+      - description: Lctech Pi F1C200s
+        items:
+          - const: lctech,pi-f1c200s
+          - const: allwinner,suniv-f1c200s
+          - const: allwinner,suniv-f1c100s
+
       - description: Libre Computer Board ALL-H3-CC H2+
         items:
           - const: libretech,all-h3-cc-h2-plus
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 11/11] ARM: dts: suniv: Add Lctech Pi F1C200s devicetree
  2023-01-11  1:53 [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
                   ` (9 preceding siblings ...)
  2023-01-11  1:53 ` [PATCH v5 10/11] dt-bindings: arm: sunxi: add compatible strings for Lctech Pi Andre Przywara
@ 2023-01-11  1:53 ` Andre Przywara
  2023-01-18 12:11 ` [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
  11 siblings, 0 replies; 16+ messages in thread
From: Andre Przywara @ 2023-01-11  1:53 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, Bin Liu
  Cc: Icenowy Zheng, Greg Kroah-Hartman, devicetree, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

The Lctech Pi F1C200s (also previously known under the Cherry Pi brand)
is a small development board with the Allwinner F1C200s SoC. This is the
same as the F1C100s, but with 64MB instead of 32MB co-packaged DRAM.

Alongside the obligatory micro-SD card slot, the board features a
SPI-NAND flash chip, LCD and touch connectors, and unpopulated
expansion header pins.
There are two USB Type-C ports on the board: One supplies the power, also
connects to the USB MUSB OTG controller port. The other one is connected
to an CH340 USB serial chip, which in turn is connected to UART1.

Add a devicetree file, so that the board can be used easily.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
 arch/arm/boot/dts/Makefile                    |  1 +
 arch/arm/boot/dts/suniv-f1c100s.dtsi          |  6 ++
 arch/arm/boot/dts/suniv-f1c200s-lctech-pi.dts | 76 +++++++++++++++++++
 3 files changed, 83 insertions(+)
 create mode 100644 arch/arm/boot/dts/suniv-f1c200s-lctech-pi.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index b100053182d35..5973ecf699707 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1400,6 +1400,7 @@ dtb-$(CONFIG_MACH_SUN9I) += \
 	sun9i-a80-cubieboard4.dtb
 dtb-$(CONFIG_MACH_SUNIV) += \
 	suniv-f1c100s-licheepi-nano.dtb \
+	suniv-f1c200s-lctech-pi.dtb \
 	suniv-f1c200s-popstick-v1.1.dtb
 dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += \
 	tegra20-acer-a500-picasso.dtb \
diff --git a/arch/arm/boot/dts/suniv-f1c100s.dtsi b/arch/arm/boot/dts/suniv-f1c100s.dtsi
index 111f8bbc2a805..3c61d59ab5f86 100644
--- a/arch/arm/boot/dts/suniv-f1c100s.dtsi
+++ b/arch/arm/boot/dts/suniv-f1c100s.dtsi
@@ -207,6 +207,12 @@ uart0_pe_pins: uart0-pe-pins {
 				pins = "PE0", "PE1";
 				function = "uart0";
 			};
+
+			/omit-if-no-ref/
+			uart1_pa_pins: uart1-pa-pins {
+				pins = "PA2", "PA3";
+				function = "uart1";
+			};
 		};
 
 		i2c0: i2c@1c27000 {
diff --git a/arch/arm/boot/dts/suniv-f1c200s-lctech-pi.dts b/arch/arm/boot/dts/suniv-f1c200s-lctech-pi.dts
new file mode 100644
index 0000000000000..2d2a3f026df33
--- /dev/null
+++ b/arch/arm/boot/dts/suniv-f1c200s-lctech-pi.dts
@@ -0,0 +1,76 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Arm Ltd,
+ * based on work:
+ *   Copyright 2022 Icenowy Zheng <uwu@icenowy.me>
+ */
+
+/dts-v1/;
+#include "suniv-f1c100s.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	model = "Lctech Pi F1C200s";
+	compatible = "lctech,pi-f1c200s", "allwinner,suniv-f1c200s",
+		     "allwinner,suniv-f1c100s";
+
+	aliases {
+		serial0 = &uart1;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	reg_vcc3v3: regulator-3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+};
+
+&mmc0 {
+	broken-cd;
+	bus-width = <4>;
+	disable-wp;
+	vmmc-supply = <&reg_vcc3v3>;
+	status = "okay";
+};
+
+&otg_sram {
+	status = "okay";
+};
+
+&spi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_pc_pins>;
+	status = "okay";
+
+	flash@0 {
+		compatible = "spi-nand";
+		reg = <0>;
+		spi-max-frequency = <40000000>;
+	};
+};
+
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pa_pins>;
+	status = "okay";
+};
+
+/*
+ * This is a Type-C socket, but CC1/2 are not connected, and VBUS is connected
+ * to Vin, which supplies the board. Host mode works (if the board is powered
+ * otherwise), but peripheral is probably the intention.
+ */
+&usb_otg {
+	dr_mode = "peripheral";
+	status = "okay";
+};
+
+&usbphy {
+	status = "okay";
+};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 00/11] ARM: suniv: USB and two new boards support
  2023-01-11  1:53 [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
                   ` (10 preceding siblings ...)
  2023-01-11  1:53 ` [PATCH v5 11/11] ARM: dts: suniv: Add Lctech Pi F1C200s devicetree Andre Przywara
@ 2023-01-18 12:11 ` Andre Przywara
  11 siblings, 0 replies; 16+ messages in thread
From: Andre Przywara @ 2023-01-18 12:11 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, Bin Liu, devicetree
  Cc: Icenowy Zheng, Greg Kroah-Hartman, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

On Wed, 11 Jan 2023 01:53:21 +0000
Andre Przywara <andre.przywara@arm.com> wrote:

Hi,

> this is mostly a rebase of the former v4 series.
> It is based on top of v6.2-rc1, and builds cleanly there. For passing
> make dtbs_check, the PHY binding patch, part of a separate series[1], is
> needed. For USB functionality, patch 2/3 from there is needed as well.

This series has now been taken by Vinod and is available in linux-next
since at least Friday.

> I put a tree with both series combined here:
> https://github.com/apritzel/linux/commits/f1c100s-usb-v5
> 
> There were no changes to the actual patches, this is just a resend since
> the series missed the previous merge window.

Is there anything I can do to move this series forward? If I see this
correctly, this just misses a review of patch v5 03/11 "usb: musb: sunxi:
Introduce config struct". I addressed Jernej's comments on this already in v4.

Cheers,
Andre

> [1] https://lore.kernel.org/linux-phy/20230109012223.4079299-1-andre.przywara@arm.com/
> 
> ================
> This patchset introduces support for F1C100s' USB, and the SourceParts
> PopStick and Lctech Pi boards.
> 
> The DT binding and driver support for SUNIV USB MUSB device are added, in
> addition to DT changes to the DTSI and Lichee Nano DT. New DTs are added
> for the SourceParts PopStick v1.1 and Lctech Pi boards.
> 
> Changelog v4 ... v5:
> - Rebase on top to v6.2-rc1
> 
> Changelog v3 ... v4:
> - Dropped the PHY patches, they go via a different tree and need a
>   different base
> - rebased on top of linux-sunxi/sunxi/for-next (provides H616 USB)
> - musb DT binding: use enum
> - musb cleanup: use musb_hdrc_config config pointer directly
> - musb cleanup: use const where possible
> - drop partitions from Popstick DTS file
> - clarify Popstick has a USB type-A *plug*
> - add tags
> 
> Changelog v2 ... v3:
> - remove redundant "Device Tree Bindings" suffix in DT binding doc title
> - add BSD license to binding doc file (as per checkpatch)
> - fix some commit message title prefixes
> - use proper plural spelling for usb0_id_det-gpios
> - popstick.dts: Reorder otg_sram node reference alphabetically
> - popstick.dts: Add regulator- prefix to 3.3V regulator node name
> - popstick.dts: Fix status, compatible and reg property order
> - popstick.dts: Drop unneeded mmc0 and spi0 aliases
> - add patch to clean up sunxi MUSB driver
> - add Acks and Reviewed-by's
> 
> Changelog v1 ... v2:
> - USB PHY binding: clarify the relation with other phy-sun4i-usb bindings
> - Add Popstick binding and .dts patches
> 
> 
> Andre Przywara (4):
>   usb: musb: sunxi: Introduce config struct
>   dt-bindings: vendor-prefixes: add Lctech name
>   dt-bindings: arm: sunxi: add compatible strings for Lctech Pi
>   ARM: dts: suniv: Add Lctech Pi F1C200s devicetree
> 
> Icenowy Zheng (7):
>   dt-bindings: usb: sunxi-musb: add F1C100s MUSB compatible string
>   usb: musb: sunxi: add support for the F1C100s MUSB controller
>   ARM: dts: suniv: add USB-related device nodes
>   ARM: dts: suniv: licheepi-nano: enable USB
>   dt-bindings: vendor-prefixes: add Source Parts
>   dt-binding: arm: sunxi: add compatible strings for PopStick v1.1
>   ARM: dts: suniv: add device tree for PopStick v1.1
> 
>  .../devicetree/bindings/arm/sunxi.yaml        | 13 +++
>  .../usb/allwinner,sun4i-a10-musb.yaml         | 10 +-
>  .../devicetree/bindings/vendor-prefixes.yaml  |  4 +
>  arch/arm/boot/dts/Makefile                    |  4 +-
>  .../boot/dts/suniv-f1c100s-licheepi-nano.dts  | 16 +++
>  arch/arm/boot/dts/suniv-f1c100s.dtsi          | 32 ++++++
>  arch/arm/boot/dts/suniv-f1c200s-lctech-pi.dts | 76 ++++++++++++++
>  .../boot/dts/suniv-f1c200s-popstick-v1.1.dts  | 81 +++++++++++++++
>  drivers/usb/musb/sunxi.c                      | 99 +++++++++++++------
>  9 files changed, 301 insertions(+), 34 deletions(-)
>  create mode 100644 arch/arm/boot/dts/suniv-f1c200s-lctech-pi.dts
>  create mode 100644 arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts
> 
> 
> base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
> prerequisite-patch-id: 7734c0032dcc073e59f0217ee47ff023f0b47bcf


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 03/11] usb: musb: sunxi: Introduce config struct
  2023-01-11  1:53 ` [PATCH v5 03/11] usb: musb: sunxi: Introduce config struct Andre Przywara
@ 2023-01-27 20:22   ` Jernej Škrabec
  0 siblings, 0 replies; 16+ messages in thread
From: Jernej Škrabec @ 2023-01-27 20:22 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Rob Herring, Krzysztof Kozlowski,
	Bin Liu, Andre Przywara
  Cc: Icenowy Zheng, Greg Kroah-Hartman, devicetree, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

Dne sreda, 11. januar 2023 ob 02:53:24 CET je Andre Przywara napisal(a):
> Currently the probe routine explicitly compares the compatible string of
> the device node to figure out which features and quirks a certain
> Allwinner MUSB model requires. This gets harder to maintain for new
> SoCs.
> 
> Add a struct sunxi_musb_cfg that names the features and quirks
> explicitly, and create instances of this struct for every type of MUSB
> device we support. Then bind this to the compatible strings via the OF
> data feature.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>

Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 02/11] usb: musb: sunxi: add support for the F1C100s MUSB controller
  2023-01-11  1:53 ` [PATCH v5 02/11] usb: musb: sunxi: add support for the F1C100s MUSB controller Andre Przywara
@ 2023-01-31 22:52   ` Andre Przywara
  2023-02-01  5:06     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 16+ messages in thread
From: Andre Przywara @ 2023-01-31 22:52 UTC (permalink / raw)
  To: Bin Liu, Greg Kroah-Hartman
  Cc: Chen-Yu Tsai, Samuel Holland, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, Icenowy Zheng, devicetree, soc, linux-usb,
	linux-arm-kernel, linux-sunxi

On Wed, 11 Jan 2023 01:53:23 +0000
Andre Przywara <andre.przywara@arm.com> wrote:

Hi Bin, Greg,

> From: Icenowy Zheng <uwu@icenowy.me>
> 
> The suniv SoC has a MUSB controller like the one in A33, but with a SRAM
> region to be claimed.
> 
> Add support for it.

is there any chance you could take this patch (and the next one,
ideally) through your tree? And not sure if the binding patch (01/11)
should also go this way?
Patch 03/11 is a cleanup, so is somewhat optional, but Jernej acked
that recently.

The original series [1] is now almost three years old, and the whole
series was mostly ready in the previous cycle already, but got stuck
in some dependency chain, which should now be solved, since the PHY
patch series [2] made it into -next more than two weeks ago.

This would help to unblock the rest of this series, which are DT
patches only.

Many thanks, and let me know if there is something left for me to do.

Cheers,
Andre

[1]
https://patchwork.kernel.org/project/linux-usb/cover/20200309204326.27403-1-thirtythreeforty@gmail.com/
[2] https://lore.kernel.org/linux-arm-kernel/Y8BFwPZ0DRGImo5O@matsya/

> 
> Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  drivers/usb/musb/sunxi.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c
> index 7f9a999cd5ff1..4b368d16a73ad 100644
> --- a/drivers/usb/musb/sunxi.c
> +++ b/drivers/usb/musb/sunxi.c
> @@ -722,14 +722,17 @@ static int sunxi_musb_probe(struct platform_device *pdev)
>  	INIT_WORK(&glue->work, sunxi_musb_work);
>  	glue->host_nb.notifier_call = sunxi_musb_host_notifier;
>  
> -	if (of_device_is_compatible(np, "allwinner,sun4i-a10-musb"))
> +	if (of_device_is_compatible(np, "allwinner,sun4i-a10-musb") ||
> +	    of_device_is_compatible(np, "allwinner,suniv-f1c100s-musb")) {
>  		set_bit(SUNXI_MUSB_FL_HAS_SRAM, &glue->flags);
> +	}
>  
>  	if (of_device_is_compatible(np, "allwinner,sun6i-a31-musb"))
>  		set_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags);
>  
>  	if (of_device_is_compatible(np, "allwinner,sun8i-a33-musb") ||
> -	    of_device_is_compatible(np, "allwinner,sun8i-h3-musb")) {
> +	    of_device_is_compatible(np, "allwinner,sun8i-h3-musb") ||
> +	    of_device_is_compatible(np, "allwinner,suniv-f1c100s-musb")) {
>  		set_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags);
>  		set_bit(SUNXI_MUSB_FL_NO_CONFIGDATA, &glue->flags);
>  	}
> @@ -815,6 +818,7 @@ static const struct of_device_id sunxi_musb_match[] = {
>  	{ .compatible = "allwinner,sun6i-a31-musb", },
>  	{ .compatible = "allwinner,sun8i-a33-musb", },
>  	{ .compatible = "allwinner,sun8i-h3-musb", },
> +	{ .compatible = "allwinner,suniv-f1c100s-musb", },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(of, sunxi_musb_match);


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 02/11] usb: musb: sunxi: add support for the F1C100s MUSB controller
  2023-01-31 22:52   ` Andre Przywara
@ 2023-02-01  5:06     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 16+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-01  5:06 UTC (permalink / raw)
  To: Andre Przywara
  Cc: Bin Liu, Chen-Yu Tsai, Samuel Holland, Jernej Skrabec,
	Rob Herring, Krzysztof Kozlowski, Icenowy Zheng, devicetree, soc,
	linux-usb, linux-arm-kernel, linux-sunxi

On Tue, Jan 31, 2023 at 10:52:53PM +0000, Andre Przywara wrote:
> On Wed, 11 Jan 2023 01:53:23 +0000
> Andre Przywara <andre.przywara@arm.com> wrote:
> 
> Hi Bin, Greg,
> 
> > From: Icenowy Zheng <uwu@icenowy.me>
> > 
> > The suniv SoC has a MUSB controller like the one in A33, but with a SRAM
> > region to be claimed.
> > 
> > Add support for it.
> 
> is there any chance you could take this patch (and the next one,
> ideally) through your tree? And not sure if the binding patch (01/11)
> should also go this way?

Please resend just the patches you want me to apply, picking them out of
an old series is very difficult to do.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-02-01  5:06 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-11  1:53 [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara
2023-01-11  1:53 ` [PATCH v5 01/11] dt-bindings: usb: sunxi-musb: add F1C100s MUSB compatible string Andre Przywara
2023-01-11  1:53 ` [PATCH v5 02/11] usb: musb: sunxi: add support for the F1C100s MUSB controller Andre Przywara
2023-01-31 22:52   ` Andre Przywara
2023-02-01  5:06     ` Greg Kroah-Hartman
2023-01-11  1:53 ` [PATCH v5 03/11] usb: musb: sunxi: Introduce config struct Andre Przywara
2023-01-27 20:22   ` Jernej Škrabec
2023-01-11  1:53 ` [PATCH v5 04/11] ARM: dts: suniv: add USB-related device nodes Andre Przywara
2023-01-11  1:53 ` [PATCH v5 05/11] ARM: dts: suniv: licheepi-nano: enable USB Andre Przywara
2023-01-11  1:53 ` [PATCH v5 06/11] dt-bindings: vendor-prefixes: add Source Parts Andre Przywara
2023-01-11  1:53 ` [PATCH v5 07/11] dt-binding: arm: sunxi: add compatible strings for PopStick v1.1 Andre Przywara
2023-01-11  1:53 ` [PATCH v5 08/11] ARM: dts: suniv: add device tree " Andre Przywara
2023-01-11  1:53 ` [PATCH v5 09/11] dt-bindings: vendor-prefixes: add Lctech name Andre Przywara
2023-01-11  1:53 ` [PATCH v5 10/11] dt-bindings: arm: sunxi: add compatible strings for Lctech Pi Andre Przywara
2023-01-11  1:53 ` [PATCH v5 11/11] ARM: dts: suniv: Add Lctech Pi F1C200s devicetree Andre Przywara
2023-01-18 12:11 ` [PATCH v5 00/11] ARM: suniv: USB and two new boards support Andre Przywara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).