mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
usb: usb compile buildin. 1/1
PD#138714: usb compile buildin 1.usb compile buildin 2.otg port mode is host default. 3.Can force device mode by get env. otg_device=1 4.default add config gadget:mtp,ffs,rndis Change-Id: I613da307f904c58fba102d163e97dbaa253fb2a8 Signed-off-by: Qi Duan <qi.duan@amlogic.com>
This commit is contained in:
@@ -521,7 +521,7 @@
|
||||
port-id-mode = <0>; /** 0: hardware, 1: sw_host, 2: sw_slave*/
|
||||
usb-fifo = <728>;
|
||||
cpu-type = "gxl";
|
||||
controller-type = <2>; /** 0: normal, 1: host, 2: device*/
|
||||
controller-type = <1>; /** 0: normal, 1: host, 2: device*/
|
||||
phy-reg = <0xd0078000>;
|
||||
phy-reg-size = <0xa0>;
|
||||
clocks = <&clkc CLKID_USB_GENERAL
|
||||
|
||||
@@ -599,7 +599,7 @@
|
||||
port-id-mode = <0>; /** 0: hardware, 1: sw_host, 2: sw_slave*/
|
||||
usb-fifo = <728>;
|
||||
cpu-type = "gxl";
|
||||
controller-type = <2>; /** 0: normal, 1: host, 2: device*/
|
||||
controller-type = <1>; /** 0: normal, 1: host, 2: device*/
|
||||
phy-reg = <0xd0078000>;
|
||||
phy-reg-size = <0xa0>;
|
||||
clocks = <&clkc CLKID_USB_GENERAL
|
||||
|
||||
@@ -419,7 +419,7 @@
|
||||
port-id-mode = <0>; /** 0: hardware, 1: sw_host, 2: sw_slave*/
|
||||
usb-fifo = <728>;
|
||||
cpu-type = "gxl";
|
||||
controller-type = <2>; /** 0: normal, 1: host, 2: device*/
|
||||
controller-type = <1>; /** 0: normal, 1: host, 2: device*/
|
||||
phy-reg = <0xd0078000>;
|
||||
phy-reg-size = <0xa0>;
|
||||
clocks = <&clkc CLKID_USB_GENERAL
|
||||
|
||||
@@ -481,7 +481,7 @@
|
||||
port-id-mode = <0>; /** 0: hardware, 1: sw_host, 2: sw_slave*/
|
||||
usb-fifo = <728>;
|
||||
cpu-type = "gxl";
|
||||
controller-type = <2>; /** 0: normal, 1: host, 2: device*/
|
||||
controller-type = <1>; /** 0: normal, 1: host, 2: device*/
|
||||
phy-reg = <0xd0078000>;
|
||||
phy-reg-size = <0xa0>;
|
||||
clocks = <&clkc CLKID_USB_GENERAL
|
||||
|
||||
@@ -515,7 +515,7 @@
|
||||
port-id-mode = <0>; /** 0: hardware, 1: sw_host, 2: sw_slave*/
|
||||
usb-fifo = <728>;
|
||||
cpu-type = "gxl";
|
||||
controller-type = <2>; /** 0: normal, 1: host, 2: device*/
|
||||
controller-type = <1>; /** 0: normal, 1: host, 2: device*/
|
||||
phy-reg = <0xd0078000>;
|
||||
phy-reg-size = <0xa0>;
|
||||
clocks = <&clkc CLKID_USB_GENERAL
|
||||
|
||||
@@ -611,7 +611,7 @@
|
||||
port-id-mode = <0>; /** 0: hardware, 1: sw_host, 2: sw_slave*/
|
||||
usb-fifo = <728>;
|
||||
cpu-type = "gxl";
|
||||
controller-type = <2>; /** 0: normal, 1:host, 2:device*/
|
||||
controller-type = <1>; /** 0: normal, 1:host, 2:device*/
|
||||
phy-reg = <0xd0078000>;
|
||||
phy-reg-size = <0xa0>;
|
||||
clocks = <&clkc CLKID_USB_GENERAL
|
||||
|
||||
@@ -163,8 +163,9 @@ CONFIG_AMLOGIC_SERIAL_MESON_CONSOLE=y
|
||||
CONFIG_AMLOGIC_IOMAP=y
|
||||
CONFIG_AMLOGIC_PINCTRL=y
|
||||
CONFIG_AMLOGIC_USB=y
|
||||
CONFIG_AMLOGIC_USB_DWC_OTG_HCD=m
|
||||
CONFIG_AMLOGIC_USB_DWC_OTG_HCD=y
|
||||
CONFIG_AMLOGIC_USB_HOST_ELECT_TEST=y
|
||||
CONFIG_USB_CONFIGFS_UEVENT=y
|
||||
CONFIG_AMLOGIC_USBPHY=y
|
||||
CONFIG_AMLOGIC_USB2PHY=y
|
||||
CONFIG_AMLOGIC_USB3PHY=y
|
||||
@@ -344,7 +345,9 @@ CONFIG_USB_SERIAL=y
|
||||
CONFIG_USB_ISP1301=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_CONFIGFS=y
|
||||
CONFIG_USB_CONFIGFS_RNDIS=y
|
||||
CONFIG_USB_CONFIGFS_F_FS=y
|
||||
CONFIG_USB_CONFIGFS_F_MTP=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_BLOCK_MINORS=32
|
||||
CONFIG_MMC_ARMMMCI=y
|
||||
|
||||
@@ -238,8 +238,18 @@ bool force_device_mode;
|
||||
module_param_named(otg_device, force_device_mode,
|
||||
bool, S_IRUGO | S_IWUSR);
|
||||
|
||||
MODULE_PARM_DESC(otg_device, "set otg to force device mode" " ");
|
||||
|
||||
static char otg_mode_string[2] = "0";
|
||||
static int __init force_otg_mode(char *s)
|
||||
{
|
||||
if (s != NULL)
|
||||
sprintf(otg_mode_string, "%s", s);
|
||||
if (strcmp(otg_mode_string, "0") == 0)
|
||||
force_device_mode = 0;
|
||||
else
|
||||
force_device_mode = 1;
|
||||
return 0;
|
||||
}
|
||||
__setup("otg_device=", force_otg_mode);
|
||||
|
||||
static u64 dwc2_dmamask = DMA_BIT_MASK(32);
|
||||
|
||||
@@ -898,6 +908,8 @@ static void usb_early_resume(struct early_suspend *h)
|
||||
}
|
||||
#endif
|
||||
static const struct of_device_id dwc_otg_dt_match[] = {
|
||||
{ .compatible = "amlogic, dwc2",
|
||||
},
|
||||
{ .compatible = "amlogic,dwc2",
|
||||
},
|
||||
{},
|
||||
@@ -1438,6 +1450,9 @@ static const struct dev_pm_ops dwc2_dev_pm_ops = {
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
static const struct of_device_id of_dwc2_match[] = {
|
||||
{
|
||||
.compatible = "amlogic, dwc2"
|
||||
},
|
||||
{
|
||||
.compatible = "amlogic,dwc2"
|
||||
},
|
||||
@@ -1457,7 +1472,12 @@ static struct platform_driver dwc_otg_driver = {
|
||||
},
|
||||
};
|
||||
|
||||
module_platform_driver(dwc_otg_driver);
|
||||
|
||||
static int __init dwc_otg_init(void)
|
||||
{
|
||||
return platform_driver_register(&dwc_otg_driver);
|
||||
}
|
||||
late_initcall(dwc_otg_init);
|
||||
|
||||
MODULE_DESCRIPTION(DWC_DRIVER_DESC);
|
||||
MODULE_AUTHOR("Synopsys Inc.");
|
||||
|
||||
Reference in New Issue
Block a user