Message ID | 20231018085631.1121289-1-yoshihiro.shimoda.uh@renesas.com (mailing list archive) |
---|---|
Headers | show |
Series | PCI: dwc: rcar-gen4: Add R-Car Gen4 PCIe support | expand |
On Wed, Oct 18, 2023 at 05:56:16PM +0900, Yoshihiro Shimoda wrote: > Add R-Car S4-8 (R-Car Gen4) PCIe controller for both host and endpoint modes. > To support them, modify PCIe DesignWare common codes. > > Changes from v24: > https://lore.kernel.org/linux-pci/20231011071423.249458-1-yoshihiro.shimoda.uh@renesas.com/ > - Based on the latest pci.git / next branch. > - Reordering the patches. (This is suggested by Bjorn.) > - Drop "PCI: dwc: Disable two BARs to avoid unnecessary memory assignment" > because break other platforms. Does R-Car Gen4 still work without this patch? The previous commit log said host mode didn't work: PCI: dwc: Disable two BARs to avoid unnecessary memory assignment According to the section 3.5.7.2 "RC Mode" in DWC PCIe Dual Mode Rev.5.20a, we should disable two BARs to avoid unnecessary memory assignment during device enumeration. Otherwise, Renesas R-Car Gen4 PCIe controllers cannot work correctly in host mode. (from https://lore.kernel.org/r/20231011071423.249458-9-yoshihiro.shimoda.uh@renesas.com) I don't think we want to merge the driver unless it actually works. Bjorn
Hello Bjorn, > From: Bjorn Helgaas, Sent: Thursday, October 19, 2023 12:11 PM > > On Wed, Oct 18, 2023 at 05:56:16PM +0900, Yoshihiro Shimoda wrote: > > Add R-Car S4-8 (R-Car Gen4) PCIe controller for both host and endpoint modes. > > To support them, modify PCIe DesignWare common codes. > > > > Changes from v24: > > <snip URL> > > - Based on the latest pci.git / next branch. > > - Reordering the patches. (This is suggested by Bjorn.) > > - Drop "PCI: dwc: Disable two BARs to avoid unnecessary memory assignment" > > because break other platforms. > > Does R-Car Gen4 still work without this patch? Yes, R-Car Gen4 still work without this patch because I added this code into the patch 12/15 again: --- +static int rcar_gen4_pcie_host_init(struct dw_pcie_rp *pp) +{ ... + /* + * According to the section 3.5.7.2 "RC Mode" in DWC PCIe Dual Mode + * Rev.5.20a and 3.5.6.1 "RC mode" in DWC PCIe RC databook v5.20a, we + * should disable two BARs to avoid unnecessary memory assignment + * during device enumeration. + */ + dw_pcie_writel_dbi2(dw, PCI_BASE_ADDRESS_0, 0x0); + dw_pcie_writel_dbi2(dw, PCI_BASE_ADDRESS_1, 0x0); --- I also mentioned about this on the cover-letter like below, but it may be difficult to understand. I'm sorry about lack explanation... I should have explained one sentence about that... >> - Add specific-setting by using dbi2 again in the patch 12/15. >> - Modify commend of the specific-setting in the patch 12/15. Serge suggested >> this on v23 but I missed to modify this on v24. > The previous commit log said host mode didn't work: > > PCI: dwc: Disable two BARs to avoid unnecessary memory assignment > > According to the section 3.5.7.2 "RC Mode" in DWC PCIe Dual Mode > Rev.5.20a, we should disable two BARs to avoid unnecessary memory > assignment during device enumeration. Otherwise, Renesas R-Car Gen4 > PCIe controllers cannot work correctly in host mode. > > (from https://lore.kernel.org/all/20231011071423.249458-9-yoshihiro.shimoda.uh@renesas.com/) > > I don't think we want to merge the driver unless it actually works. I understood it. Best regards, Yoshihiro Shimoda > Bjorn
On Thu, Oct 19, 2023 at 04:08:52AM +0000, Yoshihiro Shimoda wrote: > > From: Bjorn Helgaas, Sent: Thursday, October 19, 2023 12:11 PM > > On Wed, Oct 18, 2023 at 05:56:16PM +0900, Yoshihiro Shimoda wrote: > > > Add R-Car S4-8 (R-Car Gen4) PCIe controller for both host and endpoint modes. > > > To support them, modify PCIe DesignWare common codes. > > > > > > Changes from v24: > > > > <snip URL> > > > - Based on the latest pci.git / next branch. > > > - Reordering the patches. (This is suggested by Bjorn.) > > > - Drop "PCI: dwc: Disable two BARs to avoid unnecessary memory assignment" > > > because break other platforms. > > > > Does R-Car Gen4 still work without this patch? > > Yes, R-Car Gen4 still work without this patch because I added this code into > the patch 12/15 again: > > --- > +static int rcar_gen4_pcie_host_init(struct dw_pcie_rp *pp) > +{ > ... > + /* > + * According to the section 3.5.7.2 "RC Mode" in DWC PCIe Dual Mode > + * Rev.5.20a and 3.5.6.1 "RC mode" in DWC PCIe RC databook v5.20a, we > + * should disable two BARs to avoid unnecessary memory assignment > + * during device enumeration. > + */ > + dw_pcie_writel_dbi2(dw, PCI_BASE_ADDRESS_0, 0x0); > + dw_pcie_writel_dbi2(dw, PCI_BASE_ADDRESS_1, 0x0); Great, thanks! Bjorn
Hello, > Add R-Car S4-8 (R-Car Gen4) PCIe controller for both host and endpoint modes. > To support them, modify PCIe DesignWare common codes. [...] Applied to controller/rcar, thank you! [01/15] PCI: Add T_PVPERL macro https://git.kernel.org/pci/pci/c/164f66be0c25 [02/15] PCI: dwc: Add dw_pcie_link_set_max_link_width() https://git.kernel.org/pci/pci/c/a9a1bcba9025 [03/15] PCI: dwc: Add missing PCI_EXP_LNKCAP_MLW handling https://git.kernel.org/pci/pci/c/89db0793c9f2 [04/15] PCI: tegra194: Drop PCI_EXP_LNKSTA_NLW setting https://git.kernel.org/pci/pci/c/1a9745476cae [05/15] PCI: dwc: endpoint: Add multiple PFs support for dbi2 https://git.kernel.org/pci/pci/c/7873b49b41b9 [06/15] PCI: dwc: Add EDMA_UNROLL capability flag https://git.kernel.org/pci/pci/c/1896d17f9168 [07/15] PCI: dwc: Expose dw_pcie_ep_exit() to module https://git.kernel.org/pci/pci/c/2066b41a2ef8 [08/15] PCI: dwc: endpoint: Introduce .pre_init() and .deinit() https://git.kernel.org/pci/pci/c/52b4edbc304c [09/15] dt-bindings: PCI: dwc: Update maxItems of reg and reg-names https://git.kernel.org/pci/pci/c/7e8fcf83c48a [10/15] dt-bindings: PCI: renesas: Add R-Car Gen4 PCIe Host https://git.kernel.org/pci/pci/c/e8858cc55f62 [11/15] dt-bindings: PCI: renesas: Add R-Car Gen4 PCIe Endpoint https://git.kernel.org/pci/pci/c/5df0306d03c9 [12/15] PCI: rcar-gen4: Add R-Car Gen4 PCIe controller support for host mode https://git.kernel.org/pci/pci/c/8227bf7a81e6 [13/15] PCI: rcar-gen4: Add endpoint mode support https://git.kernel.org/pci/pci/c/d3c54d8ba855 [14/15] MAINTAINERS: Update PCI DRIVER FOR RENESAS R-CAR for R-Car Gen4 https://git.kernel.org/pci/pci/c/2c1cca77c894 [15/15] misc: pci_endpoint_test: Add Device ID for R-Car S4-8 PCIe controller https://git.kernel.org/pci/pci/c/a21169341a16 Krzysztof