Commit graph

99553 commits

Author SHA1 Message Date
Ulf Magnusson
d96dbadd75 tests: adc_simple: Change ADC_DEBUG=y to SYS_LOG_ADC_LEVEL=4
The ADC_DEBUG Kconfig symbol was removed in commit a679f32920
("sys_log: replace old debug macros at ADC driver"), which introduced
SYS_LOG_ADC_LEVEL and switched to using SYS_LOG_DBG() for debug
messages.

Remove the ADC_DEBUG=y assignment and set SYS_LOG_ADC_LEVEL=4 so that
the debug messages still show up.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 11:19:34 -04:00
ruuddw
8364b223e4 Fix struct offsets (DWARF v2 compatibility)
For DWARF v2, DW_AT_data_member_location is encoded as a set of operations. The member_offset is in that case a list that starts with an operation (typically DW_OP_plus_uconst), so member_offset[0] is not the offset.

This solves the kernel/poll test (issue #7885)
2018-05-25 16:49:42 +02:00
Ioannis Glaropoulos
49f0dabfcc arch: arm: refactor default _FaultDump to provide fatal error code
Refactor the _FaultDump of the default debug-level (2) to
provide the error code that indicates the fatal error reason.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-05-25 09:46:24 -05:00
Ioannis Glaropoulos
d54dc42af9 arch: arm: refactor FAULT_DUMP to retrieve the fatal error reason
Refactor FAULT_DUMP macro to obtain and store the fatal error
reason. Make non-default version of FAULT_DUMP (i.e. with
CONFIG_FAULT_DUMP level 1) to retrieve the default reason
for fatal errors (_NANO_ERR_HW_EXCEPTION).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-05-25 09:46:24 -05:00
Ioannis Glaropoulos
d2c8a20560 arch: arm: document non-returning fatal handlers
Document that execution does not return from
_NanoFatalErrorHandler and _SysFatalErrorHandler.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-05-25 09:46:24 -05:00
Ioannis Glaropoulos
e8182fa03d test: kernel: remove workaround for arm_mpu (keep for nxp_mpu)
The generation of Stack Corruptions reports is, now, supported
in ARM SOCs with the ARM MPU (CONFIG_ARM_MPU). Therefore, this
commit removes the workaround for ARM architecture in
tests/kernel/fatal/ and keeps it only for SOCs with the NXP MPU
(CONFIG_MXU_MPU).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-05-25 09:46:24 -05:00
Ulf Magnusson
65e79fd5c2 boards: exp432p401r_launchxl: Remove Flash base address Kconfig setting
Supposed to come from DTS. The Kconfig symbol was removed in commit
311e6b9e3e ("arch: arc: Use DTS for all ARC SoCs").

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 09:45:18 -05:00
Ulf Magnusson
f3f767a2ae tests: power: multicore: Remove CONFIG_UART_{0,1}=n assignments
No such generic UART symbols ever existed, afaict. Maybe some
board-specific UART was meant to be disabled.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 09:13:20 -05:00
Wayne Ren
876a9af9d5 arch: arc: fix the bug in register clear for USER_SPACE
* blink, fp should not be always cleared
* clean up code format
* use a better way to save and restore ER_SEC_STAT

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2018-05-25 15:56:15 +02:00
Wayne Ren
77eb883ab0 arch: arc: fix the bug in exception return for secure mode
* current codes use a faked interrupt return to do a thread switch
  in exception return.
* so the different between exception return and interrupt return
  should be carefully considered.
* when secure is enabled, the sec_stat should also be pushed in
  exception entry.
* when secure is enabled, SEC_STAT.IRM must be configured corrrectly
  for interrupt return.
* For the case of faked interrupt return in exception return, the
  correct value of SEC_STAT.IRM comes from ER_SEC_STAT.ERM.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2018-05-25 15:56:15 +02:00
Kumar Gala
f245ef2aeb drivers: i2s: i2s_cavs: Fix typo in IRQ priority
The driver was using CONFIG_I2S_1_IRQ_PRI which doesn't exist.  It
should use CONFIG_I2S_CAVS_1_IRQ_PRI.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-25 08:04:47 -05:00
Kumar Gala
b0e697cc43 subsys: usb: Remove undefined CONFIG_USB_DEVICE_HID_BOOTP
The Kconfig symbol CONFIG_USB_DEVICE_HID_BOOTP isn't defined anywhere,
so remove dead code associated with it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-25 08:04:36 -05:00
Kumar Gala
23bf9426ad drivers: serial: uart_fe310: Match Kconfig defines in comment
The trailing #endif comments used CONFIG_FE310_UART_{0,1} and they
should be CONFIG_UART_FE310_PORT_{0,1}.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-25 08:04:16 -05:00
Johann Fischer
c5cfb462f9 net: rpl: fix null pointer dereference
This patch fixes possible null pointer dereference in
net_stats_update_rpl_resets(...).

net_rpl_set_root_with_version(...) does not initialize instance->iface
and calls net_rpl_reset_dio_timer(...), which then calls
net_stats_update_rpl_resets(instance->iface).

fixes: #7862

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-05-25 09:03:34 -04:00
Johan Hedberg
c4b0f1c5b4 Bluetooth: Mesh: Fix build error when LPN is not enabled
Some versions of gcc do not seem to compile out the inaccessible code
in this case and instead give the following error:

subsys/bluetooth/host/mesh/transport.c:419: undefined reference to
`bt_mesh_lpn_poll'

This happens at least when building samples/bluetooth/mesh for
native_posix on Fedora 28.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-25 10:53:46 +03:00
Kumar Gala
8e41572774 drivers: spi: remove dead references to CONFIG_SPI_QMSI{_SS}
During the spi rework we removed the qmsi spi drivers so we no longer
have Kconfig symbols or drivers related to CONFIG_SPI_QMSI{_SS}.  There
are a few references still around that we should remove

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-24 21:09:32 -04:00
Andrew Boie
6f6acb4667 arm_mpu: reduce boot MPU regions for various soc
The PPB, Peripheral, and any other I/O regions have been
removed, the Shareable options are only important with
unlocked dual cores. Just use the background mapping,
which is RWX for supervisor and no access for user mode.

The flash region needs to be kept to indicate read-only
policy. The RAM regions need to be kept to disable execution.

Fixes #6896

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-24 19:19:07 -04:00
Andrew Boie
d9a227c19c arm: st_stm32: reduce boot MPU regions
The PPB and Peripheral regions have been removed,
the Shareable options are only important with unlocked
dual cores. Just use the background mapping.

The flash region needs to be kept to indicate read-only
policy. The RAM regions need to be kept to disable execution.

Related to #6896 and #7877

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-24 15:31:00 -07:00
Carles Cufi
6f534e4551 drivers: entropy: nrf5: Implement standard ISR-specific call
Implement the new entropy_get_entropy_isr() function to allow the kernel
to collect entropy before the scheduler and kernel data structures are
ready. Switch to an nrf-specific version for high-performance
requirements in the BLE Link Layer.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-05-24 15:13:13 -07:00
Carles Cufi
b54644913d kernel: Use IS-specific entropy function when available
During the early boot process, in prepare_multithreading(), the kernel
structures and scheduler are not ready yet. In order to obtain entropy
for early works such as stack randomization, optionally use when present
the ISR-specific function that some drivers will provide.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-05-24 15:13:13 -07:00
Carles Cufi
668e31f7db drivers: entropy: Introduce ISR-specific entropy function
In order to address the requirements of the kernel boot process, an
optional ISR-specific function is declared to allow entropy collection
outside of thread mode and without using any kernel primitives. It also
includes a parameter to optionally busy-wait for hardware entropy
generation.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-05-24 15:13:13 -07:00
Andrew Boie
29599f6d80 sanitycheck: deprecate assertion options
This is now done directly in Kconfig for tests.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-24 15:12:56 -07:00
Andrew Boie
bc40f9340d debug: enable assertions for all tests
This keeps biting us; sanitycheck turns on assertions by
default for tests, but standalone builds, or builds done
for other test infrastructure do not. Put all builds in
the same state.

Specific tests (such as benchmarks) can override this with
CONFIG_FORCE_NO_ASSERT.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-24 15:12:56 -07:00
Andrew Boie
411686f02b build: suppress asserts warning if forced off
This was being incorrectly printed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-24 15:12:56 -07:00
Andrew Boie
dda7befdba tests: benchmarks: force assertions off
These would interfere with size/footprint data.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-24 15:12:56 -07:00
Punit Vara
843ad8b07e tests: semaphore: Check return value
Check return value for pthread_create()

issue: #6701

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-05-24 14:25:25 -07:00
Carles Cufi
a06b14f29b scripts: check-compliance: Allow to run from any path
Allow check-compliance.py to be run from any path with a valid Git tree,
removing the unnecessary and artificial limitation imposed in the case
of gitlint.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-05-24 16:57:24 -04:00
Anas Nashif
333a315f7b sanitycheck: improve help message
Aply some feedback to the help messages of sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-24 16:55:55 -04:00
Anas Nashif
1c7ba097b5 sanitycheck: document --device-testing feature
Document testing on hardware using sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-24 16:55:55 -04:00
Anas Nashif
0a9a505e73 sanitycheck: update script arguments
Update sanitycheck script arguments with latest commands.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-24 16:55:55 -04:00
David B. Kinder
11c6306f76 doc: tweak CSS for option table display
Noticed in docs.zephyrproject.org/subsystems/test/sanitycheck.html that
the first column of the option table display is too narrow (for short
option names that are shown on the same line as the description).  This
PR tweaks the CSS to widen the first column enough to stop wrapping in
most cases.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-05-24 16:15:24 -04:00
Ulf Magnusson
45221a9706 serial: nsim: Fix impossible-to-enable CONFIG_UART_NSIM
CONFIG_UART_NSIM depends on CONFIG_NSIM, which was removed in commit
9bc69a46fa ("boards: Update arc em_starterkit support from 2.2 to
2.3"). Remove the dependency, and also remove the CONFIG_NSIM=y setting
from the test_nsim test (which should now work).

Also change the condition for EXTERN()ing _VectorTable in
include/arch/arc/v2/linker.ld to check CONFIG_UART_NSIM instead of
CONFIG_NSIM. I'm guessing the EXTERN() is there to make the symbol
visible to nSIM, though I don't know anything about it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-24 13:09:28 -04:00
Leandro Pereira
a85c546203 boards: x86: minnowboard: Unset CONFIG_X86_NO_SPECTRE_V4 by default
According to INTEL-SA-00115[1], Intel(r) Atom(tm) Processor E Series
are affected.  All Minnowboards sports one of these processors.

[1]: https://goo.gl/CKyLQy

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-05-24 13:07:12 -04:00
Leandro Pereira
ecadd465a2 arch: x86: Allow disabling speculative store bypass
In order to mitigate against Spectre V4, add an option that will, at
boot time, verify if the CPU supports the SPEC_CTRL MSR; if so, it'll
attempt to disable the feature.

More information can be found in chapter 4 (Speculative Store Bypass
Mitigation) of the "Speculative Execution Side Channel Mitigations"
document, version 2, published by Intel: https://goo.gl/nocTcj

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-05-24 13:07:12 -04:00
Leandro Pereira
fb0fba91a5 arch: x86: Rename CPU_NO_SPECTRE to CPU_NO_SPECTRE_V2
There's a new known variant, so make it clear what this one is for.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-05-24 13:07:12 -04:00
Ioannis Glaropoulos
46a3e8bdf0 arch: arm: fix fault status register bitfield masks
This commit fixes the bitfield masks for the Cortex-M
fault status registers.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-05-24 11:31:54 -05:00
Kumar Gala
9a89f39b49 ext: hal: open-amp: Allow for open-amp source to be external
Introduce a Kconfig option (CONFIG_OPENAMP_SRC_PATH) that allows us to
point to an external copy of open-amp.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-24 11:22:05 -05:00
Kumar Gala
e91b580208 ext: hal: libmetal: Allow for libmetal source to be external
Introduce a Kconfig option (CONFIG_LIBMETAL_SRC_PATH) that allows us to
point to an external copy of libmetal.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-24 11:22:05 -05:00
Tomasz Bursztyka
2bfcb8496d arch/arc: UART QMSI's baudrate is not present in Kconfig anymore
It's generated through dts.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-05-24 11:58:17 -04:00
Ulf Magnusson
d44fee359d menuconfig: Add search and save/load improvements from upstream
- Show the value of each symbol in the jump-to dialog.

 - Search names and prompts separately in the jump-to dialog.
   Previously, '_BAR$' wouldn't match FOO_BAR if it had a prompt,
   because '_BAR$' was matched against the string 'FOO_BAR "prompt"'.

 - Show the working directory in save/load dialog boxes. Paths will be
   relative to it, and Carles Cufi pointed out that it might not be
   obvious.

   Also allow ~ to be used to refer to the home directory.

 - Implement scroll offset for edit boxes. This makes it clearer when
   they're scrolled horizontally.

Piggyback an update of Kconfiglib to the latest version (no functional
changes).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-24 17:41:45 +02:00
Kumar Gala
40777af71e samples: openamp: Cleanup CMakeLists.txt files
Cleanup some whitespace/formatting in the CMakeLists.txt files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-24 10:17:56 -05:00
Kumar Gala
e09484f793 boards: arm: lpcxpresso54114: Remove sample specific defconfig setting
Setting of CONFIG_HEAP_MEM_POOL_SIZE was done in the board defconfig
because open-amp was doing recursive builds and setting it the
defconfig made sure all builds were consistent.  However, now that we
don't do recursive builds this will get properly picked by from the
sample specific conf file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-24 10:17:56 -05:00
Punit Vara
ba8c8c3ceb tests: mslab_threadsafe: Check for return value
Check return value for k_mem_slab_alloc()

issue: #6693

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-05-24 10:56:58 -04:00
Aurelien Jarno
80a9b02200 drivers: usb_dc_stm32: enable VDDUSB on STM32L4x2
The STM32L4x2 SoCs need to control the isolation of the USB features
from VDDUSB. This is done through the PWR_CR2 bit USV, however the
current code checks for the PWR_CR2_PVME1 bit instead, which is only
available on Cat. 3 devices. This bug is also present int the HAL and
likely copied from there.

Replace the check by PWR_CR2_USV instead.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-05-24 09:42:30 -05:00
Aurelien Jarno
b66ecc5765 ext: hal: stm32cube: fix stm32l4xx VDDUSB supply control
The STM32L4x2 SoCs need to control the isolation of the USB features
from VDDUSB. This is done through the PWR_CR2 bit USV. The STM32L4 HAL
in stm32l4xx_ll_pwr.h wrongly checks for the PWR_CR2_PVME1 bit, which
is only available on Cat. 3 devices. Replace the check by PWR_CR2_USV
like it is already done in stm32l4xx_hal_pwr_ex.c.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-05-24 09:42:30 -05:00
Aurelien Jarno
509e6964cc arch: stm32l432: add support for USB controller
The STM32L432 SoC has a standard non-OTG USB controller. Add an entry
for it in stm32l432.dtsi and add the corresponding DTS fixup entries.
The controller is kept disabled and should be enabled at the board
level.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-05-24 09:42:30 -05:00
Aurelien Jarno
dc01b99068 arch: stm32l4: only enable USB OTG on SoCs supporting it
USB OTG is currently enable for the whole STM32L4 family, while only a
few of them actually support it:

- STM32L475, STM32L476 and STM32L496 have an OTG controller
- STM32L432, STM32L433 and STM32L452 have an USB controller
- STM32L431, STM32L451 and STM32L471 do not have any USB controller

Fix that by moving the DT entry from stm32l4.dtsi to stm32l475.dtsi
and by adding a #ifdef #endif around the corresponding DTS fixup
entries.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-05-24 09:42:30 -05:00
Kumar Gala
4e8438bc0e ext: open-amp: Change build integration so its not recursive
With recent changes to open-amp we can now include and build it directly
as a zephyr library rather than doing a recursive make.  We remove
ext/lib/ipc/open-amp.cmake as part of this change and introduce a
Kconfig option for open-amp.

Fixes: #7673

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-24 09:18:47 -05:00
Kumar Gala
e3e8c83bd9 ext: open-amp: Update import of open-amp
Pull in a slightly more recent version of open-amp with changes
to the build system to improve integration with Zephyr.  The recent
changes let us embedded open-amp without having to use recursive
building.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-24 09:18:47 -05:00
Kumar Gala
6a86b02642 ext: open-amp: move open-amp down one dir
Move open-amp to be in ext/lib/ipc/open-amp/open-amp.  This allows us to
be Zephyr specific files and config like README (for import),
CMakeLists.txt file, Kconfig, etc in ext/lib/ipc/open-amp/ that don't
conflict with any files that might have the same name in
ext/lib/ipc/open-amp/open-amp.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-24 09:18:47 -05:00