Commit graph

41120 commits

Author SHA1 Message Date
Jukka Rissanen
93e5181fbd net: context: Add locking for concurrent access
If the net_context functions are accessed from preemptive priority,
then we need to protect various internal resources.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-31 11:20:26 +02:00
Erwan Gouriou
a985e03349 drivers/interrupt_controller: stm32: Use LL API
exti driver implementation does not fit all SoCs because
some EXTI ip does not match stm32_exti register map provided.
Instead of providing exti register map for all SoCs, use LL API
which abstracts IP variations and enable uniform use of the drivers
on all STM32SoCs.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-31 03:18:36 -06:00
Kumar Gala
e11314a21f cmake: Fix how usage finds board names
We had been search for <BOARD>.yaml, however its possible that doesn't
match anything and we actually use <BOARD>_defconfig in
boilerplate.cmake.  So search for *_defconfig instead of *.yaml to
generate the <BOARD> list.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-31 03:17:19 -06:00
Piotr Mienkowski
a148e11e2a drivers: uart_gecko: use DT_<COMPAT>_<INSTANCE>_<PROP> defines
Use the new DT_<COMPAT>_<INSTANCE>_<PROP> defines to instantiate
devices. This commit adds also ability to define individual pin
locations on SoC series that support the feature. Definitions of GPIO
pins assigned to a given location have been moved from soc_pinmap.h file
to board DTS file.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-01-31 03:14:51 -06:00
Kumar Gala
93d0f8c58d dfu: Fix build issue with gcc8
We get the following warning when buiding with gcc8:

	error: 'packed' attribute ignored for type 'u32_t *'
	{aka 'unsigned int *'} [-Werror=attributes]

Use UNALIGNED_GET() to access the data since we don't know the
alignment.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-31 03:13:52 -06:00
Maureen Helm
3c44137447 drivers: gpio: Validate pin number before indexing array in mcux drivers
Validates the gpio pin number before using it to index into a
memory-mapped register array. Otherwise, a user could send a high pin
number and cause an out-of-bounds access.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-31 03:13:15 -06:00
Aurelien Jarno
4394601524 net: sntp: get rid of the callback function
The original SNTP client library was designed for the net-app API, for
which it makes sense to have a callback function, which is called
asynchronously when an answer is received.

For the socket based interface, the callback is called just before
sntp_request() returns. It gets the status and the epoch_time in
parameter, however the status is already returned by sntp_request(). It
therefore make sense to replace the callback function by a pointer to
epoch_time.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-01-31 10:14:12 +02:00
Andrew Boie
c253a686bf app_shmem: auto-initialize partitions
There are no longer per-partition initialization functions.
Instead, we iterate over all of them at boot to set up the
derived k_mem_partitions properly.

Some ARC-specific hacks that should never have been applied
have been removed from the userspace test.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-01-30 23:15:51 -05:00
Marc Herbert
e526a2b80a host-gcc: exclude -lgcc to fix -mx32 [qemu_]x86_64 regression
PR #9522 series ending with commit c2c9265b7d ("tests: cmsis: Disable
two cmsis portability tests on x86_64") added -mx32 support for the
x86_64 ARCH and qemu_x86_64. While this was implemented in
"compiler/gcc/target.cmake" as fall back from cross-compilation to the
host compiler, it worked with a direct ZEPHYR_TOOLCHAIN_VARIANT=host
too.

Later, -lgcc was added to "compiler/host-gcc/target.cmake" by PR #12674
to fix the -m32 x86 build. This broke the x86_64 build when using
ZEPHYR_TOOLCHAIN_VARIANT=host because even "multilib" packages usually
don't feature the -mx32 version of libgcc.

Fix this by excluding -lgcc in compiler/host-gcc/target.cmake just like
compiler/gcc/target.cmake always did for x86_64.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-01-30 22:08:30 -05:00
Rajavardhan Gundi
c8233c8830 intel_s1000_crb: CMakeLists: Define building of custom image
This patchset introduces support for building a board specific custom
image for intel_s1000_crb. This pads the output binary (zephyr.bin)
with some additional data as required by the s1000 BootROM.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2019-01-30 21:30:49 -05:00
Rajavardhan Gundi
ecdea1c30c CMakeLists: Introduce extra post build commands
This patchset introduces support for building board specific custom
images. Any board which needs to build a custom image (a post-processed
zephyr.bin) should inject the post_build_command from a script in the
corresponding board directory.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2019-01-30 21:30:49 -05:00
Paul Sokolovsky
d6ffca36f3 samples: sockets: Clean up headers included
Don't include net_app.h and net_buf.h, the first is deprecated, the
latter is low-level header, both shouldn't be used for socket apps.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-30 21:05:11 -05:00
Maureen Helm
cb2f9e9590 samples: sensors: adt7420: Fail gracefully if sensor not found
Fixes the adt7420 sensor sample to fail gracefully if the sensor device
is not found and asserts are not enabled.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-30 21:03:44 -05:00
Robert Lubos
e0a44c388c net: openthread: Bump OpenThread commit to f9d757a1
This version has cli_console backend fixed, hence no longer crashes on
`ot ping` command.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-01-30 21:01:53 -05:00
Kumar Gala
1d210dc2d8 sensor: adxl372: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert adxl372 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 17:51:25 -06:00
Kumar Gala
0610044209 boards: arm: nrf52_pca10040: Add SPI & I2C as supported devices
Update the board yaml to have SPI & I2C as supported devices.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 17:51:25 -06:00
Andrew Boie
85e1fcb02a app_shmem: renamespace and document
The public APIs for application shared memory are now
properly documented and conform to zephyr naming
conventions.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-01-30 15:43:58 -08:00
Anas Nashif
e78ccdf4b8 doc: rename kconfig section
kconfig entries are options, symbols is probably an internal name to
kconfig.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-30 18:38:48 -05:00
Anas Nashif
ac7db91c68 doc: group storage components
Group storage components into one group.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-30 18:38:48 -05:00
Anas Nashif
8eee0b7fdd doc: move sensor doc to peripherals section
Sensors are peripherals, so move the reference alongside all other
peripherals.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-30 18:38:48 -05:00
Anas Nashif
7f150788af doc: move sensor APIs to main sensor doc
Move doxygen API reference to the main documentation page.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-30 18:38:48 -05:00
Anas Nashif
67cd53e028 doc: fix link to contribution guide
Fixed link to the contribution guide.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-30 18:38:48 -05:00
Anas Nashif
47fc5095f8 doc: move version API to kernel
Move this last doxygen API to the kernel section.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-30 18:38:48 -05:00
Anas Nashif
4db3d06c2e doc: add peripherals reference
Create a reference page for each peripheral and move doxygen API
reference to the main documentation page.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-30 18:38:48 -05:00
Anas Nashif
ecff7e6901 doc: move USB API to USB section
Move doxygen API reference to the main documentation page.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-30 18:38:48 -05:00
Anas Nashif
64cffceb90 doc: move PM API to PM section
Move doxygen API reference to the main documentation page.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-30 18:38:48 -05:00
Anas Nashif
1206eb721a doc: move device driver model API reference
Move doxygen API reference to the main documentation page.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-30 18:38:48 -05:00
Kumar Gala
8de6778e90 sensor: lis2dh: Fix gcc8 compiler warning
We get the following warning with sdk-ng:

	drivers/sensor/lis2dh/lis2dh.c:210:38: error: bitwise comparison
	always evaluates to false [-Werror=tautological-compare]

	if ((value & LIS2DH_LP_EN_BIT_MASK) == 1 && ...
                                      ^~
The test needs to be:
	(value & LIS2DH_LP_EN_BIT_MASK) == LIS2DH_LP_EN_BIT_MASK

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 17:19:41 -06:00
Kumar Gala
62704a52ed pinmux: remove pinmux dev
pinmux dev isn't really used or supported.  We only have one driver that
is implmeneted, and that driver isn't ever enabled.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 16:29:40 -06:00
Krzysztof Chruscinski
a0904ff86a logging: Handle panic occuring before log initialization
Log backends (marked as autostart) are initialized late. By default
in logger thread which has the lowest priority. If log_panic() occurs
earlier no logs is printed because there is no backend enabled.

This patch fixes it by adding log_init() call to log_panic(). Log_init()
can be called multiple times.

This patch ensures that logs are printed if early panic occurs if
backend is configured to auto-start. This is not the case if shell
is acting as log backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-01-30 23:26:13 +01:00
Kumar Gala
e2b62b411b samples: openamp: Update sample to OpenAMP v2018.10 release
The v2018.10 release of OpenAMP reworks the API set and splits the
remoteproc vs rpmsg interfaces so one can use rpmsg without remoteproc.

This helps drastically reduce the code footprint utilized by OpenAMP.
The remote see around 4k reduction in code size.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 15:55:47 -06:00
Kumar Gala
85c5ca2f0f ext: open-amp: Update OpenAMP to v2018.10 release
Update to new OpenAMP v2018.10 release.  This release allows us to
utilize just rpmsg without remoteproc.  The API set has changed and
requires updates to the openamp sample.  Additionally, the changes
in this release reduce the code size footprint, and support a static
allocation memory model.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 15:55:47 -06:00
Kumar Gala
5792318547 ext: libmetal: Update libmetal to v2018.10 release
Since there's an official release lets update to it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 15:55:47 -06:00
Andy Ross
8b583acf23 kernel/timeout: Fix another recursive spinlock()
The fix in commit e664c78b82 ("kernel/timeout: Fix recursive
spinlock in z_set_timeout_expiry()") missed a spot that had also been
introduced with recent locking work.  The new
_get_next_timeout_expiry() implementation takes its own lock, which is
recursive when called from z_clock_announce().  Fix by calling the
wrapped implementation instead.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-30 13:29:42 -08:00
Andy Ross
7367b84f8e kernel/spinlock: Augment runtime validation
There was an existing validation layer in the spinlock implementation,
but it was only enabled when both SMP and CONFIG_DEBUG were enabled,
which meant that nothing was using it.  Replace it with a more
elaborate framework that ensures that every lock taken is not already
taken by the current CPU and is released on the same CPU by the same
thread.

This catches the much more common goof of locking a spinlock
recursively, which would "work" on uniprocessor setups but have the
side effect of releasing the lock prematurely at the end of the inner
lock.  We've done that in two spots already.

Note that this patch causes k_spinlock_t to have non-zero size on
builds with CONFIG_ASSERT, so expect a little data and code size
increase.  Worth it IMHO.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-30 13:29:42 -08:00
Vikrant More
732cfac519 samples: mesh: removed bug which is cause of divide by zero exception
If Client send transition time values as 0x40 or 0x80 or 0xC0 then
this was cause the behind divide by zero exception during calculation
of transition->counter. This PR will solve this bug.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-01-30 21:48:02 +02:00
Marti Bolivar
a7342daedc boards: rv32m1_vega: fix the location of the YAML file
This needs to match the defconfig name.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2019-01-30 13:42:03 -06:00
Kumar Gala
2cfefa5d42 gpio: mcux_igpio: Cleanup old CONFIG_ symbols
A number of CONFIG_ symbols should have been converted to DT_ defines
instead.  Clean that up for PORT2..PORT4.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 13:22:54 -06:00
Carles Cufi
109f80f142 west: runners: nrfjprog: Enable testing of nRF91
Enable the nRF91 suite of tests.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-30 20:16:27 +01:00
Carles Cufi
13ce9d94b9 west: runners: nrfjprog: Correct nRF91 unit test reference data
nRF91 only does `--sectorerase` (no UICR) and does not need to
enable pin reset (`--pinresetenable`).

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-30 20:16:27 +01:00
Ioannis Glaropoulos
a97dbec8c1 scripts: west: explicitly ask for --sectorerase for nRF9160_pca10090
When flashing nRF9160_pca10090 board with nrfjprog, explicitly
request for --sectorerase, instead of --sectoranduicrerase (used
when flashing boards with nRF52 SOC).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-01-30 20:16:27 +01:00
Marti Bolivar
5bb07d61d0 CODEOWNERS: add myself as maintainer for west commands
I forgot to do this when creating these files.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2019-01-30 13:31:51 -05:00
Anas Nashif
c0ea505b2c kernel: fix typo in kconfig name
CONFIG_MULTITHREDING -> CONFIG_MULTITHREADING

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-30 13:30:17 -05:00
Anas Nashif
48d8f6f5aa arm: CONFIG_ARM_SAU -> CONFIG_CPU_HAS_ARM_SAU
CONFIG_ARM_SAU was not defined, use CONFIG_CPU_HAS_ARM_SAU instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-30 13:30:17 -05:00
Anas Nashif
286685238a kconfig: altera: remove undefined kconfig usage
Remove conditionals with kconfig options that are not defined and for
drivers that are not supported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-30 13:30:17 -05:00
Kumar Gala
352234e0b6 drivers: uart_nsim: Add device tree support
Add Device Tree support for uart nsim ARC driver.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 12:27:37 -06:00
Kumar Gala
136ab0036e tests: build_all: Remove explicit nsim_uart build test
Building of nsim_em board will get the NSIM UART build tested so no need
to have an explicit test for it here.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 12:27:37 -06:00
Alberto Escolar Piedras
815f6fad75 tests: bsim_bt: Rename test script for consistency
Minor change:
Rename the file names of the test scripts for consistency with
other BLE code
The simulation identification string is also changed (although
there is no actual functional need)

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-30 13:24:30 -05:00
Alberto Escolar Piedras
8c8d099632 tests: bsim_bt: Add BLE connection test with split controller arch
To also cover the new split controller architecture (with a common ULL
and vendor dependent LLL).
Add a connection testcase (without encryption so far) for the nrf52_bsim
configured with the split controller architecture.
This is just the exact same as the Basic_con test but building the test
with CONFIG_BT_LL_SW_SPLIT=y.
Privacy and data lenght extensions are also so far disabled as the
new controller does not yet support them.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-30 13:24:30 -05:00
Alberto Escolar Piedras
58a7508d66 tests: bsim_bt: Compile each project in its own folder
To allow for incremental builds also when 2 projects are only
differentiated by the project configuration file.
Separate the build dirertories also by the selected project file.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-30 13:24:30 -05:00