linux-6.12.patch 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. diff -rupN old/linux-6.12/drivers/char/Kconfig linux-6.12/drivers/char/Kconfig
  2. --- old/linux-6.12/drivers/char/Kconfig
  3. +++ linux-6.12/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.12/drivers/char/Makefile linux-6.12/drivers/char/Makefile
  17. --- old/linux-6.12/drivers/char/Makefile
  18. +++ linux-6.12/drivers/char/Makefile
  19. @@ -43,3 +43,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.12/drivers/net/phy/intel-xway.c linux-6.12/drivers/net/phy/intel-xway.c
  26. --- old/linux-6.12/drivers/net/phy/intel-xway.c
  27. +++ linux-6.12/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.12/drivers/net/wireless/realtek/Kconfig linux-6.12/drivers/net/wireless/realtek/Kconfig
  66. --- old/linux-6.12/drivers/net/wireless/realtek/Kconfig
  67. +++ linux-6.12/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.12/drivers/net/wireless/realtek/Makefile linux-6.12/drivers/net/wireless/realtek/Makefile
  78. --- old/linux-6.12/drivers/net/wireless/realtek/Makefile
  79. +++ linux-6.12/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.12/drivers/pps/clients/pps-gpio.c linux-6.12/drivers/pps/clients/pps-gpio.c
  89. --- old/linux-6.12/drivers/pps/clients/pps-gpio.c
  90. +++ linux-6.12/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.12/drivers/usb/chipidea/ci_hdrc_usb2.c linux-6.12/drivers/usb/chipidea/ci_hdrc_usb2.c
  101. --- old/linux-6.12/drivers/usb/chipidea/ci_hdrc_usb2.c
  102. +++ linux-6.12/drivers/usb/chipidea/ci_hdrc_usb2.c
  103. @@ -62,9 +62,18 @@ static int ci_hdrc_usb2_probe(struct pla
  104. }
  105. data = device_get_match_data(&pdev->dev);
  106. - if (data)
  107. + if (data) {
  108. /* struct copy */
  109. *ci_pdata = *data;
  110. + if (of_device_is_compatible(pdev->dev.of_node,
  111. + "xlnx,zynq-usb-2.20a")) {
  112. + ci_pdata->usb_phy = devm_usb_get_phy_by_phandle(dev,
  113. + "usb-phy",
  114. + 0);
  115. + if (IS_ERR(ci_pdata->usb_phy))
  116. + return PTR_ERR(ci_pdata->usb_phy);
  117. + }
  118. + }
  119. priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
  120. if (!priv)
  121. diff -rupN old/linux-6.12/drivers/usb/phy/Kconfig linux-6.12/drivers/usb/phy/Kconfig
  122. --- old/linux-6.12/drivers/usb/phy/Kconfig
  123. +++ linux-6.12/drivers/usb/phy/Kconfig
  124. @@ -160,7 +160,7 @@ config USB_TEGRA_PHY
  125. config USB_ULPI
  126. bool "Generic ULPI Transceiver Driver"
  127. - depends on ARM || ARM64 || COMPILE_TEST
  128. + depends on ARM || ARM64 || COMPILE_TEST || USB_PHY
  129. select USB_ULPI_VIEWPORT
  130. help
  131. Enable this to support ULPI connected USB OTG transceivers which
  132. diff -rupN old/linux-6.12/drivers/usb/phy/phy-ulpi.c linux-6.12/drivers/usb/phy/phy-ulpi.c
  133. --- old/linux-6.12/drivers/usb/phy/phy-ulpi.c
  134. +++ linux-6.12/drivers/usb/phy/phy-ulpi.c
  135. @@ -13,9 +13,16 @@
  136. #include <linux/kernel.h>
  137. #include <linux/slab.h>
  138. #include <linux/export.h>
  139. +#include <linux/module.h>
  140. +#include <linux/io.h>
  141. +#include <linux/of.h>
  142. +#include <linux/of_address.h>
  143. +#include <linux/of_device.h>
  144. +#include <linux/platform_device.h>
  145. #include <linux/usb.h>
  146. #include <linux/usb/otg.h>
  147. #include <linux/usb/ulpi.h>
  148. +#include <linux/usb/phy.h>
  149. struct ulpi_info {
  150. @@ -39,6 +46,13 @@ static struct ulpi_info ulpi_ids[] = {
  151. ULPI_INFO(ULPI_ID(0x0451, 0x1507), "TI TUSB1210"),
  152. };
  153. +struct ulpi_phy {
  154. + struct usb_phy *usb_phy;
  155. + void __iomem *regs;
  156. + unsigned int vp_offset;
  157. + unsigned int flags;
  158. +};
  159. +
  160. static int ulpi_set_otg_flags(struct usb_phy *phy)
  161. {
  162. unsigned int flags = ULPI_OTG_CTRL_DP_PULLDOWN |
  163. @@ -240,6 +254,23 @@ static int ulpi_set_vbus(struct usb_otg
  164. return usb_phy_io_write(phy, flags, ULPI_OTG_CTRL);
  165. }
  166. +static int usbphy_set_vbus(struct usb_phy *phy, int on)
  167. +{
  168. + unsigned int flags = usb_phy_io_read(phy, ULPI_OTG_CTRL);
  169. +
  170. + flags &= ~(ULPI_OTG_CTRL_DRVVBUS | ULPI_OTG_CTRL_DRVVBUS_EXT);
  171. +
  172. + if (on) {
  173. + if (phy->flags & ULPI_OTG_DRVVBUS)
  174. + flags |= ULPI_OTG_CTRL_DRVVBUS;
  175. +
  176. + if (phy->flags & ULPI_OTG_DRVVBUS_EXT)
  177. + flags |= ULPI_OTG_CTRL_DRVVBUS_EXT;
  178. + }
  179. +
  180. + return usb_phy_io_write(phy, flags, ULPI_OTG_CTRL);
  181. +}
  182. +
  183. static void otg_ulpi_init(struct usb_phy *phy, struct usb_otg *otg,
  184. struct usb_phy_io_ops *ops,
  185. unsigned int flags)
  186. @@ -249,6 +280,7 @@ static void otg_ulpi_init(struct usb_phy
  187. phy->io_ops = ops;
  188. phy->otg = otg;
  189. phy->init = ulpi_init;
  190. + phy->set_vbus = usbphy_set_vbus;
  191. otg->usb_phy = phy;
  192. otg->set_host = ulpi_set_host;
  193. @@ -301,3 +333,69 @@ devm_otg_ulpi_create(struct device *dev,
  194. return phy;
  195. }
  196. EXPORT_SYMBOL_GPL(devm_otg_ulpi_create);
  197. +
  198. +static int ulpi_phy_probe(struct platform_device *pdev)
  199. +{
  200. + struct device_node *np = pdev->dev.of_node;
  201. + struct resource *res;
  202. + struct ulpi_phy *uphy;
  203. + int ret;
  204. +
  205. + uphy = devm_kzalloc(&pdev->dev, sizeof(*uphy), GFP_KERNEL);
  206. + if (!uphy)
  207. + return -ENOMEM;
  208. +
  209. + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  210. + if (!res) {
  211. + dev_err(&pdev->dev, "no phy I/O memory resource defined\n");
  212. + return -ENODEV;
  213. + }
  214. +
  215. + uphy->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
  216. + if (IS_ERR(uphy->regs))
  217. + return PTR_ERR(uphy->regs);
  218. +
  219. + if (of_property_read_bool(np, "external-drv-vbus") ||
  220. + of_property_read_bool(np, "drv-vbus"))
  221. + uphy->flags |= ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT;
  222. +
  223. + ret = of_property_read_u32(np, "view-port", &uphy->vp_offset);
  224. + if (ret)
  225. + return ret;
  226. +
  227. + uphy->usb_phy = otg_ulpi_create(&ulpi_viewport_access_ops, uphy->flags);
  228. + if (!uphy->usb_phy) {
  229. + dev_err(&pdev->dev, "Failed to create ULPI OTG\n");
  230. + return -ENOMEM;
  231. + }
  232. +
  233. + uphy->usb_phy->dev = &pdev->dev;
  234. + uphy->usb_phy->io_priv = uphy->regs + uphy->vp_offset;
  235. + return usb_add_phy_dev(uphy->usb_phy);
  236. +}
  237. +
  238. +static void ulpi_phy_remove(struct platform_device *pdev)
  239. +{
  240. + struct ulpi_phy *uphy = platform_get_drvdata(pdev);
  241. +
  242. + usb_remove_phy(uphy->usb_phy);
  243. +}
  244. +
  245. +static const struct of_device_id ulpi_phy_table[] = {
  246. + { .compatible = "ulpi-phy" },
  247. + { },
  248. +};
  249. +MODULE_DEVICE_TABLE(of, ulpi_phy_table);
  250. +
  251. +static struct platform_driver ulpi_phy_driver = {
  252. + .probe = ulpi_phy_probe,
  253. + .remove = ulpi_phy_remove,
  254. + .driver = {
  255. + .name = "ulpi-phy",
  256. + .of_match_table = ulpi_phy_table,
  257. + },
  258. +};
  259. +module_platform_driver(ulpi_phy_driver);
  260. +
  261. +MODULE_DESCRIPTION("ULPI PHY driver");
  262. +MODULE_LICENSE("GPL");