Commit graph

99049 commits

Author SHA1 Message Date
Joakim Andersson
65b3f17aa9 Bluetooth: controller: Fix initialization of rl_idx and rpa_gen
The privacy state variables rl_idx and rpa_gen was not initialized
properly, which results in connection failing to be established.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-05-24 12:00:12 -04:00
Vinayak Kariappa Chettimada
b928cef69c Bluetooth: controller: split: Port h/w privacy feature
Ported h/w based LL privacy to ULL/LLL split architecture.

Fixes #14675.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-05-24 12:00:12 -04:00
Vinayak Kariappa Chettimada
c5c87c38eb Revert "Bluetooth: controller: Disable controller privacy feature"
This reverts commit c629ea8a64.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-05-24 12:00:12 -04:00
Henrik Brix Andersen
4770b1ebec boards: arm: twr_ke18f: add I2C support
Add I2C support to the NXP TWR-KE18F development board.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-05-24 09:51:10 -05:00
Henrik Brix Andersen
efa2b23fcd soc: nxp: ke1xf: add I2C support
Add support for the Low Power Inter-Integrated Circuit (LPI2C)
controllers found in the NXP Kinetis KE1xF SoC series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-05-24 09:51:10 -05:00
Kumar Gala
18ab73d02c dts: nxp: nxp_rt: Fix unit-address for usb node
The first reg of the node is 0x402E0200 so the unit address should match
that.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-24 09:47:18 -05:00
Tomasz Bursztyka
79a25a6fff net/pkt: Redefine the necessary fifo attribute
commit 79672d16 was missing the fact socket layer is putting net_pkt
into a k_fifo. However, it's on receiving side only: at this point the
k_fifo_put is using the k_work area which is then useless at this
point Thus why it did not break anything, as k_fifo only needs 4 bytes
while the k_work attribute takes 12 bytes.

Thus adding a union on the k_work attribute with another new attribute
that describes the behavior.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-05-24 14:09:11 +03:00
Andrzej Puzdrowski
2d48f4337d tests/fs/nvs: GC full round test
Added a test for testing full round GC on 3-sectors
configuration. In this case all kind off sector can
appeared so this test covers well more numerous
sectors configurations.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-05-24 11:13:59 +02:00
Radoslaw Koppel
3fd417a1c9 subsys/storage/flash_map: Fix returned error codes
Fix that removes magic numbers from the code that
leaded to the error codes that was hard to explain.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2019-05-24 11:13:41 +02:00
Marc Herbert
d1b4da96e1 extensions.cmake: don't leak absolute paths in snippets-*.ld comment
Make headers look like this instead:

     /* From ${ZEPHYR_BASE}/arch/common/isr_tables.ld: */

Besides being shorter and more "private", this makes the content of
snippets-*.ld files the same no matter who built them and where.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-05-24 11:07:59 +02:00
Marti Bolivar
8b9b7e7c8a scripts: avoid unnecessary 'west build --force'
Commit 88fb8bacfb ("scripts: improve west build's board handling")
lets us specify the board with a build.board config or BOARD
environment variable.

However, under some conditions, e.g. if the use has
build.pristine=auto and build.board=some_board, the following fails a
check_force call:

west build samples/hello_world
west build samples/philosophers

The problem is that the check_force wasn't made aware of the other
places a board can come from. Fix that.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-05-24 11:07:18 +02:00
Carles Cufi
f5f1b22c5a doc: CMake: Locate Python executable before processing modules
The module processing logic in Zephyr requires Python, since it uses a
Python script to locate and process the modules. It is therefore
required to find the Python executable using CMake before actually
including the CMake script that processes the modules. In order to
prevent this from happening again, move the inclusion of version.cmake
as well in case that script chooses to use Python in the future.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-24 11:05:04 +02:00
Carles Cufi
b73790b629 cmake: Fix path handling for ZEPHYR_BASE
With the addition of a local CMake variable ZEPHYR_BASE that mirrors the
value of the environment variable the documentation build broke on
Windows. This is because CMake was incorrectly interpreting backslashes
present in the Windows path as escaping characters. In order to avoid
this, use CMake's built-in file(TO_CMAKE_PATH) functionality, which
converts the path to a canonical version using forward slashes only.
At the same time rework boilerplate.cmake to use the same mechanism
instead of manually replacing backslashes and removing trailing ones.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-24 11:05:04 +02:00
Jakub Rzeszutko
4828dab9ca shell: add test for new built-in command
Add shell tests for newly added select command.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-05-24 11:04:42 +02:00
Jakub Rzeszutko
b633e431a4 shell: add select command
The "select" command has been implemented, which allows user to
narrow down the command tree.

This implementation differs from the "select" command available
in the legacy shell. In a new implementation, if the selected
command has a handler and if the user has not entered the
registered subcommand, the shell will call the handler of selected
command and pass the text as arguments.

This may be useful, for example, if someone wants to use the
shell as an interface to a modem that supports AT commands.
Instead of each time you write e.g:
	at at+command1
	at at+command2
	at at+command3
user can execute following commands:
	select at
	at+command1
	at+command2
	at+command3

where:
at - root command for passing at commands to the modem
at+commandX - at command passed to the modem.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-05-24 11:04:42 +02:00
Ulf Magnusson
fde86da6f5 doc: kconfig: Fix typo in documentation for 'optional' on choices
Like for other choices, it's the prompt that gets displayed within the
parentheses, not the symbol name.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-23 20:34:54 -04:00
Ulf Magnusson
e5cca102a5 doc: kconfig: Encourage dropping 'Enable ...' from most prompts
Usually, it's clear from context, and it makes things consistent.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-23 20:34:54 -04:00
Ulf Magnusson
3e69a0e465 doc: kconfig: Explain the 'menuconfig' keyword and good uses for it
Takes a while to figure out what it's there for, so explain what it does
and give an example of a good use for it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-23 20:34:54 -04:00
Ulf Magnusson
7c8bcf0772 doc: kconfig: Clarify that 'depends on' works for string/int/hex
Seems people are a bit hazy on this, so explain how it works.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-23 20:34:54 -04:00
Tomasz Bursztyka
344d4bdce0 net/arp: No need of 64bits timer precision on ARP requests
The 32bits one can hold up to about 50 days, this is more than enough
knowing that ARP request timeout is 2 seconds.

So reducing the request start time to 32bits.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-05-23 22:22:16 +03:00
Tomasz Bursztyka
79672d1647 net/pkt: Remove useless _reserved attribute
This attribute was used when net_pkt where queued into a fifo. However,
since the cove to k_work queues (due to the introduction of TC), such
attribute has been totally useless.

Removing it gains 4 bytes in net_pkt structure.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-05-23 22:22:16 +03:00
Jukka Rissanen
4bd654d8c1 samples: net: gptp: Fix compilation instructions
As the prj_base.conf was renamed to prj.conf by commit
4e5300ba7f, the documentation
needs some fixing too.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-23 22:13:11 +03:00
Jukka Rissanen
ecac10cb47 net: shell: Refactor help information for ping command
Do not always print general help for ping cmd. Only if user supplies
'-h' or '--help' command, print information about the parameters.
After this the generated HTML documentation looks better for the
ping command.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-23 22:12:23 +03:00
Jukka Rissanen
d13039f80f net: shell: Remove leading underscore from parse_args()
The leading underscore in function names should not be used
because of Misra rules.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-23 22:12:23 +03:00
Jukka Rissanen
29b55f860e net: shell: Indentation fixes for ping command
Fix the indentation of code for the ping command.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-23 22:12:23 +03:00
Piotr Zięcik
ba4eae14dd tests: test_sched_timeslice_reset: Fix slice time measurement
The time measurement based on k_uptime_delta() might be not accurate
for some values of CONFIG_SYS_CLOCK_TICKS_PER_SEC. This commit
introduces measurement based on k_cycle_get_32(), which is more
precise.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-05-23 09:28:58 -04:00
Piotr Zięcik
62c71dc4d8 tests: tickless_concept: Fix slicing time measurement
The time measurement based on k_uptime_delta() might be not accurate
for some values of CONFIG_SYS_CLOCK_TICKS_PER_SEC. This commit
introduces measurement based on k_cycle_get_32(), which is more
precise.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-05-23 09:28:58 -04:00
Piotr Zięcik
86f012d27c tests: timer_api: Fix test for SYS_CLOCK_TICKS_PER_SEC != 100
This commit changes the timer_api test in order to take under account
fact that timeouts used in the test might not be aligned to tick
boundary.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-05-23 09:28:58 -04:00
Paul Sokolovsky
563b89f90b tests: benchmarks: mbedtls: Fix printf args
As printf() is now used directly instead of printf proxy function,
there's warning-as-error that long long is passed where %lu
expected, so cast it explicitly.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-23 09:27:59 -04:00
Paul Sokolovsky
bf070716d1 tests: mbedtls: Call mbedtls_platform_set_printf() only if needed
It exists only if MBEDTLS_PLATFORM_PRINTF_ALT is defined, whcih we
no longer do, but make the call condiitonal in case we'll need to
make it configurable later.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-23 09:27:59 -04:00
Paul Sokolovsky
af529d1158 libc: minimal: Implement exit()/_exit() functions.
Behavior is similar to newlib version: print "exit" message and go
into infinite loop.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-23 09:27:59 -04:00
Paul Sokolovsky
f0ea13d2a2 ext: mbedtls: Don't define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
That means that when mbedTLS will need functions like snprintf(),
printf(), a few others, they will be used from libc, as done
normally by most of software. Note that mentioned functions
aren't normally used on code paths doing TLS communication per se.
Instead, they are used by debug logging, additional "print info"
style functions, etc.

Before, when MBEDTLS_PLATFORM_NO_STD_FUNCTIONS was defined, those
functions were stubbed out, so silently didn't work as expected
(a specific symptom seen was that some debug messages were printed
as garbage, because an buffer on stack was passed to dummy snprintf
stub, which didn't do anything to it, and its uninitialized contents
were printed afterwards. Instead, the expectation was that an
application would call a "setter" function to set snprintf, etc.
implementations as provided by application itself.

For Zephyr, we clearly don't need to burden applications with such
setup, instead Zephyr, as an OS, provides integrated environment
were matters like that "just work". So, we just switch to libc-based
functions. If there ever will be usecases for
MBEDTLS_PLATFORM_NO_STD_FUNCTIONS, it can be made configurable later.

Fixes: #16303

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-23 09:27:59 -04:00
Jan Van Winkel
6b9e160b5a sanitycheck: Execute binary in output directory
Execute the test binary from the output directory instead of directory
where sanitycheck was started.

This will ensure that any artifact created with a relative path by the
test binary will be placed in the output directory instead of creating
the artifact in the directory where sanitycheck was executed and prevent
any possible conflicts.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-05-23 08:37:09 -04:00
Radoslaw Koppel
bf7b97bdf5 subsys/ztest: Documentation fix
Documentation moved to the right place.
The argument name of the macro is aligned between the macros.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2019-05-23 08:35:06 -04:00
Brett Witherspoon
626349f16f drivers: adxl362: use burst transfer
It is recommended that multibyte (burst) transfers are used to read
acceleration and temperature data. This ensures the data is concurrent
and complete.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-23 06:55:38 -05:00
Maureen Helm
e0d7378712 boards: mimxrt1060_evk: Enable mcux lpi2c driver and pins
Enables the mcux lpi2c shim driver and pin muxes on the mimxrt1060_evk
board. Updates the board documentation and yaml supported list
accordingly.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-05-23 06:27:55 -05:00
Andrzej Głąbek
7f9f39fe3d boards: nrf52840_pca10059: Configure NFC pins as GPIOs by default
Since there is no NFC antenna connector on the dongle and the pins
P0.09 and P0.10 that are dedicated to NFC functionality are in the
group of just a few ones available for external connections, it seems
more reasonable to configure these pins by default as regular GPIOs,
as users will most likely want to use them in this way.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-05-23 07:01:05 -04:00
Wentong Wu
ec150d68e0 CODEOWNERS: Add code ownership for gen_relocate_app.py
Add myself as code owner for script gen_relocate_app.py.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-05-23 06:59:14 -04:00
Wentong Wu
cd92af1cab linker: kobject-text.ld: avoid backwards location counter
when kobject text area is greater than CONFIG_KOBJECT_TEXT_AREA,
there will be location counter backwards, change it to assert to
prompt configuring CONFIG_KOBJECT_TEXT_AREA larger.

Fixes: #16307.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-05-23 06:59:14 -04:00
Tedd Ho-Jeong An
fccb2e1ffc Bluetooth: GATT: Fix using a wrong handle
This patch fixes to use the right handle value.

Fixes #16341

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-05-23 12:31:35 +03:00
Michael Scott
a923c2f1be net: openthread: fix off-by-one error in settings offset calculation
OpenThread uses CONFIG_OT_PLAT_FLASH_PAGES_COUNT to calculate the # of
pages at the end of flash to use for storing OpenThread settings.

This calculation has an off-by-one error which sets the offset for
the storage area as 1 page of flash too low.

For example, on nRF52840:
- default setting for CONFIG_OT_PLAT_FLASH_PAGES_COUNT is 4
- flash size is 1MB (0x100000)
- flash page size is 4096 (0x1000)
- expected offset is 0xfc000

Using the current logic we get an offset of: 0xfb000

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/16339

Signed-off-by: Michael Scott <mike@foundries.io>
2019-05-23 10:47:20 +03:00
Kumar Gala
0d4290a2cb scripts/dts: Fix issue in label generation of registers
If we have something like:

       #address-cells = <1>;
       #size-cells = <0>;

       intc: ioapic@fec00000  {
	       compatible = "intel,ioapic";
	       reg = <0xfec00000 0x100000>;
       };

We should generate:

DT_INTEL_IOAPIC_FEC00000_BASE_ADDRESS_0
DT_INTEL_IOAPIC_FEC00000_BASE_ADDRESS_1

Instead we generated:

DT_INTEL_IOAPIC_FEC00000_BASE_ADDRESS
DT_INTEL_IOAPIC_FEC00000_BASE_ADDRESS_1

This was due to logic deciding if '_0' should be used not taking into
account #address-cells & #size-cells correctly.

Fixes: #16296

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-22 17:27:53 -05:00
Andrew Boie
fd49cf7d02 kernel: timeout: add syscall for runtime clk freq
If the system sets its clock frequency at runtime, this is
stored in a variable that can't be directly read by user
mode. For this case only, add a system call to fetch its
value and modify the definition of
sys_clock_hw_cycles_per_sec() to use it.

Since this is now a system call, store in a temporary variable
inside z_ms_to_ticks(). The syscall overhead only applies
when called from user mode, other contexts are completely
inlined.

Added stub syscall header for mocking framework, to get rid
of inclusion errors.

Fixes: #16238

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-05-22 23:33:55 +02:00
Kumar Gala
e541b16c54 boards: atmel: Enable hwinfo as a supported feature
Update the various board YAML files to list hwinfo as a supported
hwinfo.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-22 15:50:39 -05:00
Kumar Gala
9260561c63 dts: atmel: Fix node name for device_id
The node name for device_id was device_id@0 it should be
device_id@80a00c to reflect the first register region

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-22 15:50:39 -05:00
Jacob Siverskog
d145263691 doc: dfu: Fix module links
Link modules to their respective code directory.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2019-05-22 12:41:09 -04:00
Antony Pavlov
8245195306 dts: import vendor-prefixes.txt from linux kernel
import linux-v5.1:Documentation/devicetree/bindings/vendor-prefixes.txt

Use vendor-prefixes.txt to check vendor prefixes
used in compatible strings and property names.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-05-22 12:40:20 -04:00
Antony Pavlov
f08148e640 scripts/checkpatch.pl: fix root dir detection and enable it
Don't try to find files specific for linux kernel.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-05-22 12:40:20 -04:00
Kumar Gala
343e16026e dts: x86: shring ioapic register size to 4k
Previous the register size was 1M, technically the there are only a
small handful of registers defined in the IOAPIC, so shrinking the size
to 4k, so its as most one page large.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-22 12:38:20 -04:00
Kumar Gala
e7cc51094a dts: x86: Move ioapic node out of cpu container
The IOAPIC node shouldn't have been in the cpu container, especially
since the cpu container does:

	#address-cells = <1>;
	#size-cells = <0>;

So the reg field of the IOAPIC would be treated as 2 registers instead
of a register and size.  Move IOAPIC node out of the CPU node fixes this
issue.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-22 12:38:20 -04:00