Bug 217100

Summary: Bifurcation between pcie3x1 & pcie3x2 doesn't work in RK3568J.
Product: Drivers Reporter: Anton (smalltalk)
Component: PCIAssignee: drivers_pci (drivers_pci)
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: ARM   
OS: Linux   
Kernel Version: 6.2 Subsystem:
Regression: No Bisected commit-id:

Description Anton 2023-02-28 08:53:50 UTC
Hello.

First, I want to say that pcie3x1 crashes if started before pcie3x2 . Driver
> pcie-designware.c 

in function 

> void dw_pcie_version_detect(struct dw_pcie *pci)

tries to read parameter from dbi register (PCIE_VERSION_NUMBER) and fails on it.
So I changed sequence of declaration PCIE in rk3568.dtsi: first - pcie3x2 next pcie3x1. Now Linux first starts pcie3x2, then successfully starts pcie3x1.

But main problem is that bifurcation in phy driver 
> phy-rockchip-snps-pcie3.c 

doesn't work. I tried add next lines in function

> static int rockchip_p3phy_probe(struct platform_device *pdev)

right after block check

> if (priv->num_lanes == -EINVAL) {
> }

> priv->num_lanes = 2;
> priv->lanes[0] = 1;
> priv->lanes[1] = 2

And driver writes during Linux boot process that bifurcation is enabled, but

lspci

does't show second device.

Best regards,
Anton.