Commit Graph

49578 Commits

Author SHA1 Message Date
Jukka Rissanen b8d4d9bcec net: dhcpv4: The client needs info about network interfaces
DHCPv4 client code needs to know information when network
interfaces are going down and up. So make sure that network
management config options are enabled in that case.

Fixes #33137

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-11 12:24:10 +02:00
Martí Bolívar ffadff947c .github: doc-build: use west 0.10.0a1
Testing for the release itself.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-11 11:08:25 +01:00
Martí Bolívar d494ee4fb2 doc: west: 0.10.0 and 0.9.1 release notes
Combining these since they are related.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-11 11:08:25 +01:00
Martí Bolívar 287ff22106 doc: west: bump 'manifest: version:' docs
Adjust these for 0.10. This version parses differently as a string vs.
as a float. Document that quoting the value avoids the issue. Make
some other adjustments and improvements for clarity.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-11 11:08:25 +01:00
Marc Herbert 0d8a2bc820 doc: west: submodule 'name' is optional after west 0.9.0
See west commit 02444d058335

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-11 11:08:25 +01:00
Martí Bolívar 11f62ec49d doc: west: touch up remotes documentation
Try to make it a bit clearer.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-11 11:08:25 +01:00
Martí Bolívar 86990a7d9e doc: west: projects list is optional in v0.10
Document this fact.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-11 11:08:25 +01:00
Martí Bolívar 1f813bc7a3 doc: west: document west 0.10 group-filter + import behavior
The west 0.9 documentation for group-filter states:

    Only the top level manifest file’s manifest: group-filter:
    value has any effect. The manifest: group-filter: values in any
    imported manifests are ignored.

This turns out to have been a mistake, because all users who import a
manifest which makes some projects inactive will have to also manually
disable the same groups just to get the same default list of projects.

Example manifest fragments showing the issue:

   # my/west.yml
   manifest:
     projects:
       - name: upstream
         import: true

and:

   # upstream/west.yml
   manifest:
     group-filter: [-disabled-group]
     projects:
       - name: i-want-this
       - name: i-do-not-want-this
         groups:
         - disabled-group

As written, my/west.yml will include 'i-do-not-want-this' as an
active project.

This kind of leaky faucet has proven to be an unintuitive and poor
user experience. Users expect to get the default projects without
having to copy the group-filter for everything they import.

We can't reverse this behavior without pushing out a new schema
version, however: manifest schema 0.9, and therefore west 0.9.x, is
doomed to this bad behavior.

What we'll do to move past this is create a new schema version 0.10
that does the right thing, document the 0.10 behavior, and discourage
combining these two features in west 0.9.x.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-11 11:08:25 +01:00
Martí Bolívar 42df0ad925 doc: west: clean up manifest import details
Move the content related to handling imports that refer to multiple
files handled to right after the ordered list which defines the order
that manifests are imported. The current placement at the end of this
docs section was poorly chosen.

Create subsections for how projects and extensions are decided in the
final resolved manifest.

The project revisions in the top level example manifest fragment are
not important here. Remove them for clarity.

The top level manifest file need not be named west.yml now; adjust
accordingly.

This is prep work for adding a new subsection for group-filter.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-11 11:08:25 +01:00
Martí Bolívar 87c9c0cb2c doc: west: fix incorrect docs related to imports
The documentation suggests that 'west update PROJECT' can be done if
PROJECT is defined from some imported manifest. That's actually not
true. Fix it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-11 11:08:25 +01:00
Martí Bolívar 5f8de51aed doc: west: move 'manifest imports' to bottom of manifest.rst
This diff is deceptively complicated. No text is being added or
removed; the only thing that's being done is that the entire 'Manifest
Imports' section is being moved down below the groups and submodules
sections.

This is prep work for a later commit which will document revised
semantics for mixing 'import' with 'group-filter'. This will make
'group-filter' values compose across imports, so it will be useful to
have documentation for group and group-filter before documentation for
imports. That will let us document the way they work together within
the 'Manifest Imports' section without using concepts that haven't yet
been defined.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-11 11:08:25 +01:00
Krzysztof Chruscinski 9966d85c0a lib: os: cbprintf: Add alignment check to cbprintf_package
Added validation of alignment to cbprintf_package. Error is returned if
input buffer is not aligned to the largest argument.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-11 09:54:39 +01:00
Krzysztof Chruscinski a92214b8f4 tests: lib: cbprintf_package: Extend to test static packaging
Extend test to validate cbprintf static packaging on various
platforms.

Added more test configurations: complete, nano, long double.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-11 09:54:39 +01:00
Krzysztof Chruscinski f94689204c tests: unit: cbprintf: Extend to test static packaging
Extended test suite to test static packaging, too.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-11 09:54:39 +01:00
Krzysztof Chruscinski 47a565367e lib: os: cbprintf: Add static packaging
Extend cbprintf with static packaging.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-11 09:54:39 +01:00
Diwakar C ddfb1316ee driver: peci: Add supported peci response codes
Add supported peci response codes 0x80 (Out of resources timeout)
and 0x81 (Resources required to service the command are in low
power state).

Signed-off-by: Diwakar C <diwakar.c@intel.com>
2021-03-10 17:12:05 -05:00
Martí Bolívar f5409dec01 scripts: edtlib: do not inherit parent compatibles
Commit 0d4dca10b2 ("scripts: edtlib:
child binding compatibles match parents") was a hack meant to keep the
edtlib.Binding class in place without modifying some twister behavior
that needed further changes to work properly with first-class binding
objects.

This is a hack and is no longer necessary, so back out of this change.

Child Binding objects now have None compatible properties unless the
binding YAML explicitly sets a compatible.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-10 15:09:09 -05:00
Martí Bolívar 963b1666f3 doc: release-notes-2.6: document deprecated twister filter
Document dt_compat_enabled_with_alias's replacement,
dt_enabled_alias_with_parent_compat().

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-10 15:09:09 -05:00
Martí Bolívar 51f55b437f twister: replace dt_compat_enabled_with_alias filter
Originally added in 7733b94224.

This filter is not well-formed. It's meant to match nodes like
/leds/led_0 in this DTS:

/ {
	aliases {
		led0 = &led0;
	};

	leds {
		compatible = "gpio-leds";
		led0: led_0 {
			gpios = <...>;
			label = "LED 0";
		};
	};
};

Uses look like this:

    filter: dt_compat_enabled_with_alias("gpio-leds", "led0")

But notice how the led_0 node doesn't have compatible "gpio-leds";
it's actually the *parent* node that has that compatible.

Replace this with a new filter, dt_enabled_alias_with_parent_compat(),
which is used like this:

    filter: dt_enabled_alias_with_parent_compat("led0", "gpio-leds")

This has a name and argument order that makes the meaning of the
filter clearer.

Replace in-tree users with the new filter.

Deprecate the old filter and warn about its use using the standard
logging module.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-10 15:09:09 -05:00
Martí Bolívar d802fc3bf0 scripts: twister: sort expr_parser.py imports
Just tidying up.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-10 15:09:09 -05:00
Vinayak Kariappa Chettimada 0fbf31a147 Bluetooth: controller: Fix auxiliary PDU disable
When Extended Advertising terminated due to duration or
maximum number of events, the auxiliary PDU scheduling
is now correctly stopped.

Fixes #31254.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-10 15:08:47 -05:00
Vinayak Kariappa Chettimada 5b7f4d19bb Bluetooth: controller: nRF5: Move HAL_RADIO_PDU_LEN_MAX into radio_nrf5
Move the define HAL_RADIO_PDU_LEN_MAX into radio_nrf5.h in
the HAL folders.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-10 15:08:31 -05:00
Vinayak Kariappa Chettimada 1643b9453b Bluetooth: controller: nRF: Ensure HAL_RADIO_PDU_LEN_MAX is defined
Add compiler error if HAL_RADIO_PDU_LEN_MAX is not defined.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-10 15:08:31 -05:00
MORGER Patrick 986bb53135 dts: arm: stm32g4: Add i2c4
Add DTS configuration for i2c4.

Signed-off-by: MORGER Patrick <patrick.morger@leica-geosystems.com>
2021-03-10 14:57:22 -05:00
Robert Lubos 6a90baa21a net: lwm2m: Make validation cb support optional
Add option to disable validation callback support by setting the
validation buffer size to 0, which allows to save some memory in case
it's not needed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-10 14:55:22 -05:00
Robert Lubos d9c7214fab samples: net: lwm2m_client: Add an example use of the validation cb
Add an example usage of the validation callback to the lwm2m_client
sample.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-10 14:55:22 -05:00
Robert Lubos 31e5ec79b8 net: lwm2m: Add data validation callback
Add a data validation callback to the resource structure, which can be
registered by an application. It allows to verify the data before
actually modifying the resource data.

If the callback is registered for a resource, the data is decoded into a
temporary buffer first, and only copied into the actual resource buffer
if the validation is successfull. If no validation is required (and thus
no callback registered) the resource value is decoded directly into the
resource buffer, as it used to be.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-10 14:55:22 -05:00
Carlo Caione 6f5a1529d4 test: mem_map: Fix compilation by removing __test_mem_map_size
This is the same problem as seen for #32053. Refer to that for the
details and propose a similar fix.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-10 14:55:01 -05:00
Paul Sokolovsky e031693e37 net/ip/tcp2_priv.h: th_off: More detailed docstring
Mention that it's "data offset" in 32-bit words. Helpful when doing
code review and using search for "th_off".

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2021-03-10 14:53:28 -05:00
Jukka Rissanen 51beb28ac9 modules: civetweb: Add proper dependency to Kconfig
Make sure that CONFIG_NET_TCP_ISN_RFC6528 is not set when compiling
Civetweb. There are compile issues in Civetweb if both mbedtls and
POSIX API option are set, and this happens if the TCP ISN option is
enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-10 14:53:15 -05:00
Carlo Caione dacd176991 aarch64: userspace: Implement syscalls
This patch adds the code managing the syscalls. The privileged stack
is setup before jumping into the real syscall.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-10 14:52:50 -05:00
Nicolas Pitre f2995bcca2 aarch64: arch_buffer_validate() implementation
This leverages the AT (address translation) instruction to test for
given access permission. The result is then provided in the PAR_EL1
register.

Thanks to @jharris-intel for the suggestion.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-03-10 14:52:50 -05:00
Carlo Caione 9ec1c1a793 aarch64: userspace: Introduce arch_user_string_nlen
Introduce the arch_user_string_nlen() assembly routine and the necessary
C code bits.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-03-10 14:52:50 -05:00
Carlo Caione a7a3e800bf aarch64: fatal: Restrict oops-es when in user-mode
User mode is only allowed to induce oopses and stack check failures via
software-triggered system fatal exceptions.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-10 14:52:50 -05:00
Carlo Caione 6978160427 aarch64: userspace: Introduce arch_is_user_context
The arch_is_user_context() function is relying on the content of the
tpidrro_el0 register to determine whether we are in user context or not.

This register is set to '1' when in EL1 and set back to '0' when user
threads are running in userspace.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-10 14:52:50 -05:00
Carlo Caione 6cf0d000e8 aarch64: userspace: Introduce skeleton code for user-threads
Introduce the first pieces needed to schedule user threads by defining
two different code paths for kernel and user threads.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-10 14:52:50 -05:00
Carlo Caione a7d3d2e0b1 aarch64: fatal: Add arch_syscall_oops hook
Add the arch_syscall_oops hook for the AArch64.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-10 14:52:50 -05:00
Carlo Caione c559591380 aarch64: stack: Rework memory stack allocations
Introduce the necessary macros and defines to have the stack regions
correctly aligned and sized.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-10 14:52:50 -05:00
Lauren Murphy d88ce65463 kernel/sched: only send IPI to abort thread if hardware supports it
Wrap arch_sched_ipi() call in z_thread_abort() with ifdef checking for
hardware support of IPI.

Fixes #32723

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-03-10 14:27:33 -05:00
peng1 chen e31547dc96 qspi_testcase: modify the value used to check whether qspi is enabled
if qspi mode is enabled, the status register will be like xxxxxx1x,
so we should compare with value 2 to check whether qspi mode
is enabled successfully.

Signed-off-by: peng1 chen <peng1.chen@intel.com>
2021-03-10 14:26:00 -05:00
Peter Bigot 5506727bde bluetooth: mesh: update heartbeat subscription work API
Replace the legacy delayed work API with the new delayable work API.
Avoid cancelling work and manually notifying when the subscription is
disabled; instead allow the work item to do this.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-03-10 20:47:02 +02:00
Peter Bigot 6a097caa22 bluetooth: mesh: update heartbeat publish work API
Replace the legacy delayed work API with the new delayable work API.
Use a zero period as a flag value to ensure that the work handler is a
no-op of the publish operation is disabled.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-03-10 20:47:02 +02:00
Peter Bigot 17831b045f bluetooth: mesh: settings: update k_work API
Switch to new work API, taking advantage of the difference between
schedule and reschedule to force an update if the new deadline is
sooner, and retain any previous deadline (or use the new deadline) if
it isn't.  Do not leave a path out that could, due to races, fail to
schedule necessary work.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-03-10 20:45:13 +02:00
Siddharth Chandrasekaran 28c823b16e mgmt/osdp: Fix coverity identified logical dead-code
A previous check and return for (maxlen <= 0) makes manlen at least 1 so
checks for (maxlen < 1) would never evaluate to true. Remove these
checks and merge those cases into one.

CID: 215392
Fixes: #33092
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2021-03-10 10:15:48 -05:00
Siddharth Chandrasekaran a871f00726 mgmt/osdp: Fix coverity identified off-by-one
Fix a coverity identified, off-by-one, out-of-bound array access at
pd->cap[].

CID: 215379
Fixes: #33095
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2021-03-10 10:15:48 -05:00
Jukka Rissanen 6526b5b232 samples: net: civetweb: Avoid using mbedtls
Civetweb does not work properly with mbedtls if Posix APIs
are enabled. For example time function prototypes are not found
by the mbedtls module if we enable mbedtls in the sample.

Disable TCP ISN RFC6528 support because of this for civetweb
samples, as setting that option will pull in mbedtls and
we get a compilation warning because time() is not declared
by any header file that mbedtls is including.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-10 16:08:46 +01:00
Jukka Rissanen d8d5179c00 net: tcp2: Fix mbedtls missing warnings
If CONFIG_NET_TCP_ISN_RFC6528 is disabled, then mbedtls include
files are not available so check this.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-10 16:08:46 +01:00
Peter Bigot 81b9ba3a9b bluetooth: mesh: health_srv: update k_work API
Switch to new work API.  Avoid a racy cancel by allowing the work
handler to deal with an immediate off when the time remaining changes
to zero.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-03-10 15:18:10 +02:00
James Harris 4e1926d508 arch: aarch64: do EL2 init in EL3 if necessary
If EL2 is implemented but we're skipping EL2, we should still
do EL2 init. Otherwise we end up with a bunch of things still
at their (unknown) reset values.

This in particular causes problems when different
cores have different virtual timer offsets.

Signed-off-by: James Harris <james.harris@intel.com>
2021-03-10 06:50:36 -05:00
Armando Visconti de707b6870 drivers/sensor: iis2iclx: fix multi-instance using new helpers
This commit simplifies the Device Tree configuration by using
the new helpers introduced in #30536.

In particular:
    - get bus devices with DEVICE_DT_GET
    - get SPI information with SPI_CONFIG_DT_INST

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-03-10 06:11:45 -05:00