On Mon, 07 Nov 2022 23:49:23 +0300, Serge Semin wrote: > Currently the 'interrupts' and 'interrupt-names' properties are defined > being too generic to really describe any actual IRQ interface. Moreover > the DW PCIe End-point devices are left with no IRQ signals. All of that > can be fixed by adding the IRQ-related properties to the common DW PCIe > DT-schemas in accordance with the hardware reference manual. The DW PCIe > common DT-schema will contain the generic properties definitions with just > a number of entries per property, while the DW PCIe RP/EP-specific schemas > will have the particular number of items and the generic resource names > listed. > > Note since there are DW PCI-based vendor-specific DT-bindings with the > custom names assigned to the same IRQ resources we have no much choice but > to add them to the generic DT-schemas in order to have the schemas being > applicable for such devices. These names are marked as vendor-specific and > should be avoided being used in new bindings in favor of the generic > names. > > Signed-off-by: Serge Semin <Sergey.Semin@xxxxxxxxxxxxxxxxxxxx> > > --- > > Note without the next dtschema tool fix > > --- a/lib.py 2022-09-29 15:17:13.100033810 +0300 > +++ b/lib.py 2022-09-29 15:19:54.886172794 +0300 > @@ -1307,7 +1307,7 @@ > def format_error(filename, error, prefix="", nodename=None, verbose=False): > src = prefix + os.path.abspath(filename) + ':' > > - if error.linecol[0] >= 0: > + if hasattr(error, 'linecol') and error.linecol[0] >= 0: > src = src + '%i:%i: ' % (error.linecol[0]+1, error.linecol[1]+1) > else: > src += ' ' > @@ -1342,10 +1342,10 @@ > else: > msg = error.message > > - if error.note: > + if hasattr(error, 'note') and error.note: > msg += '\n\t' + prefix + 'hint: ' + error.note > > - if error.schema_file: > + if hasattr(error, 'schema_file') and error.schema_file: > msg += '\n\t' + prefix + 'from schema $id: ' + error.schema_file > > return src + msg > > any DT-bindings error will cause the dt-schema script crash: > > Traceback (most recent call last): > File "/home/fancer/.local/bin/dt-validate", line 175, in <module> > sg.check_trees(filename, testtree) > File "/home/fancer/.local/bin/dt-validate", line 122, in check_trees > self.check_subtree(dt, subtree, False, "/", "/", filename) > File "/home/fancer/.local/bin/dt-validate", line 111, in check_subtree > self.check_subtree(tree, value, disabled, name, fullname + name, filename) > File "/home/fancer/.local/bin/dt-validate", line 111, in check_subtree > self.check_subtree(tree, value, disabled, name, fullname + name, filename) > File "/home/fancer/.local/bin/dt-validate", line 106, in check_subtree > self.check_node(tree, subtree, disabled, nodename, fullname, filename) > File "/home/fancer/.local/bin/dt-validate", line 84, in check_node > print(dtschema.format_error(filename, error, nodename=nodename, verbose=verbose) + > File "/home/fancer/.local/lib/python3.8/site-packages/dtschema/lib.py", line 1332, in format_error > msg += '\n' + format_error(filename, suberror, prefix=prefix+"\t", nodename=nodename, verbose=verbose) > File "/home/fancer/.local/lib/python3.8/site-packages/dtschema/lib.py", line 1310, in format_error > if error.linecol[0] >= 0: > AttributeError: 'ValidationError' object has no attribute 'linecol' > > Changelog v3: > - This is a new patch unpinned from the next one: > https://lore.kernel.org/linux-pci/20220503214638.1895-2-Sergey.Semin@xxxxxxxxxxxxxxxxxxxx/ > by the Rob' request. (@Rob) > > Changelog v5: > - Add platform-specific interrupt names, but mark them as deprecated. > > Changelog v6: > - Move the common interrupt-names definitions to the RP/EP schemas. > Thus drop the 'definitions' property. (@Rob) > - Drop the 'deprecated' keywords from the vendor-specific names. (@Rob) > --- > .../bindings/pci/snps,dw-pcie-common.yaml | 19 ++++ > .../bindings/pci/snps,dw-pcie-ep.yaml | 52 +++++++++++ > .../devicetree/bindings/pci/snps,dw-pcie.yaml | 90 ++++++++++++++++++- > 3 files changed, 158 insertions(+), 3 deletions(-) > Reviewed-by: Rob Herring <robh@xxxxxxxxxx>