lantiq: update USB controller initialization
[openwrt/staging/lynxis/omap.git] / target / linux / lantiq / patches-4.4 / 0061-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch
1 From de2cad82c4d0872066f83ce59462603852b47f03 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Fri, 6 Jan 2017 17:55:24 +0100
4 Subject: [PATCH 2/2] usb: dwc2: add support for other Lantiq SoCs
5
6 The size of the internal RAM of the DesignWare USB controller changed
7 between the different Lantiq SoCs. We have the following sizes:
8
9 Amazon + Danube: 8 KByte
10 Amazon SE + arx100: 2 KByte
11 xrx200 + xrx300: 2.5 KByte
12
13 For Danube SoC we do not provide the params and let the driver decide
14 to use sane defaults, for the Amazon SE and arx100 we use small fifos
15 and for the xrx200 and xrx300 SCs a little bit bigger periodic fifo.
16 The auto detection of max_transfer_size and max_packet_count should
17 work, so remove it.
18
19 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
20 ---
21 drivers/usb/dwc2/platform.c | 46 ++++++++++++++++++++++++++++++++++++++-------
22 1 file changed, 39 insertions(+), 7 deletions(-)
23
24 --- a/drivers/usb/dwc2/platform.c
25 +++ b/drivers/usb/dwc2/platform.c
26 @@ -116,7 +116,7 @@ static const struct dwc2_core_params par
27 .hibernation = -1,
28 };
29
30 -static const struct dwc2_core_params params_ltq = {
31 +static const struct dwc2_core_params params_ase = {
32 .otg_cap = 2, /* non-HNP/non-SRP */
33 .otg_ver = -1,
34 .dma_enable = -1,
35 @@ -127,8 +127,8 @@ static const struct dwc2_core_params par
36 .host_rx_fifo_size = 288, /* 288 DWORDs */
37 .host_nperio_tx_fifo_size = 128, /* 128 DWORDs */
38 .host_perio_tx_fifo_size = 96, /* 96 DWORDs */
39 - .max_transfer_size = 65535,
40 - .max_packet_count = 511,
41 + .max_transfer_size = -1,
42 + .max_packet_count = -1,
43 .host_channels = -1,
44 .phy_type = -1,
45 .phy_utmi_width = -1,
46 @@ -140,8 +140,37 @@ static const struct dwc2_core_params par
47 .host_ls_low_power_phy_clk = -1,
48 .ts_dline = -1,
49 .reload_ctl = -1,
50 - .ahbcfg = GAHBCFG_HBSTLEN_INCR16 <<
51 - GAHBCFG_HBSTLEN_SHIFT,
52 + .ahbcfg = -1,
53 + .uframe_sched = -1,
54 + .external_id_pin_ctl = -1,
55 + .hibernation = -1,
56 +};
57 +
58 +static const struct dwc2_core_params params_xrx200 = {
59 + .otg_cap = 2, /* non-HNP/non-SRP */
60 + .otg_ver = -1,
61 + .dma_enable = -1,
62 + .dma_desc_enable = -1,
63 + .speed = -1,
64 + .enable_dynamic_fifo = -1,
65 + .en_multiple_tx_fifo = -1,
66 + .host_rx_fifo_size = 288, /* 288 DWORDs */
67 + .host_nperio_tx_fifo_size = 128, /* 128 DWORDs */
68 + .host_perio_tx_fifo_size = 136, /* 136 DWORDs */
69 + .max_transfer_size = -1,
70 + .max_packet_count = -1,
71 + .host_channels = -1,
72 + .phy_type = -1,
73 + .phy_utmi_width = -1,
74 + .phy_ulpi_ddr = -1,
75 + .phy_ulpi_ext_vbus = -1,
76 + .i2c_enable = -1,
77 + .ulpi_fs_ls = -1,
78 + .host_support_fs_ls_low_power = -1,
79 + .host_ls_low_power_phy_clk = -1,
80 + .ts_dline = -1,
81 + .reload_ctl = -1,
82 + .ahbcfg = -1,
83 .uframe_sched = -1,
84 .external_id_pin_ctl = -1,
85 .hibernation = -1,
86 @@ -341,8 +370,11 @@ static int dwc2_driver_remove(struct pla
87 static const struct of_device_id dwc2_of_match_table[] = {
88 { .compatible = "brcm,bcm2835-usb", .data = &params_bcm2835 },
89 { .compatible = "rockchip,rk3066-usb", .data = &params_rk3066 },
90 - { .compatible = "lantiq,arx100-usb", .data = &params_ltq },
91 - { .compatible = "lantiq,xrx200-usb", .data = &params_ltq },
92 + { .compatible = "lantiq,danube-usb", .data = NULL },
93 + { .compatible = "lantiq,ase-usb", .data = &params_ase },
94 + { .compatible = "lantiq,arx100-usb", .data = &params_ase },
95 + { .compatible = "lantiq,xrx200-usb", .data = &params_xrx200 },
96 + { .compatible = "lantiq,xrx300-usb", .data = &params_xrx200 },
97 { .compatible = "snps,dwc2", .data = NULL },
98 { .compatible = "samsung,s3c6400-hsotg", .data = NULL},
99 {},