0061-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. The size of the internal RAM of the DesignWare USB controller changed
  6. between the different Lantiq SoCs. We have the following sizes:
  7. Amazon + Danube: 8 KByte
  8. Amazon SE + arx100: 2 KByte
  9. xrx200 + xrx300: 2.5 KByte
  10. For Danube SoC we do not provide the params and let the driver decide
  11. to use sane defaults, for the Amazon SE and arx100 we use small fifos
  12. and for the xrx200 and xrx300 SCs a little bit bigger periodic fifo.
  13. The auto detection of max_transfer_size and max_packet_count should
  14. work, so remove it.
  15. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  16. ---
  17. drivers/usb/dwc2/platform.c | 46 ++++++++++++++++++++++++++++++++++++++-------
  18. 1 file changed, 39 insertions(+), 7 deletions(-)
  19. --- a/drivers/usb/dwc2/platform.c
  20. +++ b/drivers/usb/dwc2/platform.c
  21. @@ -116,7 +116,37 @@ static const struct dwc2_core_params par
  22. .hibernation = -1,
  23. };
  24. -static const struct dwc2_core_params params_ltq = {
  25. +static const struct dwc2_core_params params_danube = {
  26. + .otg_cap = 2, /* non-HNP/non-SRP */
  27. + .otg_ver = -1,
  28. + .dma_enable = -1,
  29. + .dma_desc_enable = -1,
  30. + .speed = -1,
  31. + .enable_dynamic_fifo = -1,
  32. + .en_multiple_tx_fifo = -1,
  33. + .host_rx_fifo_size = -1,
  34. + .host_nperio_tx_fifo_size = -1,
  35. + .host_perio_tx_fifo_size = -1,
  36. + .max_transfer_size = -1,
  37. + .max_packet_count = -1,
  38. + .host_channels = -1,
  39. + .phy_type = -1,
  40. + .phy_utmi_width = -1,
  41. + .phy_ulpi_ddr = -1,
  42. + .phy_ulpi_ext_vbus = -1,
  43. + .i2c_enable = -1,
  44. + .ulpi_fs_ls = -1,
  45. + .host_support_fs_ls_low_power = -1,
  46. + .host_ls_low_power_phy_clk = -1,
  47. + .ts_dline = -1,
  48. + .reload_ctl = -1,
  49. + .ahbcfg = -1,
  50. + .uframe_sched = -1,
  51. + .external_id_pin_ctl = -1,
  52. + .hibernation = -1,
  53. +};
  54. +
  55. +static const struct dwc2_core_params params_ase = {
  56. .otg_cap = 2, /* non-HNP/non-SRP */
  57. .otg_ver = -1,
  58. .dma_enable = -1,
  59. @@ -127,8 +157,38 @@ static const struct dwc2_core_params par
  60. .host_rx_fifo_size = 288, /* 288 DWORDs */
  61. .host_nperio_tx_fifo_size = 128, /* 128 DWORDs */
  62. .host_perio_tx_fifo_size = 96, /* 96 DWORDs */
  63. - .max_transfer_size = 65535,
  64. - .max_packet_count = 511,
  65. + .max_transfer_size = -1,
  66. + .max_packet_count = -1,
  67. + .host_channels = -1,
  68. + .phy_type = -1,
  69. + .phy_utmi_width = -1,
  70. + .phy_ulpi_ddr = -1,
  71. + .phy_ulpi_ext_vbus = -1,
  72. + .i2c_enable = -1,
  73. + .ulpi_fs_ls = -1,
  74. + .host_support_fs_ls_low_power = -1,
  75. + .host_ls_low_power_phy_clk = -1,
  76. + .ts_dline = -1,
  77. + .reload_ctl = -1,
  78. + .ahbcfg = -1,
  79. + .uframe_sched = -1,
  80. + .external_id_pin_ctl = -1,
  81. + .hibernation = -1,
  82. +};
  83. +
  84. +static const struct dwc2_core_params params_xrx200 = {
  85. + .otg_cap = 2, /* non-HNP/non-SRP */
  86. + .otg_ver = -1,
  87. + .dma_enable = -1,
  88. + .dma_desc_enable = -1,
  89. + .speed = -1,
  90. + .enable_dynamic_fifo = -1,
  91. + .en_multiple_tx_fifo = -1,
  92. + .host_rx_fifo_size = 288, /* 288 DWORDs */
  93. + .host_nperio_tx_fifo_size = 128, /* 128 DWORDs */
  94. + .host_perio_tx_fifo_size = 136, /* 136 DWORDs */
  95. + .max_transfer_size = -1,
  96. + .max_packet_count = -1,
  97. .host_channels = -1,
  98. .phy_type = -1,
  99. .phy_utmi_width = -1,
  100. @@ -140,8 +200,7 @@ static const struct dwc2_core_params par
  101. .host_ls_low_power_phy_clk = -1,
  102. .ts_dline = -1,
  103. .reload_ctl = -1,
  104. - .ahbcfg = GAHBCFG_HBSTLEN_INCR16 <<
  105. - GAHBCFG_HBSTLEN_SHIFT,
  106. + .ahbcfg = -1,
  107. .uframe_sched = -1,
  108. .external_id_pin_ctl = -1,
  109. .hibernation = -1,
  110. @@ -341,8 +400,11 @@ static int dwc2_driver_remove(struct pla
  111. static const struct of_device_id dwc2_of_match_table[] = {
  112. { .compatible = "brcm,bcm2835-usb", .data = &params_bcm2835 },
  113. { .compatible = "rockchip,rk3066-usb", .data = &params_rk3066 },
  114. - { .compatible = "lantiq,arx100-usb", .data = &params_ltq },
  115. - { .compatible = "lantiq,xrx200-usb", .data = &params_ltq },
  116. + { .compatible = "lantiq,danube-usb", .data = &params_danube },
  117. + { .compatible = "lantiq,ase-usb", .data = &params_ase },
  118. + { .compatible = "lantiq,arx100-usb", .data = &params_ase },
  119. + { .compatible = "lantiq,xrx200-usb", .data = &params_xrx200 },
  120. + { .compatible = "lantiq,xrx300-usb", .data = &params_xrx200 },
  121. { .compatible = "snps,dwc2", .data = NULL },
  122. { .compatible = "samsung,s3c6400-hsotg", .data = NULL},
  123. {},