linux-6.6.patch 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. diff -rupN old/linux-6.6/drivers/char/Kconfig linux-6.6/drivers/char/Kconfig
  2. --- old/linux-6.6/drivers/char/Kconfig
  3. +++ linux-6.6/drivers/char/Kconfig
  4. @@ -422,4 +422,12 @@ config ADI
  5. and SSM (Silicon Secured Memory). Intended consumers of this
  6. driver include crash and makedumpfile.
  7. +config DEVCMA
  8. + bool "/dev/cma virtual device support"
  9. + default y
  10. +
  11. +config XILINX_DEVCFG
  12. + tristate "Xilinx Device Configuration"
  13. + depends on ARCH_ZYNQ
  14. +
  15. endmenu
  16. diff -rupN old/linux-6.6/drivers/char/Makefile linux-6.6/drivers/char/Makefile
  17. --- old/linux-6.6/drivers/char/Makefile
  18. +++ linux-6.6/drivers/char/Makefile
  19. @@ -44,3 +44,5 @@ obj-$(CONFIG_PS3_FLASH) += ps3flash.o
  20. obj-$(CONFIG_XILLYBUS_CLASS) += xillybus/
  21. obj-$(CONFIG_POWERNV_OP_PANEL) += powernv-op-panel.o
  22. obj-$(CONFIG_ADI) += adi.o
  23. +obj-$(CONFIG_DEVCMA) += cma.o
  24. +obj-$(CONFIG_XILINX_DEVCFG) += xilinx_devcfg.o
  25. diff -rupN old/linux-6.6/drivers/net/phy/intel-xway.c linux-6.6/drivers/net/phy/intel-xway.c
  26. --- old/linux-6.6/drivers/net/phy/intel-xway.c
  27. +++ linux-6.6/drivers/net/phy/intel-xway.c
  28. @@ -252,6 +252,12 @@ static int xway_gphy_config_init(struct
  29. if (err)
  30. return err;
  31. + /* Set SGMII RX & TX timing skew to 2 ns & 2.5 ns respectively. */
  32. + /* Set MII power supply to 2V5. */
  33. + err = phy_write(phydev, 0x17, 0x4D00);
  34. + if (err)
  35. + return err;
  36. +
  37. phy_write_mmd(phydev, MDIO_MMD_VEND2, XWAY_MMD_LEDCH,
  38. XWAY_MMD_LEDCH_NACS_NONE |
  39. XWAY_MMD_LEDCH_SBF_F02HZ |
  40. @@ -261,20 +267,16 @@ static int xway_gphy_config_init(struct
  41. XWAY_MMD_LEDCH_SCAN_NONE);
  42. /**
  43. - * In most cases only one LED is connected to this phy, so
  44. - * configure them all to constant on and pulse mode. LED3 is
  45. - * only available in some packages, leave it in its reset
  46. - * configuration.
  47. + * Set LED0 blinking on RX/TX.
  48. + * Set LED1 blinking on link speed: slow=10M, fast=100M, on=1G.
  49. */
  50. - ledxh = XWAY_MMD_LEDxH_BLINKF_NONE | XWAY_MMD_LEDxH_CON_LINK10XX;
  51. - ledxl = XWAY_MMD_LEDxL_PULSE_TXACT | XWAY_MMD_LEDxL_PULSE_RXACT |
  52. - XWAY_MMD_LEDxL_BLINKS_NONE;
  53. - phy_write_mmd(phydev, MDIO_MMD_VEND2, XWAY_MMD_LED0H, ledxh);
  54. + ledxl = XWAY_MMD_LEDxL_PULSE_TXACT | XWAY_MMD_LEDxL_PULSE_RXACT;
  55. + phy_write_mmd(phydev, MDIO_MMD_VEND2, XWAY_MMD_LED0H, 0);
  56. phy_write_mmd(phydev, MDIO_MMD_VEND2, XWAY_MMD_LED0L, ledxl);
  57. + ledxh = XWAY_MMD_LEDxH_CON_LINK1000 | XWAY_MMD_LEDxH_BLINKF_LINK100;
  58. + ledxl = XWAY_MMD_LEDxH_CON_LINK10;
  59. phy_write_mmd(phydev, MDIO_MMD_VEND2, XWAY_MMD_LED1H, ledxh);
  60. phy_write_mmd(phydev, MDIO_MMD_VEND2, XWAY_MMD_LED1L, ledxl);
  61. - phy_write_mmd(phydev, MDIO_MMD_VEND2, XWAY_MMD_LED2H, ledxh);
  62. - phy_write_mmd(phydev, MDIO_MMD_VEND2, XWAY_MMD_LED2L, ledxl);
  63. err = xway_gphy_rgmii_init(phydev);
  64. if (err)
  65. diff -rupN old/linux-6.6/drivers/net/wireless/realtek/Kconfig linux-6.6/drivers/net/wireless/realtek/Kconfig
  66. --- old/linux-6.6/drivers/net/wireless/realtek/Kconfig
  67. +++ linux-6.6/drivers/net/wireless/realtek/Kconfig
  68. @@ -13,9 +13,9 @@ config WLAN_VENDOR_REALTEK
  69. if WLAN_VENDOR_REALTEK
  70. source "drivers/net/wireless/realtek/rtl818x/Kconfig"
  71. -source "drivers/net/wireless/realtek/rtlwifi/Kconfig"
  72. source "drivers/net/wireless/realtek/rtl8xxxu/Kconfig"
  73. source "drivers/net/wireless/realtek/rtw88/Kconfig"
  74. source "drivers/net/wireless/realtek/rtw89/Kconfig"
  75. +source "drivers/net/wireless/realtek/rtl8188eu/Kconfig"
  76. endif # WLAN_VENDOR_REALTEK
  77. diff -rupN old/linux-6.6/drivers/net/wireless/realtek/Makefile linux-6.6/drivers/net/wireless/realtek/Makefile
  78. --- old/linux-6.6/drivers/net/wireless/realtek/Makefile
  79. +++ linux-6.6/drivers/net/wireless/realtek/Makefile
  80. @@ -5,8 +5,8 @@
  81. obj-$(CONFIG_RTL8180) += rtl818x/
  82. obj-$(CONFIG_RTL8187) += rtl818x/
  83. -obj-$(CONFIG_RTLWIFI) += rtlwifi/
  84. obj-$(CONFIG_RTL8XXXU) += rtl8xxxu/
  85. obj-$(CONFIG_RTW88) += rtw88/
  86. obj-$(CONFIG_RTW89) += rtw89/
  87. +obj-$(CONFIG_RTL8188EU) += rtl8188eu/
  88. diff -rupN old/linux-6.6/drivers/pps/clients/pps-gpio.c linux-6.6/drivers/pps/clients/pps-gpio.c
  89. --- old/linux-6.6/drivers/pps/clients/pps-gpio.c
  90. +++ linux-6.6/drivers/pps/clients/pps-gpio.c
  91. @@ -113,6 +113,9 @@ static int pps_gpio_setup(struct device
  92. data->assert_falling_edge =
  93. device_property_read_bool(dev, "assert-falling-edge");
  94. + data->capture_clear =
  95. + device_property_read_bool(dev, "capture-clear");
  96. +
  97. data->echo_pin = devm_gpiod_get_optional(dev, "echo", GPIOD_OUT_LOW);
  98. if (IS_ERR(data->echo_pin))
  99. return dev_err_probe(dev, PTR_ERR(data->echo_pin),
  100. diff -rupN old/linux-6.6/drivers/usb/chipidea/ci_hdrc_usb2.c linux-6.6/drivers/usb/chipidea/ci_hdrc_usb2.c
  101. --- old/linux-6.6/drivers/usb/chipidea/ci_hdrc_usb2.c
  102. +++ linux-6.6/drivers/usb/chipidea/ci_hdrc_usb2.c
  103. @@ -65,6 +65,14 @@ static int ci_hdrc_usb2_probe(struct pla
  104. if (match && match->data) {
  105. /* struct copy */
  106. *ci_pdata = *(struct ci_hdrc_platform_data *)match->data;
  107. + if (of_device_is_compatible(pdev->dev.of_node,
  108. + "xlnx,zynq-usb-2.20a")) {
  109. + ci_pdata->usb_phy = devm_usb_get_phy_by_phandle(dev,
  110. + "usb-phy",
  111. + 0);
  112. + if (IS_ERR(ci_pdata->usb_phy))
  113. + return PTR_ERR(ci_pdata->usb_phy);
  114. + }
  115. }
  116. priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
  117. diff -rupN old/linux-6.6/drivers/usb/chipidea/udc.c linux-6.6/drivers/usb/chipidea/udc.c
  118. --- old/linux-6.6/drivers/usb/chipidea/udc.c
  119. +++ linux-6.6/drivers/usb/chipidea/udc.c
  120. @@ -688,7 +688,8 @@ static int _hardware_dequeue(struct ci_h
  121. if ((TD_STATUS_ACTIVE & tmptoken) != 0) {
  122. int n = hw_ep_bit(hwep->num, hwep->dir);
  123. - if (ci->rev == CI_REVISION_24)
  124. + if (ci->rev == CI_REVISION_24 ||
  125. + ci->rev == CI_REVISION_22)
  126. if (!hw_read(ci, OP_ENDPTSTAT, BIT(n)))
  127. reprime_dtd(ci, hwep, node);
  128. hwreq->req.status = -EALREADY;
  129. diff -rupN old/linux-6.6/drivers/usb/phy/Kconfig linux-6.6/drivers/usb/phy/Kconfig
  130. --- old/linux-6.6/drivers/usb/phy/Kconfig
  131. +++ linux-6.6/drivers/usb/phy/Kconfig
  132. @@ -160,7 +160,7 @@ config USB_TEGRA_PHY
  133. config USB_ULPI
  134. bool "Generic ULPI Transceiver Driver"
  135. - depends on ARM || ARM64 || COMPILE_TEST
  136. + depends on ARM || ARM64 || COMPILE_TEST || USB_PHY
  137. select USB_ULPI_VIEWPORT
  138. help
  139. Enable this to support ULPI connected USB OTG transceivers which
  140. diff -rupN old/linux-6.6/drivers/usb/phy/phy-ulpi.c linux-6.6/drivers/usb/phy/phy-ulpi.c
  141. --- old/linux-6.6/drivers/usb/phy/phy-ulpi.c
  142. +++ linux-6.6/drivers/usb/phy/phy-ulpi.c
  143. @@ -13,9 +13,16 @@
  144. #include <linux/kernel.h>
  145. #include <linux/slab.h>
  146. #include <linux/export.h>
  147. +#include <linux/module.h>
  148. +#include <linux/io.h>
  149. +#include <linux/of.h>
  150. +#include <linux/of_address.h>
  151. +#include <linux/of_device.h>
  152. +#include <linux/platform_device.h>
  153. #include <linux/usb.h>
  154. #include <linux/usb/otg.h>
  155. #include <linux/usb/ulpi.h>
  156. +#include <linux/usb/phy.h>
  157. struct ulpi_info {
  158. @@ -39,6 +46,13 @@ static struct ulpi_info ulpi_ids[] = {
  159. ULPI_INFO(ULPI_ID(0x0451, 0x1507), "TI TUSB1210"),
  160. };
  161. +struct ulpi_phy {
  162. + struct usb_phy *usb_phy;
  163. + void __iomem *regs;
  164. + unsigned int vp_offset;
  165. + unsigned int flags;
  166. +};
  167. +
  168. static int ulpi_set_otg_flags(struct usb_phy *phy)
  169. {
  170. unsigned int flags = ULPI_OTG_CTRL_DP_PULLDOWN |
  171. @@ -240,6 +254,23 @@ static int ulpi_set_vbus(struct usb_otg
  172. return usb_phy_io_write(phy, flags, ULPI_OTG_CTRL);
  173. }
  174. +static int usbphy_set_vbus(struct usb_phy *phy, int on)
  175. +{
  176. + unsigned int flags = usb_phy_io_read(phy, ULPI_OTG_CTRL);
  177. +
  178. + flags &= ~(ULPI_OTG_CTRL_DRVVBUS | ULPI_OTG_CTRL_DRVVBUS_EXT);
  179. +
  180. + if (on) {
  181. + if (phy->flags & ULPI_OTG_DRVVBUS)
  182. + flags |= ULPI_OTG_CTRL_DRVVBUS;
  183. +
  184. + if (phy->flags & ULPI_OTG_DRVVBUS_EXT)
  185. + flags |= ULPI_OTG_CTRL_DRVVBUS_EXT;
  186. + }
  187. +
  188. + return usb_phy_io_write(phy, flags, ULPI_OTG_CTRL);
  189. +}
  190. +
  191. static void otg_ulpi_init(struct usb_phy *phy, struct usb_otg *otg,
  192. struct usb_phy_io_ops *ops,
  193. unsigned int flags)
  194. @@ -249,6 +280,7 @@ static void otg_ulpi_init(struct usb_phy
  195. phy->io_ops = ops;
  196. phy->otg = otg;
  197. phy->init = ulpi_init;
  198. + phy->set_vbus = usbphy_set_vbus;
  199. otg->usb_phy = phy;
  200. otg->set_host = ulpi_set_host;
  201. @@ -301,3 +333,69 @@ devm_otg_ulpi_create(struct device *dev,
  202. return phy;
  203. }
  204. EXPORT_SYMBOL_GPL(devm_otg_ulpi_create);
  205. +
  206. +static int ulpi_phy_probe(struct platform_device *pdev)
  207. +{
  208. + struct device_node *np = pdev->dev.of_node;
  209. + struct resource *res;
  210. + struct ulpi_phy *uphy;
  211. + int ret;
  212. +
  213. + uphy = devm_kzalloc(&pdev->dev, sizeof(*uphy), GFP_KERNEL);
  214. + if (!uphy)
  215. + return -ENOMEM;
  216. +
  217. + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  218. + if (!res) {
  219. + dev_err(&pdev->dev, "no phy I/O memory resource defined\n");
  220. + return -ENODEV;
  221. + }
  222. +
  223. + uphy->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
  224. + if (IS_ERR(uphy->regs))
  225. + return PTR_ERR(uphy->regs);
  226. +
  227. + if (of_property_read_bool(np, "external-drv-vbus") ||
  228. + of_property_read_bool(np, "drv-vbus"))
  229. + uphy->flags |= ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT;
  230. +
  231. + ret = of_property_read_u32(np, "view-port", &uphy->vp_offset);
  232. + if (ret)
  233. + return ret;
  234. +
  235. + uphy->usb_phy = otg_ulpi_create(&ulpi_viewport_access_ops, uphy->flags);
  236. + if (!uphy->usb_phy) {
  237. + dev_err(&pdev->dev, "Failed to create ULPI OTG\n");
  238. + return -ENOMEM;
  239. + }
  240. +
  241. + uphy->usb_phy->dev = &pdev->dev;
  242. + uphy->usb_phy->io_priv = uphy->regs + uphy->vp_offset;
  243. + return usb_add_phy_dev(uphy->usb_phy);
  244. +}
  245. +
  246. +static void ulpi_phy_remove(struct platform_device *pdev)
  247. +{
  248. + struct ulpi_phy *uphy = platform_get_drvdata(pdev);
  249. +
  250. + usb_remove_phy(uphy->usb_phy);
  251. +}
  252. +
  253. +static const struct of_device_id ulpi_phy_table[] = {
  254. + { .compatible = "ulpi-phy" },
  255. + { },
  256. +};
  257. +MODULE_DEVICE_TABLE(of, ulpi_phy_table);
  258. +
  259. +static struct platform_driver ulpi_phy_driver = {
  260. + .probe = ulpi_phy_probe,
  261. + .remove_new = ulpi_phy_remove,
  262. + .driver = {
  263. + .name = "ulpi-phy",
  264. + .of_match_table = ulpi_phy_table,
  265. + },
  266. +};
  267. +module_platform_driver(ulpi_phy_driver);
  268. +
  269. +MODULE_DESCRIPTION("ULPI PHY driver");
  270. +MODULE_LICENSE("GPL");