summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorminda.chen <minda.chen@starfivetech.com>2022-07-29 08:29:18 +0300
committerminda.chen <minda.chen@starfivetech.com>2022-08-01 05:06:41 +0300
commit2039c204733705acb39bf35e32f756d0c6fa67db (patch)
treebe23e5932c38fe3029de92ef2a7055576000016a
parentbfea6096b8cf9d28b468d5321b1fd730fa3cb726 (diff)
downloadlinux-2039c204733705acb39bf35e32f756d0c6fa67db.tar.xz
usb: gadget: add usb device mass storage and functinfs support
USB mass storage and functionfs activated by configfs. Support both 2.0 and 3.0. Signed-off-by: minda.chen <minda.chen@starfivetech.com>
-rwxr-xr-xarch/riscv/boot/dts/starfive/jh7110.dtsi2
-rw-r--r--arch/riscv/configs/starfive_jh7110_defconfig5
-rw-r--r--drivers/usb/cdns3/cdns3-starfive.c3
3 files changed, 9 insertions, 1 deletions
diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
index b39095413cb1..556768d254fc 100755
--- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
@@ -405,7 +405,7 @@
<0x0 0x10110000 0x0 0x10000>,
<0x0 0x10120000 0x0 0x10000>;
reg-names = "otg", "xhci", "dev";
- interrupts = <100>, <109>, <110>;
+ interrupts = <100>, <108>, <110>;
interrupt-names = "host", "peripheral", "otg";
phy-names = "cdns3,usb3-phy", "cnds3,usb2-phy";
maximum-speed = "super-speed";
diff --git a/arch/riscv/configs/starfive_jh7110_defconfig b/arch/riscv/configs/starfive_jh7110_defconfig
index 383a66ca92c4..b83b7c5e4e5e 100644
--- a/arch/riscv/configs/starfive_jh7110_defconfig
+++ b/arch/riscv/configs/starfive_jh7110_defconfig
@@ -218,8 +218,13 @@ CONFIG_USB_STORAGE=y
CONFIG_USB_UAS=y
CONFIG_USB_CDNS_SUPPORT=y
CONFIG_USB_CDNS3=y
+CONFIG_USB_CDNS3_GADGET=y
CONFIG_USB_CDNS3_HOST=y
CONFIG_USB_CDNS3_STARFIVE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_CONFIGFS=y
+CONFIG_USB_CONFIGFS_MASS_STORAGE=y
+CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_MMC=y
CONFIG_MMC_DEBUG=y
CONFIG_MMC_SDHCI=y
diff --git a/drivers/usb/cdns3/cdns3-starfive.c b/drivers/usb/cdns3/cdns3-starfive.c
index a77066504fe1..7d0545aafcd7 100644
--- a/drivers/usb/cdns3/cdns3-starfive.c
+++ b/drivers/usb/cdns3/cdns3-starfive.c
@@ -298,6 +298,9 @@ static int cdns_starfive_probe(struct platform_device *pdev)
goto exit;
}
+ dev_info(dev, "usb mode %d %s probe success\n",
+ data->mode, data->usb2_only ? "2.0" : "3.0");
+
return 0;
exit:
return ret;