Commit graph

45433 commits

Author SHA1 Message Date
Peter A. Bigot b7639551ee drivers: add infrastructure for regulator devices
This PR follows Linux in defining devicetree content for generic
voltage and current regulators, and an initial driver API for
controlling them.

A regulator itself may depend on a power source, so it needs to
support the properties that enable that power source.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-10-28 15:22:53 +01:00
Peter Bigot 6d3859aece devicetree: add properties for power supply control
Provide a common set of properties for various ways of controlling
power:
* supply-gpios for a GPIO specifier acting like a switch
* vin-supply for a reference to a regulator device

Document the behavior expected when these properties are present.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-10-28 15:22:53 +01:00
Lingao Meng 5374245dd6 Bluetooth: Mesh: split prov.c into two separate modules
Currently all provisioning procedure into common source
files call `prov.c`, that will not compile separately.

Add `BT_MESH_NODE` to control whether nodes are supported
and device provisioning is supported, this will be used in
provisioner role.

Add more provisioner OOB authentication method.

Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
2020-10-28 12:53:09 +02:00
Emil Hammarstrom d3a856289b net: offload: fix k_timeout_t translation in net_offload
Previously blocking calls would be translated to
non-blocking calls.

Signed-off-by: Emil Hammarstrom <emil.hammarstrom@assaabloy.com>
2020-10-28 09:30:53 +02:00
Ioannis Glaropoulos 792bec2be8 boards: arm: remove non-existing doc link from partition definitions
In the flash partition definitions for ARM boards,
the link to the legacy partition macros does not
exist any more. The commit cleans up the partition
definition by removing this link.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-10-27 15:01:19 -04:00
Eugeniy Paltsev 1ae2b7cad9 doc: add missing setup documentation for ARC MWDT toolchain
ARC MWDT toolchain setup documentation was missing on upstreaming.
Fix that.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2020-10-27 16:41:36 +01:00
Simon Glass 1545cebff3 doc: emulator: Add basic documentation
Add some basic documentation for Zephyr emulators. This is expanded
from https://github.com/zephyrproject-rtos/zephyr/issues/27531 and
recent commits.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass f28a98be8c tests: drivers: sensor: Test both I2C and SPI accelerometer
Now that we have a BMI160 driver and emulator pair that support both
I2C and SPI, add a test that runs over both buses.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass 20116f0fdf emul: spi: bmi160: Add support for I2C
At present this emulator only supports SPI. Add support for I2C as
well.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass 0b1a7d109d drivers: sensor: bmi160: Add support for I2C
At present this driver only supports SPI. Add support for I2C as well,
following the model of BME280.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass f4ef4daa8a emul: spi: bmi160: Prepare to support I2C
At present this driver only supports SPI. Refactor it so that SPI is
just one of the options. This does not change any functionality.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass fa90b5c243 emul: spi: bmi160: Move to top-level directory
This emulator currently only supports SPI. Before making it also
support I2C, move it up a directory to avoid I2C uses missing it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass 0de655e371 drivers: sensor: bmi160: Prepare to support I2C
At present this driver only supports SPI. Refactor it so that SPI is
just one of the options. This does not change any functionality.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass e43c181934 emul: spi: emul_bmi160: Move logging to access functions
Move the logging for transactions to the functions that actually access
registers and sample data. This avoids needed to repeat this code when
I2C starts calling these functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass c953c32cbd emul: spi: emul_bmi160: Rename 'spi' to 'bus'
Update the language to refer to a bus instead of SPI. This will make it
more applicable with I2C support is added.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass 1f1f695ae2 drivers: sensor: bmi160: Rename 'spi' to 'bus'
This member holds the SPI bus pointer. Change its name to make that
more obvious and so that it can be used for an I2C bus also.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass 28f8ddae0b drivers: sensor: bmi160: Use only one read/write function
At present there are three separate read functions and two write
functions. This makes it harder to provide an interface that can work
with either SPI or I2C.

Use bmi160_read() for all reads and create a new bmi160_write()
function for all writes.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass 226cacbc3d drivers: sensor: bmi160: Move SPI config to config
At present this driver only supports a single instance. It sets up some
of its config in the init routine. It is better to put config in
constant data so that multiple instances can be supported and RAM space
is minimised.

Update the driver accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass 57fdcd4018 drivers: sensor: bmi160: Use 'data' for the data pointer
Currently a 'bmi160' pointer is used to point to the driver data. This
confusing, as the driver uses both data and config. Rename the variable
to 'data' like the bme280 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass a32f87b1e0 drivers: sensor: bmi160: Define accessors for the bmi160
Add inline functions to obtain the data and configuration.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass c3823b9144 drivers: sensor: bmi160: Shorten the structs a bit
This driver uses verbose names for the config and data structures, which
makes it harder to see which one we are talking about. Shorten it, like
the bme280 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Torsten Rasmussen ad78766139 cmake: dts: getting realpath for system includes for dts.
Fixes: #28893

Now using get_filename_component(REALPATH) to ensure full path with
symlinks and `..` resolved.

Having `..` in path causes the gcc generated dependency file to contain
`\` in path on windows. This confuses ninja.
The result is that ninja consider the file missing, and thus invokes a
CMake run to create the file, resulting in endless loop.

By ensuring that full path (containing `/` which is already ensured)
when calling gcc, then all paths will be posix style, making ninja
happy.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-10-27 16:40:19 +01:00
YouhuaX Zhu 70b3e55bd9 Test: Refine annotaion and test code for sensor subsys.
1. Add more detail info to make the purpose and process
of the test cases more clear which include test goal,
test step, input, judging criteria, constraints, etc.,
and these can be seen in our Zephyr documentations.
2. Add some negative test code.

Signed-off-by: YouhuaX Zhu <youhuax.zhu@intel.com>
2020-10-27 10:43:59 -04:00
Marcin Niestroj 5fa69327f2 drivers: modem: ublox-sara-r4: allocate in modem_cmd_handler with K_NO_WAIT
All net_bufs allocated to modem_cmd_handler's data->rx_buf are consumed
synchronously in ublox-sara-r4.c in the same thread. This means that
allocating them with timeout makes no sense, because timeout
will *always* be hit when there are no more buffers in net_buf_pool.

Get rid of the unnecessary timeout, as it doesn't help and just slows
down processing of incoming data, increasing possibility of data
overrun.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-10-27 09:32:51 -05:00
Marcin Niestroj 94caa8f2fd drivers: modem: gsm: allocate in modem_cmd_handler with K_NO_WAIT
All net_bufs allocated to modem_cmd_handler's data->rx_buf are consumed
synchronously in gsm_ppp.c in the same thread. This means that
allocating them with timeout makes no sense, because timeout
will *always* be hit when there are no more buffers in net_buf_pool.

Get rid of the unnecessary timeout, as it doesn't help and just slows
down processing of incoming data, increasing possibility of data
overrun.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-10-27 09:32:51 -05:00
Marcin Niestroj b3272f3fe8 drivers: wifi: esp: allocate in modem_cmd_handler with K_NO_WAIT
All net_bufs allocated to modem_cmd_handler's data->rx_buf are consumed
synchronously in esp.c in the same thread. This means that allocating
them with timeout makes no sense, because timeout will *always* be hit
when there are no more buffers in net_buf_pool.

Get rid of the unnecessary timeout, as it doesn't help and just slows
down processing of incoming data, increasing possibility of data
overrun.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-10-27 09:32:51 -05:00
Marcin Niestroj 318cbe649a drivers: modem: cmd_handler: rework reading from interface
So far a dedicated buffer was used for data read from modem
interface. New net_bufs were allocated and filled later, which means
that data was lost when no more net_bufs were available in the pool.

Prevent data loss by allocating net_buf before attempting any read on
modem interface. Process incoming data in a loop as long as reading from
interface results in new data. Also remove dedicated buffer
(data->read_buf) and directly fill net_buf content instead. As a side
effect there are less memory copy operations and RAM usage is reduced.

Pre-allocated net_buf is now always appended to data->rx_buf. When there
was no (more) data read from interface to such net_buf, then this empty
net_buf will be on the end of data->rx_buf fragment list. Update
skipcrlf() and findcrlf() implementations to explicitly check for each
net_buf length, instead of blindly assuming them to have at least single
byte.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-10-27 09:24:38 -05:00
Marcin Niestroj 3d659a35bb drivers: modem: cmd_handler: split cmd_handler_process() implementation
cmd_handler_process() does two major things:

 - reads data from modem interface and fills data->rx_buf,
 - processes data in data->rx_buf.

Split implementation accordingly to two separate functions, which
improves readability (less automatic variables to follow at once) and
simplifies refactoring of each action.

No functional change was intended in this commit.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-10-27 09:24:38 -05:00
Ying ming 783155ad99 test: atomic operation : add code description
The existing testcase's doxygen describes are the general
implementation idea of a function.On this basis, adding
more descriptive statements to describe which conditions need
to be preset when running the testcase, which test techniques
are applied, and describe the testcase Design steps in detail.
Make it more readable.

Signed-off-by: Ying ming <mingx.ying@intel.com>
2020-10-27 09:14:08 -04:00
YouhuaX Zhu f83041f2e8 Test: Refine annotaion and testcase for poll.
1. Add more detail info to make the purpose and process
of the test cases more clear which include test goal,
test step, input, judging criteria, constraints, etc.,
and these can be seen in our Zephyr documentations.
2. Add some negative test code.

Signed-off-by: YouhuaX Zhu <youhuax.zhu@intel.com>
2020-10-27 09:06:35 -04:00
YouhuaX Zhu 4772d40d5f Test: Refine annotaion and testcase for pipe.
1. Add more detail info to make the purpose and process
of the test cases more clear which include test goal,
test step, input, judging criteria, constraints, etc.,
and these can be seen in our Zephyr documentations.
2. Add more negative testcase.

Signed-off-by: YouhuaX Zhu <youhuax.zhu@intel.com>
2020-10-27 09:05:47 -04:00
Kumar Gala 8a8d38e054 dts: bindings: Fix duplicate description in STM32 DMA bindings
The DMA bindings had duplicate description: keys.  Merge the two
descriptions into one to fix the issue.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-10-27 07:56:20 -05:00
Meng xianglin 91dea98c5e test: power: run test case on more platforms
remove "platform_allow" to enable test case run on more platforms,
only a few archs and platforms are excluded.

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2020-10-27 08:41:34 -04:00
Fabio Utzig ab9602d401 doc: allow macro resolving in \deprecated usage
Breathe>=4.23.0 renders \xrefitem, including its specializations like
\deprecated, so add the proper `()` to symbols existing in previously
declared \deprecated messages so they are properly resolved.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-10-27 13:09:24 +01:00
Fabio Utzig c8dfc3de3c doc: remove anon union/struct from known issues
Previous Breathe versions had issues parsing anonymous unions/structs
which was fixed recently, so those can be removed from .known-issues.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-10-27 13:09:24 +01:00
Fabio Utzig 8cd7ed1980 doc: bump breathe requirement to >=4.23.0
Breathe>=4.23.0 brings in basic xrefitem rendering support and fixes
issues parsing anonymous struct/unions. This version also adds a config
knob for showing or hiding enumerator values, so set it to generate
documentation compatible with previous versions.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-10-27 13:09:24 +01:00
Torsten Rasmussen 90f56dbabf cmake: extend target_ld_options() to support grouping of flags
Fixes #28456

This commit extends `target_ld_options()` with a NO_SPLIT flag.

Specifying `NO_SPLIT` will ensure that all linker flags will be applied
together when testing the compiler and linker.
This allows a caller to ensure that flags are tested together.

This fixes the RISC-V case where the flags `-mabi` and `-march` were
omitted because they were tested individually.

Note, the update of `target_ld_options()` will allow the same flag on
`zephyr_ld_options()`

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-10-27 13:09:02 +01:00
Andrzej Puzdrowski 5bac6234aa changelog: MCUBoot changes
Added changelog for changes introduced by
latest MCUBoot upgrade.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-10-27 12:52:41 +01:00
Andrzej Puzdrowski 67be2ea0fc manifest: synch MCUBoot to upstream c625da4
MCUBoot was synchronized up to:
https://github.com/JuulLabs-OSS/mcuboot/commit/c625da4

- Removed the flash_area_read_is_empty() port implementation
function
- Added watchdog feed on nRF dvices.
See CONFIG BOOT_WATCHDOG_FEED option.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-10-27 12:52:41 +01:00
Andrzej Puzdrowski 508c0356ab doc/reference/peripherals/flash: extract internal API doc
Divided doxygen API documentation into zephyr-internal API and
user API.
This make sense as user shall not use zephyr-internal API.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-10-27 12:52:07 +01:00
Andrzej Puzdrowski 0b50839c7d doc/reference: Added clarification on flash offset relation
Added information about that offsets are expressed in relation to
the flash memory beginning address.

This info was missing which cause misunderstanding of the concept
while contributing.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-10-27 12:52:07 +01:00
Viktor Sjölind 1b3abc096c net: lwm2m: Start notify sequence numbers on 0
Some LWM2M backends/servers, such as emxq, expect the sequence numbers
to begin on 0.

This change is in line with how other lwm2m clients, such as Anjay and
Wakama, starts the notification sequence.

Signed-off-by: Viktor Sjölind <viktor.sjolind@endian.se>
2020-10-27 11:25:22 +02:00
Maciej Perkowski 060e00d9c5 sanitycheck: Add checking of zephyr version
Adds function checking the version of zephyr, used for reporting

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-10-26 14:19:34 -04:00
Maciej Perkowski 725d19b79e sanitycheck: Add info about zephyr version to the xml reports
This commit adds posibility to save zephyr version in the xml reports.
It adds 'properties' attribute to testsuite attribute. 'properties'
can contain multiple 'property' attributes. Zephyr version is added
as such 'property'.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-10-26 14:19:34 -04:00
Vinayak Kariappa Chettimada b3c9565891 Bluetooth: controller: Remove redundant condition compile
Remove a redundant condition compile.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-26 17:40:08 +01:00
Vinayak Kariappa Chettimada c74438cdfa Bluetooth: controller: Fix arguments unused without Extended Scanning
Fix arguments unused when not enabling Extended Scanning
which was introduced in
commit 0cef1e43c9 ("Bluetooth: controller: Extended
Scanning Coded PHY duration and period").

Fixes #29442.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-26 17:40:08 +01:00
Steve Winslow 4143d79498 samples: smp: pi: Fix path in build instructions
This fixes the documentation instructions for building the SMP Pi
sample program, which incorrectly listed an underscore instead of
a path separator slash.

Signed-off-by: Steve Winslow <steve@swinslow.net>
2020-10-26 17:25:37 +01:00
Jukka Rissanen c0d636aedf samples: net: echo-server: Set handler thread name
It is useful to see the name of the handler thread for debugging
purposes so set it when starting the handler thread.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-10-26 11:03:03 -05:00
Jukka Rissanen a1b0a98fbf net: context: Add locking to IPv6, CAN and packet socket bind
The commit 93e5181f ("net: context: Add locking for concurrent
access") added net_context locking to only IPv4 sockets.
That is not enough and we need locking also to other supported
socket address families like IPv6, SocketCAN and packet socket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-10-26 11:03:03 -05:00
Kumar Gala 1928428f19 ci: Add some disk usage reporting
Add some disk reporting to try and help debug random failures due to
disk space being used up.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-10-26 10:24:13 -05:00