rockpro64/pinebookpro: remove max-link-speed from board DTS sometime in mid-2019, rockchip disabled PCIe 2.x referrencing a non-public errata in linux and the dts [1]. we have part of that change in our rk3399.dtsi already, but our rockpro64 and pinebook pro dts files have the (older) value of 2, and are simply removed in this change. (this leaves rk3399-nanopi4.dtsi with set to 2, which matches upstream.) we haven't observed any specific problems, but we've also tested far fewer cards than linux. there are other issues such as what happens for a PCI abort depending on which CPU triggers it we do not currently handle either. tested on rockpro64 with nvme(4), wm(4), and ahcisata(4), and pinebook pro with nvme(4). [1] https://lore.kernel.org/all/1481881357-1793-1-git-send-email-shawn.lin@rock-chips.com/ Index: arch/arm/rockchip/rk3399_pcie.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/rockchip/rk3399_pcie.c,v retrieving revision 1.16 diff -p -u -r1.16 rk3399_pcie.c --- arch/arm/rockchip/rk3399_pcie.c 3 Sep 2021 01:21:48 -0000 1.16 +++ arch/arm/rockchip/rk3399_pcie.c 3 Sep 2021 01:55:01 -0000 @@ -254,8 +254,17 @@ rkpcie_attach(device_t parent, device_t ep_gpio = fdtbus_gpio_acquire(phandle, "ep-gpios", GPIO_PIN_OUTPUT); + /* + * Let board-specific properties override the default, which is set + * to PCIe 1.x, due to errata in the RK3399 CPU. We don't know exactly + * what these errata involved (not public), but posts from the + * @rock-chips.com domain to u-boot and linux-kernel lists indicate + * that there is a errata related to this, and indeed, the Datasheet + * since at least Rev 1.6 and inluding the latest Rev 1.8 say that the + * PCIe can handle 2.5GT/s (ie, PCIe 1.x). + */ if (of_getprop_uint32(phandle, "max-link-speed", &max_link_speed) != 0) - max_link_speed = 2; + max_link_speed = 1; if (of_getprop_uint32(phandle, "num-lanes", &num_lanes) != 0) num_lanes = 1; Index: arch/arm/dts/rk3399-pinebook-pro.dts =================================================================== RCS file: /cvsroot/src/sys/arch/arm/dts/rk3399-pinebook-pro.dts,v retrieving revision 1.3 diff -p -u -r1.3 rk3399-pinebook-pro.dts --- arch/arm/dts/rk3399-pinebook-pro.dts 17 May 2020 19:57:25 -0000 1.3 +++ arch/arm/dts/rk3399-pinebook-pro.dts 3 Sep 2021 01:55:01 -0000 @@ -766,7 +766,6 @@ &pcie0 { ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>; num-lanes = <4>; - max-link-speed = <2>; pinctrl-names = "default"; pinctrl-0 = <&pcie_clkreqn_cpm>; vpcie3v3-supply = <&vcc3v3_pcie>; Index: arch/arm/dts/rk3399-rockpro64.dts =================================================================== RCS file: /cvsroot/src/sys/arch/arm/dts/rk3399-rockpro64.dts,v retrieving revision 1.12 diff -p -u -r1.12 rk3399-rockpro64.dts --- arch/arm/dts/rk3399-rockpro64.dts 3 Sep 2021 01:21:48 -0000 1.12 +++ arch/arm/dts/rk3399-rockpro64.dts 3 Sep 2021 01:55:01 -0000 @@ -181,7 +181,6 @@ &pcie0 { ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>; num-lanes = <4>; - max-link-speed = <2>; pinctrl-names = "default"; pinctrl-0 = <&pcie_clkreqn>; vpcie3v3-supply = <&vcc3v3_pcie>;