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