2020-03-31 17:04:44

by George Hilliard

[permalink] [raw]
Subject: [PATCH v2 0/5] Support the Allwinner F1C100s USB stack

The Allwinner F1C100s has an MUSB-based USB peripheral. This patch
series implements support for it alongside existing Allwinner support
code.

This series was originally written by Icenowy Zheng for Linux v4.14.
I've rebased and bugfixed that work against mainline and tested it on
both the Lichee Nano and my custom hardware. Where I've made functional
changes, I have changed the commit author to myself.

This is a follow-up to the previous series [1], a little late on my
self-imposed schedule but here nonetheless.

[1]: https://patchwork.kernel.org/cover/11428003/


George Hilliard (2):
dt-bindings: Add new F1C100s compatible strings for USB
musb: sunxi: add support for the suniv MUSB controller

Icenowy Zheng (3):
phy: sun4i-usb: add support for the USB PHY on suniv SoC
ARM: suniv: add USB-related device nodes
ARM: suniv: f1c100s: enable USB on Lichee Pi Nano

.../phy/allwinner,sun4i-a10-usb-phy.yaml | 1 +
.../usb/allwinner,sun4i-a10-musb.yaml | 1 +
.../boot/dts/suniv-f1c100s-licheepi-nano.dts | 16 ++++++++++
arch/arm/boot/dts/suniv-f1c100s.dtsi | 29 +++++++++++++++++++
drivers/phy/allwinner/phy-sun4i-usb.c | 10 +++++++
drivers/usb/musb/sunxi.c | 8 +++--
6 files changed, 63 insertions(+), 2 deletions(-)

--
2.26.0


2020-03-31 17:05:21

by George Hilliard

[permalink] [raw]
Subject: [PATCH v2 2/5] phy: sun4i-usb: add support for the USB PHY on suniv SoC

From: Icenowy Zheng <[email protected]>

The suniv SoC has one USB OTG port connected to a MUSB controller.

Add support for its USB PHY.

Signed-off-by: Icenowy Zheng <[email protected]>
George Hilliard: changed style to match existing code.
Signed-off-by: George Hilliard <[email protected]>
---
v1..v2: reordered sun{50,iv} to match `sort` order.

drivers/phy/allwinner/phy-sun4i-usb.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
index 856927382248..5c10b55f2aad 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -107,6 +107,7 @@ enum sun4i_usb_phy_type {
sun8i_v3s_phy,
sun50i_a64_phy,
sun50i_h6_phy,
+ suniv_f1c100s_phy,
};

struct sun4i_usb_phy_cfg {
@@ -972,6 +973,14 @@ static const struct sun4i_usb_phy_cfg sun50i_h6_cfg = {
.missing_phys = BIT(1) | BIT(2),
};

+static const struct sun4i_usb_phy_cfg suniv_f1c100s_cfg = {
+ .num_phys = 1,
+ .type = suniv_f1c100s_phy,
+ .disc_thresh = 3,
+ .phyctl_offset = REG_PHYCTL_A10,
+ .dedicated_clocks = true,
+};
+
static const struct of_device_id sun4i_usb_phy_of_match[] = {
{ .compatible = "allwinner,sun4i-a10-usb-phy", .data = &sun4i_a10_cfg },
{ .compatible = "allwinner,sun5i-a13-usb-phy", .data = &sun5i_a13_cfg },
@@ -986,6 +995,7 @@ static const struct of_device_id sun4i_usb_phy_of_match[] = {
{ .compatible = "allwinner,sun50i-a64-usb-phy",
.data = &sun50i_a64_cfg},
{ .compatible = "allwinner,sun50i-h6-usb-phy", .data = &sun50i_h6_cfg },
+ { .compatible = "allwinner,suniv-f1c100s-usb-phy", .data = &suniv_f1c100s_cfg },
{ },
};
MODULE_DEVICE_TABLE(of, sun4i_usb_phy_of_match);
--
2.26.0