Commit Graph

42874 Commits

Author SHA1 Message Date
Andrzej Puzdrowski 4d4455b174 include/drivers/flash: document on the unrestricted source buffers
Document unrestricted source buffer location while writing to
the flash.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-08-05 15:27:46 -04:00
Andrzej Puzdrowski 1d8cf859db include/drivers/flash: document on the unrestricted alignment of reads
Unaligned read-out capability become fact among all drivers.
Let's cut this in stone as API requirement.

fixes #16439

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-08-05 15:27:46 -04:00
Andrew Boie 039c5f62ee usb: use kernel stacks
These threads don't run in user mode. Save some memory
if userspace is enabled.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-08-05 15:21:51 -04:00
Andrzej Puzdrowski 52d3701aba manifest: update mcuboot to upmerged to upstream 1cb076c
MCUBoot was synchronized with upsteram
https://github.com/JuulLabs-OSS/mcuboot/commit/1cb076c

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-08-05 14:11:09 -05:00
Jett Rink 63283621ea ztest: clean up comments, strings, and interface
Clean up comment typos and wording for expect data functions.

Add a cast to (void *) to match convention set in expect value;
this allows the caller to avoid casting on every single call.

Signed-off-by: Jett Rink <jettrink@google.com>
2020-08-05 15:05:44 -04:00
Jett Rink 03c0990275 ztest: fix failure when exceeding mock parameter count
If you tried to use more mock parameters than were set in
CONFIG_ZTEST_PARAMETER_COUNT, you would get a random seg fault somewhere
unrelated to the mocking parameter as we would use memory past an array
bounds.

Signed-off-by: Jett Rink <jettrink@google.com>
2020-08-05 15:05:44 -04:00
Jett Rink a6e1706269 ztest: increase default mock parameter count
If one enables mocking, then they most likely want more than 1 mockable
or verifiable parameter by default. Bump the default number of mockable
parameters to 10 to handle most cases without needing to touch an
additional Kconfig option.

Signed-off-by: Jett Rink <jettrink@google.com>
2020-08-05 15:05:44 -04:00
Jeremy LOCHE 0fe6707199 drivers: clock_control: stm32h7 add HSI divisor support
Add HSI divisor support for clock tree configuration.
Removed HSI calibration trimming to comply with
common STM32 implementation and use reset default
configuration instead.

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
2020-08-05 16:22:53 +02:00
Jeremy LOCHE ea6580cdcd drivers: clock_control: stm32h7 change set flash latency
Updated flash latency setting to comply with
common stm32 implementation and datasheet.

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
2020-08-05 16:22:53 +02:00
Jeremy LOCHE f3bdf8ae91 drivers: clock_control: stm32h7 add preprocessor clock check
Adds preprocessor clock feasibility check to avoid setting
too high clocks to SYSCLK,AHB,APBx buses.

Also checks if CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
matches with the desired clock configuration by
the M7 core.

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
2020-08-05 16:22:53 +02:00
Jeremy LOCHE 63611264c4 drivers: clock_control: stm32h7 fixed inverted assertion
Fixed wrong usage of assertions.
Assertions should check that the value is in range and
not out of range.

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
2020-08-05 16:22:53 +02:00
Jeremy LOCHE a686576348 drivers: clock_control: stm32h7 fix high frequency setting
Fixes #27212 by setting the AHB/APBx dividers
prior to configuring the PLL as clock source.

Prevents going over the limits of APBx clocks when
choosing the PLL as system clock source for
high frequencies (close to 480MHz)

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
2020-08-05 16:22:53 +02:00
Kamil Kasperczyk e5c65ebe2e net: openthread: Added config for OpenThread version selection.
Config options used for selecting OpenThread stack version
were added.

Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
2020-08-05 15:20:52 +02:00
Eug Krashtan de3c5a2684 dts: arm: Add STM32F412xE chip definition
New dtsi file for STM32F412xE chips

Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com>
2020-08-05 08:11:03 -05:00
Torsten Rasmussen c9a78257b2 doc: Zephyr module build settings
This commit adds description of the build setting support in the
module.yml file.

It is described how additional board_root, soc_root, dts_root, and
arch_root can be appended to the build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-05 08:06:07 -04:00
Torsten Rasmussen 0a4b0bbb7c doc: zephyr module description restructure
This commit restructures the Zephyr module description.
It places the description of the module yaml file in a dedicated section
as this file is common to module inclusion both when using `west` and
without `west`.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-05 08:06:07 -04:00
Torsten Rasmussen 25d57ba5af modules: adding support for ROOTs definitions in zephyr/module.yml
Fixes: #25215

This commit introduces the possibility of defining ROOTs in a Zephyr
module and have it automatically appended to list of other ROOTs.
Supported with this commit:
- BOARD_ROOT
- SOC_ROOT
- DTS_ROOT
- ARCH_ROOT

In order to support this in Zephyr module files, the detection of west
has been moved to dedicated west.cmake file and included immediately
after python.cmake.

Also the inclusion of zephyr_modules.cmake has moved before first use
of BOARD_ROOT.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-05 08:06:07 -04:00
Torsten Rasmussen 14b60200bd cmake: allowing list of ARCH_ROOTs
This commit aligns ARCH_ROOT to conform to BOARD_ROOT, DTS_ROOT,
SOC_ROOT that all allows list of directories.

Also it avoid code, such as:
if(BOARD STREQUAL my_board_using_out_of_tree_arch)
  set(ARCH_ROOT some/out/of/tree/arch/path)
endif()
in application CMakeLists.txt.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-05 08:06:07 -04:00
Torsten Rasmussen bb3946666f cmake: fix include directories to work with out-of-tree arch
Include directories for ${ARCH} is not specified correctly.
Several places in Zephyr, the include directories are specified as:
${ZEPHYR_BASE}/arch/${ARCH}/include
the correct line is:
${ARCH_DIR}/${ARCH}/include
to correctly support out of tree archs.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-05 08:06:07 -04:00
Torsten Rasmussen 5f7cc8ded9 cmake: kconfig: support for multiple SOC_ROOT
This commit introduces support for multiple SOC_ROOT.

This means that additional SOC_ROOTs specified using -DSOC_ROOT as
argument to CMake will be forming a list together with ${ZEPHYR_BASE}.

This allows for greater flexibility, as developers can now specify
multiple out-of-tree SoCs and not worry about the SoC used for the
board they compile for.

Also it avoid code, such as:
if(BOARD STREQUAL my_board_using_out_of_tree_soc)
  set(SOC_ROOT some/out/of/tree/soc/path)
endif()
in application CMakeLists.txt.

Finally, allowing multiple SOC_ROOTs prepares for specifying SOC_ROOTs
in Zephyr modules.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-05 08:06:07 -04:00
Torsten Rasmussen 01f55a4e53 cmake: relocation of generated Kconfig file for Zephyr modules
This commit relocates the generated Kconfig.modules file from
${CMAKE_BINARY_DIR} into ${CMAKE_BINARY_DIR}/Kconfig.

This is done as preparation of multiple SOC and ARCH root support.

A single Kconfig folder inside ${CMAKE_BINARY_DIR} helps to keep the
build folder tidy.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-05 08:06:07 -04:00
Torsten Rasmussen 13153678cb xtensa: SOC_DIR usage cleanup.
This commit is a cleanup of the SOC_DIR usage.
This cleanup is a preparation for supporting a list of SOC_ROOT instead
of just allowing one SOC_ROOT.

Supporting a list of SOC_ROOTs allows for placing of SOC in Zephyr
modules. It also aligns how BOARD_ROOT supports a list, and thus usage
of n_ROOT in Zephyr becomes more consistent.

This commit introduces the following changes:
- soc/xtensa/intel_apl_adsp/bootloader.cmake removed.
  This file is not included elsewhere in the build system, and appears
  to be leftover from #25133. Almost identical content is found in
  `soc/xtensa/intel_apl_adsp/commonbootloader.cmake`
- Changed xtensa/intel_apl_adsp to named library. Using a named library
  allow fetching library files based on library name without the need to
  know build path (and thus removes the need for knowing `${SOC_DIR}`).
- Changed SOC_DIR/ARCH/SOC_FAMILY to use CMAKE_CURRENT_LIST_DIR for
  configure time commands, as CMake code is already located inside this
  path.
- Using generator expression for library files from other CMake targets.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-05 08:06:07 -04:00
Dominik Ermel 97ca27797f tests/posix/fs: Fix missing close in error paths
Missing close in error paths trigger Coverity to issue "Resource Leak"
errors.

Fixes #27328
Coverity-CID: 211586

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-08-05 08:04:29 -04:00
Dominik Ermel e606801664 tests/posix/fs: Fix close of bad file descriptor
close in error handling attempts to close incorrect file descriptor.

Fixes #27327
Coverity-CID: 211585

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-08-05 08:04:29 -04:00
Andrew Boie 9598a5fbff ztest: use kernel stack for cpuhold
These threads don't run in user mode, save some memory if
userspace is not enabled.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-08-05 13:21:38 +02:00
Dag Bjarvin e93963b719 Bluetooth: controller: Add ll_adv_aux_set_clear function
Add ll_adv_aux_set_clear, add to bsim test

Signed-off-by: Dag Bjarvin <Dag.Bjarvin@nordicsemi.no>
2020-08-05 12:52:42 +02:00
Vinayak Kariappa Chettimada 77b820a9ea Bluetooth: controller: Fix incorrect use of ticker user id
Fix incorrect use of LLL ticker user id in ULL_LOW execution
context.

Regression introduced in commit 23ef75f6d9 ("Bluetooth:
controller: split: Fix Low Latency Prepare Done").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-08-05 12:02:05 +02:00
Vinayak Kariappa Chettimada 139eafacca drivers: flash: nrf: Fix regression with BT_CTLR_LOW_LAT option
Fix a regression that caused flashing on nRF51x Series to stall
the Bluetooth low energy controller and flashing under
BT_CTLR_LOW_LAT option.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-08-05 12:02:05 +02:00
Aleksandr Koltsoff 0f44669ceb cmake: sort shield list and improve indent
Currently, when usage.cmake is run, the shield list is in construction
order, making it difficult to locate the shield of interest. This sorts
the list upon display and also makes the display indent consistent.

Signed-off-by: Aleksandr Koltsoff <czr@iki.fi>
2020-08-05 12:01:49 +02:00
Jakub Rzeszutko ea9fe2f5ec tests: shell_flash: fix test case scenario
The previous test had two defects. First, the shell command was called
before the backend was initialized.

Second, the test compared the string from shell's backend buffer with
the reference string using strncmp function. This test result was very
susceptible to the time when it was performed because of data contained
in the buffer. Apart from expected string there was data like escape
codes needed to control the terminal.

To fix it, function strncmp was replaced by strstr, which
searches for the reference strings regardless of the characters
controlling the terminal.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>
2020-08-05 12:01:14 +02:00
Jukka Rissanen e73e932153 net: tcp2: Check data length properly
The original return type of tcp_data_get() was unsigned and the
return value <0 was not checked properly.

Fixes #25723
Coverity-CID: 210559

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-05 08:50:42 +03:00
Aastha Grover 2d9b459f15 syscalls: Add system call for cache flush & invalidate
include/cache.h: System calls declaration and implementation
kernel/cache_handlers.c: Defination of verification functions

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2020-08-04 17:26:45 -04:00
Michael Hope d5e1753eb6 boards: arm: document and enable the DAC for the Arduino Zero
The previous commits added the SAM0 DAC driver.  Now document and
enable it, including enabling it in the DAC sample.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-08-04 16:08:48 -05:00
Michael Hope 2b6783aa15 drivers: dac: add a driver for the SAM0 DAC
The Atmel SAM0 DAC is a single channel 10 bit DAC with selectable
reference.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-08-04 16:08:48 -05:00
Michael Hope 5f982e3bc1 dts: atmel: add definitions for the SAM0 DAC
The peripheral is the same on the SAMD20 and SAMD21 except for
different clock and interrupt settings.  There is no DAC on the SAMR21.

Leave disabled by default as the DAC is fairly power hungry.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-08-04 16:08:48 -05:00
Michael Hope 4a716c6eae dts: dac: add a new binding for the SAM0 DAC
The Atmel SAM0 DAC is a single channel 10 bit DAC with selectable
reference.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-08-04 16:08:48 -05:00
Lukasz Majewski 8dd6644634 dts: Add 'fixed-link' sub-node to 'eth' node on ip_k66f board
This change adds the 'fixed-link' sub-node of the ip_k66f board's
ethernet node. The fixed link is set to work with 100 Mbps and
full duplex.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2020-08-04 15:54:26 -05:00
Lukasz Majewski 8f2a0fb37d eth: mcux: Add support to NXP's ENET for fixed link setup
This commit adds support for setting fixed configuration, read
from device tree, for ENET ETH interface and PHY.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2020-08-04 15:54:26 -05:00
Lukasz Majewski 5c41b668f1 dts: Support 'fixed-link' property in nxp,kinetics-ethernet.yaml
This commit enables support for parsing 'fixed-link' node when it
is added to node described in 'ethernet,fixed-link.yaml'.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2020-08-04 15:54:26 -05:00
Lukasz Majewski a8d548df1e dts: Add binding description for ethernet fixed link PHY operation
This patch adds description for 'fixed-link' node in ethernet DTS
node. It supports setting speed and duplex.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2020-08-04 15:54:26 -05:00
Lukasz Majewski 02eed8f4cd defconfig: ip_k66f: Enable ETH_MCUX_NO_PHY_SMI on ip_k66f board
The ip_k66f board has KSZ8794 connected to K66F's enet, which
requires fixed link operation.


Signed-off-by: Lukasz Majewski <lukma@denx.de>
2020-08-04 15:54:26 -05:00
Lukasz Majewski 1a5c47cf30 eth: mcux: Support devices not using SMI for PHY setup
Some ICs - like DSA switches (e.g. ksz8794) - do not use SMI to setup
and configure PHY.

This change introduces a new Kconfig define - CONFIG_ETH_MCUX_NO_PHY_SMI
- to allow replacing SMI communication with SPI or I2C.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2020-08-04 15:54:26 -05:00
Jiří Keresteš fdca569f02 west.yml: hal_nxp: Use revision with WWDT driver built
The new LPC WWDT shim driver needs HAL update, which is provided by
the commit 7276046215cfcd4ed3d6723f16f7aeb868b0fb60.

Signed-off-by: Jiří Keresteš <jiri@kerestes.cz>
2020-08-04 15:13:25 -05:00
Jiří Keresteš 3a87517c5e drivers: watchdog: mcux_wwdt: add driver for NXP LPC 55xxx WWDT
Adds shim driver for LPC 55xxx Windowed Watchdog Timer (WWDT).

Also updates the "Supported features" table in LPCXpresso55S69
board documentation page.

Fixes #22704.

Signed-off-by: Jiří Keresteš <jiri@kerestes.cz>
2020-08-04 15:13:25 -05:00
Carles Cufi c8bc3753aa mgmt: mcumgr: Consolidate Kconfig into a single file
For some reason, MCUMgr used to consist of two separate Kconfig
files, likely due to the fact that the author's original intention was
to split the "management" and "mcumgr-specific" options in order to
integrate additional libraries. In practice this never worked out, so
coalesce them into a single file.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-08-04 15:16:35 -04:00
Andrew Boie 7d920ba39b drivers: use K_KERNEL_STACK macros
None of these threads run in user mode and we can save some
memory.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-08-04 12:16:43 -04:00
Corentin Dorothée 37aca482e9 samples: hci_spi: Fix cmd_hdr and acl_hdr usage
Fixes #27266.
cmd_hdr and acl_hdr local structs were read but never written.
Causing unpredictable errors in bt_tx_thread such as :
"Invalid HCI CMD packet length" in hci.c:2280
or Imprecise data bus errors on nrf52810.

cmd_hdr and acl_hdr are now filled with the received data
from SPI Master.

Signed-off-by: Corentin Dorothée <corentin.dorothee@gmail.com>
2020-08-04 17:53:18 +02:00
Simon Glass 6b50f643da drivers: i2c: Add a dump routine
Add a function to dump out a set of I2C messages. It uses debug logging
so it only useful for debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-04 17:50:39 +02:00
Daniel Leung cae8bd7408 sys: util: cast input of KB() to size_t for large number
Numbers in C macros are treated as signed integer. This causes
issues when using macro KB(x). If the result is larger than
(2^31 - 1), it is treated as a negative number downstream.
For example, the RAM size of up_squared is 2GB. The result of
KB(CONFIG_SRAM_SIZE) should be 2147483648, but due to being
casted as signed, the result is instead -2147483648. Any
calculations using this would be incorrectly. Fix it by
casting x in KB(x) to size_t first.

Fixes #27164

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-08-04 17:45:22 +02:00
Joakim Andersson f327ed2fb9 kernel: Add note regarding safe use of the k_work_pending return value
Add note regarding safe use of the k_work_pending return value. Similar
to the note for k_delayed_work_pending.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-08-04 17:32:56 +02:00