Add dt_node_parent kconfig function, to get parent path for a given
devicetree path when parsing kconfig files
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Aside from base properties (maybe for documentation purposes),
`required: false` should not be encouraged.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL and
DT_CHOSEN_ZEPHYR_ENTROPY_LABEL were deprecated a couple of releases ago,
so it is time to remove them. Note that the zephyr/devicetree/zephyr.h
is also removed, since both macros were its last content.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The sysbuild documentation refers to CMakeLists.txt which can lead the
user to believe this call can be added to the <sample>/CMakeLists.txt
file.
This file is sourced as part of the Zephyr CMake build and not sysbuild
CMake build.
Therefore change the description to sysbuild.cmake.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit introduces the possibility of a sample to locate
configuration files for extra images that are used when building with
MCUboot.
This allows use-cases where a sample, A, want to include MCUboot but has
adjustments to the default MCUboot configuration.
By adding a Kconfig fragment `<sample>/sysbuild/mcuboot.conf`, then that
fragment will be used together with the default configuration for
MCUboot.
It is also possible to completely replace the MCUboot configuration.
This is done by creating `<sample>/sysbuild/mcuboot/` folder.
This folder will then be used as the `APPLICATION_CONFIG_DIR` when
building MCUboot.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Support referencing module directories by name in CONF_FILE,
OVERLAY_CONFIG, and DTC_OVERLAY_FILE so that projects can reference
overlay files in arbitrary modules.
Verified by passing all the following tests:
./scripts/twister -T tests/cmake/overlays/
Fixes#41830
Signed-off-by: Gregory Shue <gregory.shue@legrand.us>
Follow up to 5b5aa6ebba adding model name
and existence macros for all compatibles of a node that match an entry
in vendor prefixes.
Signed-off-by: Maureen Helm <maureen.helm@intel.com>
Add a new set of helpers for expanding property entries with a
separator. These macros complement DT(_INST)FOREACH_PROP_ELEM(_VARGS) by
adding the capability to expand with a custom separator between property
entries. This allows, in some cases, to re-use existing macros (e.g.
DT_PROP_BY_IDX) without creating an auxiliary macro that just appends a
separator. Example:
```dts
n: node {
...
my-gpios = <&gpioa 0 GPIO_ACTIVE_HIGH>,
<&gpiob 1 GPIO_ACTIVE_HIGH>;
};
```
Before:
```c
#define GPIO_DT_SPEC_BY_IDX_AND_COMMA(node_id, prop, idx) \
GPIO_DT_SPEC_BY_IDX(node_id, prop, idx),
struct gpio_dt_spec specs[] = {
DT_FOREACH_PROP_ELEM(DT_NODELABEL(n), my_gpios,
GPIO_DT_SPEC_BY_IDX_AND_COMMA)
};
```
After:
```c
struct gpio_dt_spec specs[] = {
DT_FOREACH_PROP_ELEM_SEP(DT_NODELABEL(n), my_gpios,
GPIO_DT_SPEC_BY_IDX, (,))
};
```
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit updates the outdated links to the Kconfig documentation in
the Linux kernel repository with those from the official documentation.
Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
Use inline literals where applicable -- especially for the words that
contain `@`; otherwise, Sphinx will think it is an email address.
Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
Commit 6e9a43be79 ("doc: move DTS under Build/Configuration systems
section") made it so that the internal organization of the API
reference page is no longer visible to users. This means users have to
scroll around looking for macros they need, instead of being able to
look for a section that looks relevant and reading just that.
Fix it by restoring the independent toctree for DT reference material
with an appropriate maxdepth, and adding a local table of contents in
the reference page.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
For a single bus that supports multiple protocols, e.g. I3C and I2C,
the single value "bus:" setting is no longer sufficient, as a I3C bus
cannot be matched to a device having "on-bus: I2C". This commit
extends the "bus:" setting so that it can accept a list of values.
This change allows corresponding devicetree macros to be generated
so that DT_ON_BUS() can work properly in this scenario.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Adds vendor name and existence macros for all compatibles of a node that
match an entry in the vendor prefixes file.
Signed-off-by: Maureen Helm <maureen.helm@intel.com>
It is frequent to see in Devicetree code constructs like:
```c
#define NAME_AND_COMMA(node_id) DT_NODE_FULL_NAME(node_id),
const char *child_names[] = {
DT_FOREACH_CHILD(DT_NODELABEL(n), NAME_AND_COMMA)
};
```
That is, an auxiliary macro to append a separator character in
DT_FOREACH* macros. Non-DT API, e.g. FOR_EACH(), takes a separator
argument to avoid such intermediate macros.
This patch adds DT_FOREACH_CHILD_SEP (and instance/status okay/vargs
versions of it). They all take an extra argument: a separator. With this
change, the example above can be simplified to:
```c
const char *child_labels[] = {
DT_FOREACH_CHILD(DT_NODELABEL(n), DT_NODE_FULL_NAME, (,))
};
```
Notes:
- Other DT_FOREACH* macros could/should be extended as well
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Allow for having array types (array, uint8-array, string-array) be const.
This would allow for something like:
properties:
reg-names:
const: ["foo", "bar"]
To be supported.
Renamed function _check_prop_type_and_default to _check_prop_by_type
as part of this change and Moved the check for 'const' types into
_check_prop_by_type as its similar to the prop_type check and it was
easier to implement in _check_prop_by_type as we already extract
prop_type from the option in that function.
Signed-off-by: Kumar Gala <galak@kernel.org>
Many device pointers are initialized at compile and never changed. This
means that the device pointer can be constified (immutable).
Automated using:
```
perl -i -pe 's/const struct device \*(?!const)(.*)= DEVICE/const struct
device *const $1= DEVICE/g' **/*.c
```
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Update the documentation on the files in the two zephyr cmake packages
we have in tree to remove references to obsolete files, and add
references to missing files.
Fixes: #48047
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Removes references to the label property in devicetree, replacing
them with node label where appropriate.
Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
The examples showing how to include an extra Zephyr project into the
build wrongly used `BUILD_ALWAYS True`.
The `ExternalZephyrProject_Add()` already adds this flag implicit to
ensure Zephyr based projects are always built correctly.
Thus remove the flag in the doc example as it is wrong and causes CMake
error if users tries to pass on this flag.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The phrasing "default y that comes on a later definition" was a bit
confusing to me. Clarified it by adding some examples.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Introduce zephyr,keyboard-scan chosen node property to point to the
node that implements the default KSCAN device. This is similar to
the zephyr,display property.
We switch over the samples to utilize the new property instead of
kscan0 alias.
Signed-off-by: Kumar Gala <galak@kernel.org>
This is this initial sysbuild guide on what sysbuild is and how to build
a sample using sysbuild.
It provides an architectural overview of sysbuild.
Descriptions on how to use `west build` or `cmake` + `ninja` to build
projects with the sysbuild infrastructure.
Flashing is described through the use of `west flash`.
Extending sysbuild with additional Zephyr based applications are
described, and reference to CMake documentation for including non-Zephyr
based applications are provided.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Because the fixup files do not exist anymore, stop using "unfixed"
naming in favor of "generated".
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Devicetree fixup files existed previous to the current stable Devicetree
API. While they served their purpose, they are no longer necessary nor
used in-tree. This patch drops support for this legacy feature.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Move from using Kconfig GDBSTUB_SERIAL_BACKEND_NAME to a devicetree
chosen property ("zephyr,gdbstub-uart"). This is similar to a number
of other functions like "zephyr,shell-uart" or "zephyr,bt-uart".
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Move from using Kconfig OSDP_UART_DEV_NAME to a devicetree
chosen property ("zephyr,osdp-uart"). This is similar to a number
of other functions like "zephyr,shell-uart" or "zephyr,bt-uart".
Changed the integration platform for the osdp samples to
stm32_min_dev_black as it already has zephyr,osdp-uart set.
Signed-off-by: Kumar Gala <galak@kernel.org>
Try to make the section which contains rules for upstream bindings
clearer. I'm having trouble getting people to do the right thing even
when referring to this section during code reviews, which makes me
think the docs need to be more explicit and contain more examples.
Clean up some section titles while I'm here.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Split the API docs on chosen nodes from the reference table of
zephyr-specific chosen nodes. They are related but logically different
and I often want to link to just the table, while skipping the API.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This has been removed in:
b710177a27 west: commands: build: Specify source dir without a flag
and hidden from the help, drop it from the documents to avoid confusion.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Move from using Kconfig TRACING_BACKEND_UART_NAME to a devicetree
chosen property ("zephyr,tracing-uart"). This is similar to a number
of other functions like "zephyr,shell-uart" or "zephyr,bt-uart".
Signed-off-by: Kumar Gala <galak@kernel.org>
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move from using Kconfig NET_PPP_UART_NAME to a devicetree chosen
property ("zephyr,ppp-uart"). This is similar to a number of other
functions like "zephyr,shell-uart" or "zephyr,bt-uart".
As part of this we rework the init code a little to use
DEVICE_DT_GET for the modem gsm-ppp case.
Signed-off-by: Kumar Gala <galak@kernel.org>
It is a general recommendation to use lowercase characters and dashes
in property names instead of uppercase and underscores. Make this a
formal rule for upstream Zephyr bindings.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Move the application types descriptions from the CMake documentation
section to the application development one, to give them visibility
and also because they application development chapter is a better home
for them.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add dt_chosen_has_compat kconfig helper function. This function checks
if a given `chosen` node has a provided compatible string in its
compatible list. Returns "y" if compatible string is present, and "n"
otherwise.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>