Commit graph

19 commits

Author SHA1 Message Date
James Roy
ee17657ad3 edtlib: binding: Add a title keyword
Add a 'title' keyword to the binding to provide a short
description of the binding, while 'description' serves as
the long description.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-04-02 12:54:24 +02:00
Jordan Yates
052aaf6abe doc: _scripts: gen_devicetree_rest: add individual files
Add a CLI argument for specifying individual files to be added to the
parsing. This is useful for downstream users that wish to import files
such as `bindings/spi/spi-device.yaml`, without also pulling in all the
associated SPI controllers.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-01-07 00:26:08 +01:00
Benjamin Cabé
e544465cd6 doc: _scripts: conf: apply ruff lint rules
This makes all remaining Python scripts in doc compliant w.r.t current
Ruff rules

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-26 15:43:52 -05:00
Benjamin Cabé
d224fa130e doc: _scripts: gen_devicetree_rest: add link to driver sources
When generating the documentation pages for the devicetree bindings, add
a link to the .c file implementing the corresponding driver, or folder
likely to contain the driver implementation, using heuristics to
determine the most likely location of the driver sources.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-10-03 17:08:43 +01:00
Jordan Yates
b666262a62 doc: _scripts: gen_devicetree_rest: extra folders
Add an option to specify particular folders to pull bindings from
when generating documentation. This is useful for downstream projects
that may want to document their own bindings, but don't want to pull in
every Zephyr binding.

This is not currently possible as almost every binding depends on
`base.yaml`, which exists in the Zephyr repository. This is now enabled
by adding the following to `DTS_ARGS` in the downstream `CMakeLists.txt`
file: `--dts-folder ${ZEPHYR_BASE}/dts/bindings/base`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-12 14:30:14 +03:00
Jordan Yates
ae25d606c9 doc: _scripts: gen_devicetree_rest: skip empty vendors
Don't create output sections for vendors without bindings. This only
affects the `Unknown vendor` and `Generic or vendor-independent`
vendors, which are populated by default but do not necessarily contain
any entries.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-12 14:30:14 +03:00
Jamie McCrae
ec7044437e treewide: Disable automatic argparse argument shortening
Disables allowing the python argparse library from automatically
shortening command line arguments, this prevents issues whereby
a new command is added and code that wrongly uses the shortened
command of an existing argument which is the same as the new
command being added will silently change script behaviour.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-01-26 20:12:36 +09:00
Stephanos Ioannidis
99f1911520 doc: gen_devicetree_rest: Fix binding doc file name resolution
The `binding_filename` function, which resolves the binding
documentation file name from the binding yaml file name, made a very
crude assumption that the binding yaml file name will always have the
extension name of `yaml` -- this is no longer true after the commit
c453220006, which added support for both
`yaml` or `yml`.

This commit reworks the function such that its implementation is not
dependent on the extension name of the binding yaml file.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-07-25 15:18:27 +02:00
Kumar Gala
c453220006 doc: gen_devicetree_rest: Fix glob to handle both .yaml and .yml
The glob search was only finding .yaml files, however we do have a
few .yml bindings that got missed.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-15 10:12:46 -07:00
Nazar Kazakov
f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Gerard Marull-Paretas
5986d882bb doc: add support for DT_TURBO_MODE
Similar to Kconfig turbo mode, add a Devicetree bindings turbo mode. In
this mode, the Devicetree bindings pages are not generated. Instead, a
page with dummy symbols is created. This takes ~1K pages out of the
build, resulting in faster builds. This mode can be useful while in
development or CI PRs.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-21 20:47:10 -05:00
Flavio Ceolin
8eceeee798 pm: device: Add wakeup source API
Introduce a new API to allow devices capable of wake up the system
register themselves was wake up sources. This permits applications to
select the most appropriate way to wake up the system when it is
suspended.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-11 19:39:13 -04:00
Martí Bolívar
7b60fa3a15 edtlib: move vendor-prefixes.txt parsing in here
Take this helper from the doc tooling and expose it as API.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-03 12:21:45 -05:00
Martí Bolívar
57c4a4dec6 dts: tweak vendor-prefixes.txt format
Use a comment syntax instead of a separator. This is a bit cleaner
and is prep work for moving the parsing code to a more generic place,
namely edtlib.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-03 12:21:45 -05:00
Martí Bolívar
7baf5e6176 doc: fix gen_devicetree_rest.py bindings search
The gen_devicetree_rest.py script is responsible for generating .rst
files that comprise the devicetree bindings index. As a first step, it
finds all the YAML files that might be bindings.

However, it's doing that incorrectly and ignoring files in nested
subdirectories. This affects bindings in places like
dts/bindings/net/wireless, which are not found.

Fix it by using recursive=True in the glob.glob() call.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-07-16 16:31:30 -05:00
Gerard Marull-Paretas
328e842043 doc: scripts: gen_devicetree_rest: add workaround for page width
Since Zephyr docs switched to fixed-width, the binding pages are not
displayed correctly. We should move to another data representation
format that works better for fixed-width documents. Until this decision
is made, add a workaround that forces the template to expand page width
to the maximum on binding pages.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-06-02 12:13:13 -05:00
Gerard Marull-Paretas
5738114df2 doc: scripts: gen_devicetree_rest: use utf-8 encoding
Use utf-8 encoding when opening vendor prefix files.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-20 03:07:44 -05:00
Martí Bolívar
5332847644 dts: separate DT libraries from gen_defines.py
We are now in the process of extracting edtlib and dtlib into a
standalone source code library that we intend to share with other
projects.

Links related to the work making this standalone:

    https://pypi.org/project/devicetree/
    https://python-devicetree.readthedocs.io/en/latest/
    https://github.com/zephyrproject-rtos/python-devicetree

This standalone repo includes the same features as what we have in
Zephyr, but in its own 'devicetree' python package with PyPI
integration, etc.

To avoid making this a hard fork, move the code that's being made
standalone around in Zephyr into a new scripts/dts/python-devicetree
subdirectory, and handle the package and sys.path changes in the
various places in the tree that use it.

From now on, it will be possible to update the standalone repository
by just recursively copying scripts/dts/python-devicetree's contents
into it and committing the results.

This is an interim step; do NOT 'pip install devicetree' yet.
The code in the zephyr repository is still the canonical location.

(In the long term, people will get the devicetree package from PyPI
just like they do the 'yaml' package today, but that won't happen for
the foreseeable future.)

This commit is purely intended to avoid a hard fork for the standalone
code, and no functional changes besides the package structure and
location of the code itself are expected.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-04-02 08:28:12 -05:00
Gerard Marull-Paretas
3282cf8ef2 doc: move scripts to _scripts
Move Sphinx related content to folders with underscore prefix.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-03-31 10:39:48 +02:00
Renamed from doc/scripts/gen_devicetree_rest.py (Browse further)