Lines Matching full:bindings

6 devicetree bindings.
42 def __init__(self, vendor_prefixes, bindings): argument
44 self.vnd2bindings = self.init_vnd2bindings(bindings)
50 def bindings(self, vnd, default=None): member in VndLookup
84 def init_vnd2bindings(self, bindings): argument
85 # Take a 'vnd2vendor' map and a list of bindings and return a dict
86 # mapping 'vnd' vendor prefixes prefixes to lists of bindings. The
87 # bindings in each list are sorted by compatible. The keys in the
92 # - The 'None' key maps to bindings with no vendor prefix
94 # - The (UNKNOWN_VENDOR,) key maps to bindings whose compatible
98 # Get an unsorted dict mapping vendor prefixes to lists of bindings.
102 for binding in bindings:
118 # Sort the bindings for each vendor by compatible.
123 # The unknown-vendor bindings being inserted as a 1-tuple key is a
145 # - The None key maps to the ref target for bindings with no
147 # - The (UNKNOWN_VENDOR,) key maps to the ref target for bindings
165 bindings = load_bindings(args.dts_roots, args.dts_folders)
168 vnd_lookup = VndLookup(args.vendor_prefixes, bindings)
169 dump_content(bindings, base_binding, vnd_lookup, driver_sources, args.out_dir,
209 binding_files.extend(glob.glob(f'{dts_root}/dts/bindings/**/*.yml',
211 binding_files.extend(glob.glob(f'{dts_root}/dts/bindings/**/*.yaml',
217 bindings = edtlib.bindings_from_paths(binding_files, ignore_errors=True)
219 num_total = len(bindings)
221 # Remove bindings from the 'vnd' vendor, which is not a real vendor,
224 bindings = [binding for binding in bindings if
227 logger.info('found %d bindings (ignored %d) in this dts_roots list: %s',
228 len(bindings), num_total - len(bindings), dts_roots)
230 return bindings
238 base_yaml = ZEPHYR_BASE / 'dts' / 'bindings' / 'base' / 'base.yaml'
239 base_includes = {"pm.yaml": os.fspath(ZEPHYR_BASE / 'dts' / 'bindings' / 'base'/ 'pm.yaml')}
299 def dump_content(bindings, base_binding, vnd_lookup, driver_sources, out_dir, turbo_mode): argument
307 setup_bindings_dir(bindings, out_dir)
309 write_dummy_index(bindings, out_dir)
312 write_orphans(bindings, base_binding, vnd_lookup, driver_sources, out_dir)
314 def setup_bindings_dir(bindings, out_dir): argument
316 # out_dir / bindings / {binding_path}.rst. Delete all the ones that
317 # shouldn't be there. Make sure the bindings output directory
321 bindings_dir = out_dir / 'bindings'
325 for binding in bindings:
336 def write_dummy_index(bindings, out_dir): argument
337 # Write out_dir / bindings.rst, with dummy anchors
344 'Dummy bindings index',
350 compatibles = {binding.compatible for binding in bindings}
355 write_if_updated(out_dir / 'bindings.rst', content)
359 # Write out_dir / bindings.rst, the top level index of bindings.
366 Bindings index
369 This page documents the available devicetree bindings.
370 See {zref('dt-bindings')} for an introduction to the Zephyr bindings
377 Click on a vendor's name to go to the list of bindings for
383 for vnd, bindings in vnd_lookup.vnd2bindings.items():
384 if len(bindings) == 0:
390 Bindings by vendor
393 This section contains available bindings, grouped by vendor.
394 Within each group, bindings are listed by the "compatible" property
406 The text "(on <bus-name> bus)" appears when bindings may behave
412 for vnd, bindings in vnd_lookup.vnd2bindings.items():
421 if len(bindings) == 0:
432 for binding in bindings:
436 write_if_updated(out_dir / 'bindings.rst', string_io.getvalue())
438 def write_orphans(bindings, base_binding, vnd_lookup, driver_sources, out_dir): argument
439 # Write out_dir / bindings / foo / binding_page.rst for each binding
440 # in 'bindings', along with any "disambiguation" pages needed when a
441 # single compatible string can be handled by multiple bindings.
446 logging.info('updating :orphan: files for %d bindings', len(bindings))
449 # First, figure out which compatibles map to multiple bindings. We
455 for binding in bindings:
457 dup_compat2bindings = {compatible: bindings for compatible, bindings
458 in compat2bindings.items() if len(bindings) > 1}
467 for binding in bindings:
473 written = write_if_updated(out_dir / 'bindings' /
503 # compatibles which have multiple associated bindings; if
527 # This compatible is handled by multiple bindings;
672 # bindings.
774 def print_compatible_disambiguation_page(compatible, bindings, string_io): argument
776 # handled by any of the bindings in 'bindings', to 'string_io'.
778 assert len(bindings) > 1, (compatible, bindings)
782 for binding in bindings)
793 of the following bindings:
836 # By default, the bindings docs are in the main Zephyr
858 # directory containing documentation for all bindings. It does
859 # this by stripping off the '.../dts/bindings/' prefix common to
860 # all bindings files in a DTS_ROOT directory.
862 # For example, for .../zephyr/dts/bindings/base/base.yaml, this
869 dts_bindings = 'dts/bindings/'
875 # Cut past dts/bindings, strip off the extension (.yaml or .yml), and