Skip to content

Commit 5af4370

Browse files
haukegregkh
authored andcommitted
usb: dwc2: add support for other Lantiq SoCs
The size of the internal RAM of the DesignWare USB controller changed between the different Lantiq SoCs. We have the following sizes: Amazon + Danube: 8 KByte Amazon SE + arx100: 2 KByte xrx200 + xrx300: 2.5 KByte For Danube SoC we do not provide the params and let the driver decide to use sane defaults, for the Amazon SE and arx100 we use small fifos and for the xrx200 and xrx300 SCs a little bit bigger periodic fifo. The auto detection of max_transfer_size and max_packet_count should work, so remove it. This patch is included in OpenWrt for many years. Signed-off-by: Hauke Mehrtens <[email protected]> Acked-by: Minas Harutyunyan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2bb6b10 commit 5af4370

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

drivers/usb/dwc2/params.c

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,15 @@ static void dwc2_set_rk_params(struct dwc2_hsotg *hsotg)
133133
p->no_clock_gating = true;
134134
}
135135

136-
static void dwc2_set_ltq_params(struct dwc2_hsotg *hsotg)
136+
static void dwc2_set_ltq_danube_params(struct dwc2_hsotg *hsotg)
137+
{
138+
struct dwc2_core_params *p = &hsotg->params;
139+
140+
p->otg_caps.hnp_support = false;
141+
p->otg_caps.srp_support = false;
142+
}
143+
144+
static void dwc2_set_ltq_ase_params(struct dwc2_hsotg *hsotg)
137145
{
138146
struct dwc2_core_params *p = &hsotg->params;
139147

@@ -142,12 +150,21 @@ static void dwc2_set_ltq_params(struct dwc2_hsotg *hsotg)
142150
p->host_rx_fifo_size = 288;
143151
p->host_nperio_tx_fifo_size = 128;
144152
p->host_perio_tx_fifo_size = 96;
145-
p->max_transfer_size = 65535;
146-
p->max_packet_count = 511;
147153
p->ahbcfg = GAHBCFG_HBSTLEN_INCR16 <<
148154
GAHBCFG_HBSTLEN_SHIFT;
149155
}
150156

157+
static void dwc2_set_ltq_xrx200_params(struct dwc2_hsotg *hsotg)
158+
{
159+
struct dwc2_core_params *p = &hsotg->params;
160+
161+
p->otg_caps.hnp_support = false;
162+
p->otg_caps.srp_support = false;
163+
p->host_rx_fifo_size = 288;
164+
p->host_nperio_tx_fifo_size = 128;
165+
p->host_perio_tx_fifo_size = 136;
166+
}
167+
151168
static void dwc2_set_amlogic_params(struct dwc2_hsotg *hsotg)
152169
{
153170
struct dwc2_core_params *p = &hsotg->params;
@@ -297,8 +314,11 @@ const struct of_device_id dwc2_of_match_table[] = {
297314
{ .compatible = "ingenic,x1830-otg", .data = dwc2_set_x1600_params },
298315
{ .compatible = "ingenic,x2000-otg", .data = dwc2_set_x2000_params },
299316
{ .compatible = "rockchip,rk3066-usb", .data = dwc2_set_rk_params },
300-
{ .compatible = "lantiq,arx100-usb", .data = dwc2_set_ltq_params },
301-
{ .compatible = "lantiq,xrx200-usb", .data = dwc2_set_ltq_params },
317+
{ .compatible = "lantiq,danube-usb", .data = &dwc2_set_ltq_danube_params },
318+
{ .compatible = "lantiq,ase-usb", .data = &dwc2_set_ltq_ase_params },
319+
{ .compatible = "lantiq,arx100-usb", .data = &dwc2_set_ltq_ase_params },
320+
{ .compatible = "lantiq,xrx200-usb", .data = &dwc2_set_ltq_xrx200_params },
321+
{ .compatible = "lantiq,xrx300-usb", .data = &dwc2_set_ltq_xrx200_params },
302322
{ .compatible = "snps,dwc2" },
303323
{ .compatible = "samsung,s3c6400-hsotg",
304324
.data = dwc2_set_s3c6400_params },

0 commit comments

Comments
 (0)