cns3xxx: add preliminary 4.9 support
[openwrt/openwrt.git] / target / linux / cns3xxx / patches-4.9 / 210-dwc2_defaults.patch
1 --- a/drivers/usb/dwc2/platform.c
2 +++ b/drivers/usb/dwc2/platform.c
3 @@ -308,6 +308,34 @@ static int __dwc2_lowlevel_hw_enable(str
4 return ret;
5 }
6
7 +static const struct dwc2_core_params params_cns3xxx = {
8 + .otg_cap = 2, /* non-HNP/non-SRP capable */
9 + .otg_ver = 0, /* 1.3 */
10 + .dma_enable = 1,
11 + .dma_desc_enable = 0,
12 + .speed = 0, /* High Speed */
13 + .enable_dynamic_fifo = 1,
14 + .en_multiple_tx_fifo = 1,
15 + .host_rx_fifo_size = 658, /* 774 DWORDs */
16 + .host_nperio_tx_fifo_size = 128, /* 256 DWORDs */
17 + .host_perio_tx_fifo_size = 658, /* 512 DWORDs */
18 + .max_transfer_size = 65535,
19 + .max_packet_count = 511,
20 + .host_channels = 16,
21 + .phy_type = 1, /* UTMI */
22 + .phy_utmi_width = 16, /* 8 bits */
23 + .phy_ulpi_ddr = 0, /* Single */
24 + .phy_ulpi_ext_vbus = 0,
25 + .i2c_enable = 0,
26 + .ulpi_fs_ls = 0,
27 + .host_support_fs_ls_low_power = 0,
28 + .host_ls_low_power_phy_clk = 0, /* 48 MHz */
29 + .ts_dline = 0,
30 + .reload_ctl = 0,
31 + .ahbcfg = 0x10,
32 + .uframe_sched = 0,
33 +};
34 +
35 /**
36 * dwc2_lowlevel_hw_enable - enable platform lowlevel hw resources
37 * @hsotg: The driver state
38 @@ -552,6 +580,9 @@ static int dwc2_driver_probe(struct plat
39 /* Default all params to autodetect */
40 dwc2_set_all_params(&defparams, -1);
41 params = &defparams;
42 +#ifdef CONFIG_ARCH_CNS3XXX
43 + params = &params_cns3xxx;
44 +#endif
45
46 /*
47 * Disable descriptor dma mode by default as the HW can support