5a5b17d0a087bd6f5f6ebc6702964d11c3318ae1
[openwrt/staging/hauke.git] / target / linux / cns3xxx / patches-4.19 / 210-dwc2_defaults.patch
1 --- a/drivers/usb/dwc2/params.c
2 +++ b/drivers/usb/dwc2/params.c
3 @@ -151,6 +151,36 @@ static void dwc2_set_stm32f7_hsotg_param
4 p->host_perio_tx_fifo_size = 256;
5 }
6
7 +static void dwc2_set_cns3xxx_params(struct dwc2_hsotg *hsotg)
8 +{
9 + struct dwc2_core_params *p = &hsotg->params;
10 +
11 + p->otg_cap = DWC2_CAP_PARAM_NO_HNP_SRP_CAPABLE; /* non-HNP/non-SRP capable */
12 + p->host_dma = 1;
13 + p->dma_desc_enable = 0;
14 + p->speed = DWC2_SPEED_PARAM_HIGH; /* High Speed */
15 + p->enable_dynamic_fifo = 1;
16 + p->en_multiple_tx_fifo = 1;
17 + p->host_rx_fifo_size = 658; /* 774 DWORDs */
18 + p->host_nperio_tx_fifo_size = 128; /* 256 DWORDs */
19 + p->host_perio_tx_fifo_size = 658; /* 512 DWORDs */
20 + p->max_transfer_size = 65535,
21 + p->max_packet_count = 511;
22 + p->host_channels = 16;
23 + p->phy_type = DWC2_PHY_TYPE_PARAM_UTMI; /* UTMI */
24 + p->phy_utmi_width = 16; /* 8 bits */
25 + p->phy_ulpi_ddr = 0; /* Single */
26 + p->phy_ulpi_ext_vbus = 0;
27 + p->i2c_enable = 0;
28 + p->ulpi_fs_ls = 0;
29 + p->host_support_fs_ls_low_power = 0;
30 + p->host_ls_low_power_phy_clk = 0; /* 48 MHz */
31 + p->ts_dline = 0;
32 + p->reload_ctl = 0;
33 + p->ahbcfg = 0x10;
34 + p->uframe_sched = false;
35 +}
36 +
37 const struct of_device_id dwc2_of_match_table[] = {
38 { .compatible = "brcm,bcm2835-usb", .data = dwc2_set_bcm_params },
39 { .compatible = "hisilicon,hi6220-usb", .data = dwc2_set_his_params },
40 @@ -806,17 +836,23 @@ int dwc2_get_hwparams(struct dwc2_hsotg
41
42 int dwc2_init_params(struct dwc2_hsotg *hsotg)
43 {
44 + /*
45 const struct of_device_id *match;
46 void (*set_params)(void *data);
47 + */
48
49 dwc2_set_default_params(hsotg);
50 dwc2_get_device_properties(hsotg);
51
52 + /*
53 match = of_match_device(dwc2_of_match_table, hsotg->dev);
54 if (match && match->data) {
55 set_params = match->data;
56 set_params(hsotg);
57 }
58 + */
59 +
60 + dwc2_set_cns3xxx_params(hsotg);
61
62 dwc2_check_params(hsotg);
63