usb: gadget: add usb device mass storage and functinfs support
authorminda.chen <minda.chen@starfivetech.com>
Fri, 29 Jul 2022 05:29:18 +0000 (13:29 +0800)
committerminda.chen <minda.chen@starfivetech.com>
Mon, 1 Aug 2022 02:06:41 +0000 (10:06 +0800)
USB mass storage and functionfs activated by configfs.
Support both 2.0 and 3.0.

Signed-off-by: minda.chen <minda.chen@starfivetech.com>
arch/riscv/boot/dts/starfive/jh7110.dtsi
arch/riscv/configs/starfive_jh7110_defconfig
drivers/usb/cdns3/cdns3-starfive.c

index b390954..556768d 100755 (executable)
                                      <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";
index 383a66c..b83b7c5 100644 (file)
@@ -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
index a770665..7d0545a 100644 (file)
@@ -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;