Commit graph

41120 commits

Author SHA1 Message Date
Wayne Ren
e11be42558 arch: arc: add initial support of SMP
* modify the reset flow for SMP
* add smp related initialization
* implement ipi related functions
* implement thread switch in isr/exception

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-07 12:21:00 +02:00
Wayne Ren
83dfe5eac4 arch: arc: add macros to get current cpu id
add macros for assembly and C to get current cpu id

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-07 12:21:00 +02:00
Wayne Ren
31a0371a0a drivers: arcv2_timer0: add support for smp
* use global free running counter as global wall clock (clock source)
* use arc internal timer 0 as local time event (clock event)

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-07 12:21:00 +02:00
Wayne Ren
1f4232ad7e arch: arc: add basic arc connect driver support
* arc connect is a component to connect multiple arc cores
* it's necessary for arc smp support
* the following features are implemented
  * inter-core interrupt unit
  * gloabl free running counter
  * inter-core debug unit
  * interrupt distribute unit

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-07 12:21:00 +02:00
Johann Fischer
8e9bf88d66 usb: do not disable endpoints at USB_DC_SUSPEND event
Do not disable endpoints at USB_DC_SUSPEND event.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-08-07 11:22:47 +02:00
Ulf Magnusson
4c21b0f250 disk: kconfig: Remove redundant DISK_ACCESS_SDHC dependency
DISK_SDHC_VOLUME_NAME is already defined within an 'if DISK_ACCESS_SDHC'
block, so the 'depends on DISK_ACCESS' is redundant.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 04:27:15 -04:00
Ulf Magnusson
a9490541d6 drivers: espi: kconfig: Remove redundant ESPI_PERIPHERAL_CHANNEL deps.
The ESPI_PERIPHERAL_* symbols are surrounded by an
'if ESPI_PERIPHERAL_CHANNEL' in the same file, so no
need to put 'depends on ESPI_PERIPHERAL' on them.

'if' is just a shorthand for 'depends on'.

Also remove a redundant 'if ESPI' from ESPI_XEC.
drivers/espi/Kconfig.xec is sourced within an 'if ESPI' in
drivers/espi/Kconfig.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 04:27:03 -04:00
Ulf Magnusson
cc8cf88e2c drivers: flash: Remove redundant FLASH dep. from FLASH_NATIVE_POSIX
FLASH_NATIVE_POSIX is defined in drivers/flash/Kconfig.native_posix,
which is source'd within an 'if FLASH' in drivers/flash/Kconfig.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 04:26:48 -04:00
Ulf Magnusson
2d8982d21b drivers: flash: Remove redundant FLASH dep. from FLASH_SIMULATOR
FLASH_SIMULATOR is defined in drivers/flash/Kconfig.simulator, which is
source'd within an 'if FLASH' in drivers/flash/Kconfig.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 04:26:27 -04:00
Ulf Magnusson
f754143699 drivers: ethernet: Remove redundant NET_L2_ETHERNET dep. from ETH_LITETH
ETH_LITEETH is defined in drivers/ethernet/Kconfig.liteeth, which is
source'd within a menu that has 'depends on ETH_LITEETH', in
drivers/ethernet/Kconfig.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 10:50:19 +03:00
Andrew Boie
f2422f1f19 tests: clean up fatal error handlers
- k_sys_fatal_error_handler() can return on all platforms,
  indicating that the faulting thread should be aborted.
- Hang the system for unexpected faults instead of trying
  to keep going, we have no idea whether the system is even
  runnable.

Prevents infinite crash loops during tests.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-06 19:32:22 -07:00
Andrew Boie
00bf76eaa7 kernel: add z_fatal_halt() to interface
Intended to be called from application-level implementations
of k_sys_fatal_error_handler().

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-06 19:32:22 -07:00
Jose Alberto Meza
882503f913 board: mec: Select cortex-M systick-based driver
Disable 32Khz until accuracy issues and timer tests failures
are resolved.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-08-06 15:13:45 -07:00
Jose Alberto Meza
1978022ff8 soc: mchp: Add configuration option to switch timer drivers
Expose in MEC1501 SoC and option to switch between OS timer drivers

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-08-06 15:13:45 -07:00
Kamil Piszczek
159ad65c93 fs: nvs: format specifier aligned with off_t type
Aligned format specifier for the off_t type in the NVS file system.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-08-06 14:32:23 -07:00
Vaishali Pathak
0923ae4172 drivers: sensors: Add Si7006 temperature/humidity sensor driver
Adds driver for Silicon Labs Si7006 chip.

Signed-off-by: Vaishali Pathak <vaishali@electronut.in>
2019-08-06 15:05:25 -05:00
Joakim Andersson
ccbb18c9ac Bluetooth: SMP: Fix SMP identity distributing IRK for ID 0 always
Fix an issue in the SMP identity distribution where the IRK for the
default identity was always distributed.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-06 19:47:27 +02:00
Peter A. Bigot
167eb53e74 subsys/fs/littlefs: allow customization of file system configuration
There's desire to be able to customize parameters on a per-filesystem
basis, which means we need a way to override the Kconfig defaults which
are global.  This also means the littlefs data structure cannot own the
cache and lookahead buffers.

Switch to using a macro to define the littlefs data structure.  The
default version uses the Kconfig constants.  A custom one takes
arguments providing the most likely partition-specific parameters.
Finally the user is free to bypass the helper macros and set any
parameters desired, though validation is limited and only present when
CONFIG_DEBUG is enabled.

Extend the test suite with a performance module, which confirms that
these settings have an impact proportional to the log of changes to the
cache or IO sizes.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-06 19:39:26 +02:00
Peter A. Bigot
a8b7a21524 subsys/fs: remove ambiguity in readdir results
Existing file system implementations do not provide the special "."
(current) and ".." (parent) directory entries in the readdir results.
littlefs does.

Remove these entries in the abstraction layer.  This simplifies code in
higher level consumers that aren't prepared to see them.  Consumers like
FUSE that need them can put them back without having to worry about
conflicts.

Closes issue #17951

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-06 19:39:26 +02:00
Peter A. Bigot
979fb85d50 tests/subsys/fs/littlefs: add tests
Verify all FS API calls using the nRF52840 development kit.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-06 19:39:26 +02:00
Peter A. Bigot
bd6af278ae subsys/fs/shell: avoid warning about output format truncation
The previous way of creating an absolute path relied on snprintf(), and
when used with newlib gcc warned that the output could be truncated
before the last format character.  Rework to use code that doesn't rely
on snprintf.

See discussion at https://bugzilla.redhat.com/show_bug.cgi?id=1431678

Also ensure that cwd is always NUL-terminated, and use the utility
function to create the absolute path in cmd_trunc.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-06 19:39:26 +02:00
Peter A. Bigot
5fe2591074 subsys/fs/shell: add littlefs support
Add support for the littlefs file system in the fs shell.  Update
the sample to use the same partition configuration as the littlefs
example for the SPI NOR test platform.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-06 19:39:26 +02:00
Peter A. Bigot
cfa64bde1c samples/subsys/fs/littlefs: add a basic sample
Uses a littlefs file system to maintain a boot counter.  Also tests some
other functions.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-06 19:39:26 +02:00
Peter A. Bigot
fb73fcd4ba subsys/fs: add support for littlefs
littlefs is a fail-safe filesystem from ARM Mbed that has wear-leveling
capabilities.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Jim Paris <jim@bolt.io>
2019-08-06 19:39:26 +02:00
Peter A. Bigot
b8be48e6ca subsys/fs: clean up CMakeLists
Remove the disabled link interface commands.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-06 19:39:26 +02:00
Piotr Zierhoffer
a3ddc09abf build: west: Update the error message when not in west dir
Zephyr verifies if it is built from a west-initialized directory.
The message changed in west@c08061cef1c7b0e19a58a82db731098e2f4bba4a.

Closes #18034.

Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-08-06 19:13:24 +02:00
Jukka Rissanen
abdd58ce3c net: sockets: Do not call NULL socket callback function
Before calling socket callback function, make sure the callback
function exists so that we do not get NULL pointer reference.

Fixes #18021

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-06 19:27:48 +03:00
Sebastian Bøe
34180d376f kconfig: Fix nrf91 NONSECURE dependency
It is expressed that the BOARD depends on whether NONSECURE is enabled
or not. But it is the other way around. Depending on the selected
board, it may or may not be possible to enable/disable NONSECURE.

The dependency is going in the wrong direction, this reversed edge is
observed to be able to create a cycle in the dependency graph.

Fix the dependency by removing it.

It is left as future work to enforce that enabling/disabling NONSECURE
is done in a way that is compatible with selecting
BOARD_NRF9160_PCA10090 vs BOARD_NRF9160_PCA10090NS.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-08-06 18:00:04 +02:00
Armando Visconti
6dceb4987e driver/sensor/lsm6dso: Fix deprecated macros CS_GPIO_* to CS_GPIOS_*
The lsm6dso driver was in pre-merging state when a614a026
was committed. So, let's make the modification manually.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-08-06 11:09:34 -04:00
Henrik Brix Andersen
9a7734abf5 drivers: can: flexcan: implement timestamp for RX frames
This commit implements timestamps for receiving frames on the
NXP MCUX FlexCAN CAN driver.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-08-06 16:39:35 +03:00
Alexander Wachter
9923cf2dda drivers: can: stm32: Implement timestamp for RX frames
This commit implements timestamps for receiving frames on
stm32 CAN driver.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-06 16:39:35 +03:00
Alexander Wachter
3febaad1d6 can: Add RX timestamp to zcan_frame
This commit introduces a timestamp for received CAN frames.
The timestamp is optional and can be activated via Kconfig.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-06 16:39:35 +03:00
Kumar Gala
01d11d50d3 dts: nios2: Remove device_type = "memory" from SRAM nodes
The true mmio-sram nodes should not have had a 'device_type' property.
Remove it from the cases that we clearly know are SRAM.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-06 08:59:22 -04:00
Kumar Gala
3d4fa57541 dts: riscv: Remove device_type = "memory" from SRAM nodes
The true mmio-sram nodes should not have had a 'device_type' property.
Remove it from the cases that we clearly know are SRAM.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-06 08:59:22 -04:00
Kumar Gala
a5ae0daa35 dts: arc: Remove device_type = "memory" from {d,i}ccm nodes
The "{d,i}ccm" nodes should not have had a 'device_type' property.
Remove it from the cases that we clearly know are {d,i}ccm.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-06 08:59:22 -04:00
Kumar Gala
b52b1b2222 dts: arm: Remove device_type = "memory" from SRAM nodes
The true mmio-sram nodes should not have had a 'device_type' property.
Remove it from the cases that we clearly know are SRAM.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-06 08:59:22 -04:00
Joakim Andersson
bd89cc3f4d Bluetooth: Controller: Fix privacy advertiser connect peer address type
Fix an issue with enhanced connection complete event raised by the
advertiser role. The advertiser reported that it has resolved the
the identity address of the peer, even when the peer is connecting
using it's identity address.
The host will not have the correct on-air address type i.e public.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-06 14:53:33 +02:00
Joakim Andersson
699436a3b6 Bluetooth: Host: Fix bug in creating connection with wrong own address.
Fix bug introduced by: 45da629b24
Mistakenly set the own address type to the destination address type.
Also this uses the RPA_OR_RANDOM in case local IRKs exists in the
controller.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-06 14:28:17 +02:00
Jukka Rissanen
5c05ef5101 net: Move include files outside of extern "C" block
This is related to findings in #17997 and changes network related
header files to have include files outside of extern "C" { } block.

Declarations that use C linkage should be placed within extern "C"
so the language linkage is correct when the header is included by
a C++ compiler.

Similarly #include directives should be outside the extern "C" to
ensure the language-specific default linkage is applied to any
declarations provided by the included header.

See: https://en.cppreference.com/w/cpp/language/language_linkage

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-06 14:46:36 +03:00
Erwan Gouriou
27a5cb6048 boards: nucleo_wb55rg: Add link to reference manual
This was missing from board documentation.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-08-06 05:21:33 -04:00
Armando Visconti
d841908e08 dts: bindings: st,stts751-i2c.yaml: (FIX) Remove unused 'version' field
This dts binding file remained out from 0ec0c84808 commit, because
it was still in the pre-merging status.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-08-06 05:01:48 -04:00
Yasushi SHOJI
1fe8269399 test: kernel: sched: Add a test for nested scheduler lock
Add a new test for unlocking nested scheduler lock.  Make sure that
k_sched_unlock() isn't unconditionally a preemption point.

Signed-off-by: Yasushi SHOJI <y-shoji@ispace-inc.com>
2019-08-06 10:19:50 +02:00
Yasushi SHOJI
20d072465d kernel: sched: Do not force preempt when k_sched_unlock()
The scheduler lock is a nestable lock.  Unlocking a nested,
still-having, lock shouldn't preempt the current thread.

	k_sched_lock();
	k_sched_lock();
	k_sched_unlock();  /* <--- this shouldn't be a scheduling point */
	k_sched_unlock();  /* <--- this is a scheduling point */

This commit changes the preempt_ok argument from 1 to 0.  This let
should_preempt() check whether it should preempt at the point or not.

This fixes #17869.

Signed-off-by: Yasushi SHOJI <y-shoji@ispace-inc.com>
2019-08-06 10:19:50 +02:00
Kumar Gala
612a608e61 arc: snps_nsim: Fix -mfpu compiler flag for NSIM_HS build
The NSIM_HS target should have had the fpu flag to the compiler be:
-mfpu=fpud_all.  Otherwise we get a build error.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-06 11:15:36 +03:00
Nicolas Pitre
cd4e7893ea LOG_BACKEND_DEFINE(): use Z_STRUCT_SECTION_ITERABLE()
Replace the open coded section attribute by Z_STRUCT_SECTION_ITERABLE()
to properly align structure instances on 64-bit targets.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-08-06 10:03:13 +02:00
Jukka Rissanen
caa99b7fed net: context: Clarify net_context_send() API documentation
The net_context_send API documentation was missing the fact,
that the callback might be called after the net_context_send()
has returned. Also currently the timeout value is not used properly
anywhere in the code. This is left like this as there is not much
use for the timeout value atm. This might be fixed later if there
is proper use case for it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-06 10:14:57 +03:00
Markus Fuchs
edb58ec46b soc: arm: st_stm32: add STM32F437XI
This patch adds support for the STM32F437XI SoC.

Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
2019-08-05 19:57:45 -04:00
Paul Sokolovsky
04da7eaf07 scripts: dts: Consistently open text files with utf-8.
Zephyr codebase standardizes in UTF-8 as file encoding. To
accommodate this, we explicitly pass encoding="utf-8" to Python's
open() function, to be independent of any locale setting of a
particular system (e.g., CI/build systems oftentimes have "C",
i.e. ASCII-only, locale). In a few places, we lacked this parameter,
so add it consistently.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-08-05 17:47:57 -04:00
Nicolas Pitre
39ada71688 riscv: isr.S: fix a missing lw to LR conversion
This loads a pointer and therefore has to use LR to be 64-bit
compatible.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-08-05 21:51:09 +02:00
Mariusz Skamra
7c60300753 Bluetooth: Shell: Fix unregister GATT Metrics vendor service
The 'registered' flag was not cleared when 'gatt metrics off'
was called so that one was unable to register the service again.
Remove 'registered' variable that is actually not needed as there
is no tracking if service is already registered in similar
cmd_register_test_svc command. If the service is already registered,
the host will log an error.

Fixes: #17882
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2019-08-05 21:50:41 +02:00