File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 8282 TYPE_PHANDLE , TYPE_PHANDLES_AND_NUMS
8383from grutils import Graph
8484
85+
86+ dtc_flags = ""
87+
8588#
8689# Public classes
8790#
@@ -776,6 +779,8 @@ class Node:
776779 The flash controller for the node. Only meaningful for nodes representing
777780 flash partitions.
778781 """
782+ global dtc_flags
783+
779784 @property
780785 def name (self ):
781786 "See the class docstring"
@@ -797,9 +802,12 @@ def unit_addr(self):
797802
798803 addr = _translate (addr , self ._node )
799804
800- if self .regs and self .regs [0 ].addr != addr :
801- self .edt ._warn ("unit-address and first reg (0x{:x}) don't match "
802- "for {}" .format (self .regs [0 ].addr , self .name ))
805+ # This code is redundant, it checks the same thing as simple_bus_reg in
806+ # dtc, we disable it in python if it's suppressed in dtc.
807+ if "-Wno-simple_bus_reg" not in dtc_flags :
808+ if self .regs and self .regs [0 ].addr != addr :
809+ self .edt ._warn ("unit-address and first reg (0x{:x}) don't match "
810+ "for {}" .format (self .regs [0 ].addr , self .name ))
803811
804812 return addr
805813
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ def main():
4545 conf_file = open (args .conf_out , "w" , encoding = "utf-8" )
4646 header_file = open (args .header_out , "w" , encoding = "utf-8" )
4747 flash_area_num = 0
48+ edtlib .dtc_flags = args .dtc_flags
4849
4950 write_top_comment (edt )
5051
@@ -89,6 +90,7 @@ def parse_args():
8990
9091 parser = argparse .ArgumentParser ()
9192 parser .add_argument ("--dts" , required = True , help = "DTS file" )
93+ parser .add_argument ("--dtc-flags" , help = "extra device tree parameters" )
9294 parser .add_argument ("--bindings-dirs" , nargs = '+' , required = True ,
9395 help = "directory with bindings in YAML format, "
9496 "we allow multiple" )
You can’t perform that action at this time.
0 commit comments