Re: [PATCH V3 1/2] dt-bindings: PCI: tegra234: Add ECAM support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 9, 2022 at 4:17 AM Serge Semin
<Sergey.Semin@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Tue, Dec 06, 2022 at 03:14:58PM -0600, Rob Herring wrote:
> > On Tue, Dec 6, 2022 at 10:44 AM Thierry Reding <thierry.reding@xxxxxxxxx> wrote:
> > >
> > > On Mon, Dec 05, 2022 at 05:41:55PM -0600, Rob Herring wrote:
> > > > On Thu, Nov 17, 2022 at 3:38 PM Thierry Reding <thierry.reding@xxxxxxxxx> wrote:
> > > > >
> > > > > On Mon, Nov 14, 2022 at 03:53:32PM +0000, Jon Hunter wrote:
> > > > > > From: Vidya Sagar <vidyas@xxxxxxxxxx>
> > > > > >
> > > > > > Add support for ECAM aperture that is only supported for Tegra234
> > > > > > devices.
> > > > > >
> > > > > > Signed-off-by: Vidya Sagar <vidyas@xxxxxxxxxx>
> > > > > > Co-developed-by: Jon Hunter <jonathanh@xxxxxxxxxx>
> > > > > > Signed-off-by: Jon Hunter <jonathanh@xxxxxxxxxx>
> > > > > > ---
> > > > > > Changes since V2:
> > > > > > - Avoid duplication of reg items and reg-names
> > > > > > Changes since V1:
> > > > > > - Restricted the ECAM aperture to only Tegra234 devices that support it.
> > > > > >
> > > > > >  .../bindings/pci/nvidia,tegra194-pcie.yaml    | 34 +++++++++++++++++--
> > > > > >  .../devicetree/bindings/pci/snps,dw-pcie.yaml |  2 +-
> > > > > >  2 files changed, 33 insertions(+), 3 deletions(-)
> > > > >
> > > > > Both patches applied now.
> > > >
> > > > linux-next now fails with this. I suspect it is due to Sergey's
> > > > changes to the DWC schema.
> > > >
> > > > /builds/robherring/linux-dt/Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.example.dtb:
> > > > pcie@14160000: reg-names:4: 'oneOf' conditional failed, one must be
> > > > fixed:
> > > >         'dbi' was expected
> > > >         'dbi2' was expected
> > > >         'ecam' is not one of ['elbi', 'app']
> > > >         'atu' was expected
> > > >         'dma' was expected
> > > >         'phy' was expected
> > > >         'config' was expected
> > > >         /builds/robherring/linux-dt/Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.example.dtb:
> > > > pcie@14160000: reg-names:4: 'oneOf' conditional failed, one must be
> > > > fixed:
> > > >                 'ecam' is not one of ['apb', 'mgmt', 'link', 'ulreg', 'appl']
> > > >                 'ecam' is not one of ['atu_dma']
> > > >                 'ecam' is not one of ['smu', 'mpu']
> > > >         From schema:
> > > > /builds/robherring/linux-dt/Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml
> > >
> > > Stephen reported the other day that he wasn't able to resolve this
> > > conflict in linux-next, so he dropped the ECAM bits. The ECAM patch has
> > > now propagated to ARM SoC so it can't be easily backed out, but I guess
> > > we could revert on that tree and instead apply the patch to the DT tree
> > > and resolve the conflict there.
> > >
> > > I guess the better alternative would be to try and resolve the merge
> > > properly and let Stephen (and Linus) know.
> >
>
> > Instead, can you prepare a patch on top of Sergey's adding a 'oneOf'
> > entry with 'ecam'. As this is a new thing, it should have its own
> > entry. Then when merging, we just throw out the change from your side.
>
> Right, the only change that is required here is to extend the
> reg-names oneOf list of the DT-bindings:
> < Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml
> with the 'ecam' entry. If it's a vendor-specific part then add to the
> last the last entry defines the vendor-specific duplicates of the generic CSR
> spaces.
>
> On the other hand I don't really see a reason in adding the ECAM CSRs
> space to the generic DW PCIe device since basically the ECAM memory is
> just a pre-configured outbound iATU window. So if it's a ECAM-based
> device then it should have been already configured by the system
> bootloader upon the kernel boot up. Thus there is no point in having
> the generic DW PCIe resources and it should be just a generic
> ECAM-based device with a single ECAM CSR space as the
> "snps,dw-pcie-ecam"/"pci-host-ecam-generic" DT-bindings require
> especially seeing the Nvidia low-level driver doesn't use the ECAM
> registers at all. Moreover the DW PCIe core driver doesn't
> differentiate between the already configured iATU windows and the one
> available for the ranges-based mapping. Instead the DW PCIe core just
> disables all the detected in- and outbound iATUs by means of the
> dw_pcie_iatu_setup() method. So the pre-configured ECAM space will be
> reset by the driver core anyway.

This was discussed some before. This is for the firmware/bootloader to
setup ECAM mode. Then the kernel will see generic (ACPI) ECAM.

Yes, it is iATU config, but so is 'config'. If we were starting over,
I'd say 'reg' should just have the entire address space for iATU and
the driver could figure out how to configure it (beyond what ranges
says). But that ship has sailed. Also, note that the address range
here is disjoint from 'config', so it looks like we'd need 2 entries
anyways.

Rob



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux