Commit graph

47391 commits

Author SHA1 Message Date
Peter Bigot 9e5b50afc8 tests: cbprintf: avoid checkpatch diagnostic
checkpatch wants parameters to IS_ENABLED() to be Kconfig constants,
i.e. ones that start with CONFIG_.  Avoid the whinage.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-07 14:02:06 +01:00
Peter Bigot 5f493c669d tests: cbprintf: make skip messages consistent
TC_PRINTF doesn't append a newline, so the skip messages sometimes ran
into the test result message.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-07 14:02:06 +01:00
Peter Bigot 928183b8ca tests: cbprintf: sanitize language
Replace SANITYCHECK flag with TWISTER.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-07 14:02:06 +01:00
Joakim Andersson 577cd82b0d Bluetooth: host: Fix crash when receiving response after ATT timeout
Fix crash in ATT when the response for a request is received after
the ATT timeout has fired and the ATT channel has been detached.
Add similar handling for all ATT channel operations.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-01-07 13:51:18 +01:00
Lingao Meng 8b54f08a69 drivers: bluetooth: Add discard mechanism to avoid waiting timeout
The Bluetooth receiving thread may not be able to process broadcast
packets because the system API(bt_hci_cmd_send_sync) is in block state.
If HCI driver is still waiting buffer for adv report, an assertion will
be triggered.

Fixes: #30955

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-01-07 14:44:13 +02:00
Peter Bigot d510f1f84d net: if: tweak DAD and RS timeout handling
Both RS and DAD timeouts are simplified because the delay is a
constant, and by construction the list of timeouts is in increasing
time remaining.

Refactor to avoid repeating the expression that represents the time
until DAD state expires.  Uniformly use unsigned operands in deadline
calculation.

Note a case where the racy idiom for retaining an existing timeout is
required in the current work API, but can be replaced with a robust
solution in the proposed new API (the reschedule API replaces any
existing pending update, but the schedule API will leave an existing
scheduled submission in place).

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-07 11:14:38 +02:00
Peter Bigot 4882dd69af net: if: fix error in calculating router expiration
The existing implementation is inconsistent in that checking for
expired routers when a timeout is processed detects end-of-life
correctly (when the remaining duration exceeds the signed maximum),
but the calculation of time remaining before expiration uses only
unsigned calculation.  So when the set of routers is changed the newly
calculated timeout will not recognize routers that have expired, and
so those routers expired late.  In the worst case if the only
remaining router had expired the timer may be set for almost two
months in the future.

Refactor to calculate remaining time in one place and as a signed
value.  Change a function name to more clearly reflect what it does.
Avoid unnecessary race conditions in k_work API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-07 11:14:38 +02:00
Peter Bigot acd43cbaac net: timeout: refactor to fix multiple problems
The net_timeout structure is documented to exist because of behavior
that is no longer true, i.e. that `k_delayed_work_submit()` supports
only delays up to INT32_MAX milliseconds.  Nonetheless, use of 32-bit
timestamps within the work handlers mean the restriction is still
present.

This infrastructure is currently used for two timers with long
durations:
* address for IPv6 addresses
* prefix for IPv6 prefixes

The handling of rollover was subtly different between these: address
wraps reset the start time while prefix wraps did not.

The calculation of remaining time in ipv6_nbr was incorrect when the
original requested time in seconds was a multiple of
NET_TIMEOUT_MAX_VALUE: the remainder value would be zero while the
wrap counter was positive, causing the calculation to indicate no time
remained.

The maximum value was set to allow a 100 ms latency between elapse of
the deadline and assessment of a given timer, but detection of
rollover assumed that the captured time in the work handler was
precisely the expected deadline, which is unlikely to be true.  Use of
the shared system work queue also risks observed latency exceeding 100
ms.  These calculations could produce delays to next event that
exceeded the maximum delay, which introduced special cases.

Refactor so all operations that use this structure are encapsulated
into API that is documented and has a full-coverage unit test.  Switch
to the standard mechanism of detecting completed deadlines by
calculating the signed difference between the deadline and the current
time, which eliminates some special cases.

Uniformly rely on the scanning the set of timers to determine the next
deadline, rather than assuming that the most recent update is always
next.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-07 11:14:38 +02:00
Jordan Yates 9f95d8d029 net: buf: convert #define to static inline
Swap the `net_buf_*` -> `net_buf_simple_*` conversion `#define`s to
`static inline` functions. This is to provide better type checking on
the use of these functions.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-01-07 10:40:48 +02:00
Akseli Peltola 3bcb1efc33 modem: fix socket descriptor leak
z_free_fd() is called twice then you close(). For example in ublox sara
r4 driver offload_close() calls modem_socket_put() where z_free_fd() is
called first time. Then this same function is called another time in
socket.c in z_impl_zsock_close() after this function has called
offload_close() in ublox sara r4 driver. This causes socket
descriptor leak.

Fixes #26819

Signed-off-by: Akseli Peltola <peltsu1324@gmail.com>
2021-01-07 10:36:19 +02:00
Peter Bigot b34d055926 drivers: flash: spi_nor: correct log message
Flash size is specified in bits by SFDP and devicetree, but the stored
flash size is in bytes.  Correct the divisor.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-06 16:01:04 -06:00
Vinayak Kariappa Chettimada db5270bd93 Bluetooth: controller: nRF53x: SWI mapping should use SOC define
SWI IRQ line mapping for nRF5340 shall use
CONFIG_SOC_NRF5340_CPUNET for conditional compilation
instead of the board define, so as to allow new boards to
use the BLE controller implementation.

Fixes #30488.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-06 16:25:52 +01:00
Frank Li d7c2f8a40a samples: video: Add OV7725 video capture sample
Add the ov7725 senser example,
which can run normally on mm_swiftio.

Signed-off-by: Frank Li <lgl88911@163.com>
2021-01-06 08:33:38 -06:00
Frank Li 6bf71cba24 boards: mm_swiftio: add camera support
Add camera support, use OV7725 CMOS sensor.

Signed-off-by: Frank Li <lgl88911@163.com>
2021-01-06 08:33:38 -06:00
Frank Li 8ce383401b boards: mm_swiftio: modify to follow code style
Move the unrelated whitespace and
Modify line break alignment.

Signed-off-by: Frank Li <lgl88911@163.com>
2021-01-06 08:33:38 -06:00
Frank Li e80506b754 drivers: video: ov7725: add sensor driver for ov7725
This patch adds the driver for Omnivision OV7725
Color CMOS VGA Sensor.

The driver currently provides a simple capture
function, the output format only provides
RGB565,640x480.

Signed-off-by: Frank Li <lgl88911@163.com>
2021-01-06 08:33:38 -06:00
Carlo Caione 1d68c48786 aarch64: mmu: Fix typo in mask definition
Fix typo in mask definition (s/UPPER/LOWER)

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-01-06 08:18:27 -06:00
Francois Ramu 536f0f5acb boards: arm: stm32g4xx add rtc feature on the nucleo board
This patch includes the rtc in the doc for the
nucleo_g474re and nucleo_g431rb boards
from STMicroelectronics

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-01-06 08:09:47 -06:00
Francois Ramu d695746ee6 soc: arm: stm32g4 add rtc feature on this serie
This patch enables the rtc clock on the stm32g4 soc
from STMicroelectronics.
Even if the set by default (reset value of theRCC_APB1ENR)
the bit is marked as 1.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-01-06 08:09:47 -06:00
Francois Ramu 5291565fef boards: arm: stm32g071 add rtc feature on the nucleo board
This patch enables the rtc so that the testcase
tests/drivers/counter/counter_basic_api
can run on this nucleo_g071rb board
also when running sanity check

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-01-06 08:09:47 -06:00
Francois Ramu f3c681166b drivers: clock_control: stm32g0 soc enables the PWR clock
After system reset, the PWR interface clock must be enabled
by setting the PWREN bit of the RCC_APBENR1
This sequence is needed to use the RTC.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-01-06 08:09:47 -06:00
Francois Ramu f58f6b8cfb soc: arm: stm32g0 add rtc feature on this serie
This patch enables the rtc clock on the stm32g0 soc
from STMicroelectronics.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-01-06 08:09:47 -06:00
Francois Ramu c86aefd3bb drivers: counter: rtc for stm32g0 soc series
This patch set the EXTI line 19 as the RTC
on the stm32g0x serie from STMicroelectronics.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-01-06 08:09:47 -06:00
Martí Bolívar 5f926ed09a boards: nordic: remove unnecessary nrfjprog.py args
The --nrf-family argument has been unnnecessary since 6628a16
(" runners: nrfjprog: boilerplate and recover rework").

Remove a few stragglers that are still using it, to avoid it being
copy/pasted into other board definitions.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-01-06 07:54:55 -06:00
Anas Nashif 0a98147d04 ci: compliance: setup west modules
Setup a complete workspace with west. Some checks need access to
configured modules.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-06 07:53:46 -06:00
Anas Nashif 364129dc25 intel_adsp: disable IPM_INTEL_ADSP
We are using IPM_CAVS_IDC.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-06 07:53:46 -06:00
Anas Nashif f1dea627cc ci: fetch sof submodules
Fetch submodules needed to build with SOF.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-06 07:53:46 -06:00
Andy Ross 0c80862eb0 modules: Add Sound Open Firmware module
Add the Sound Open Firmware project as a Zephyr module under
modules/audio/sof.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-06 07:53:46 -06:00
Anas Nashif 42ef64744e boards: intel_adsp_cavs*: enable on SOF tagged apps
Allow building on SOF tagged apps.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-06 07:53:46 -06:00
Anas Nashif d9a39794c6 boards: up_squared_adsp: BOARD_UP_SQUARED_ADSP -> BOARD_INTEL_ADSP_CAVS15
Rename left over variable from up_squared to more generic adsp_cavs..

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-06 07:53:46 -06:00
Liam Girdwood efa794dbc5 samples/audio: Add Sound Open Firmware
Adds the Sound Open Firmware project, built as a Zephyr application,
under samples/subsys/sudio/sof.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-01-06 07:53:46 -06:00
Daniel Leung afefcd118f neural_net: intel_gna: convert driver to use device-tree
This converts the intel_gna driver to use device tree instead of
kconfig for device configuration.

Fixes #30872

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-01-06 05:59:21 -06:00
Daniel Leung 7312d361bc dts: intel_s1000: add GNA node
This adds the GNA node to the intel_s1000 SoC device tree
file.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-01-06 05:59:21 -06:00
Daniel Leung 2962d5370d dts: add binding for intel,gna
This adds the binding needed for the Intel GNA neural net
driver.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-01-06 05:59:21 -06:00
Kumar Gala 7b6fe47691 ci: Update docker image to v0.11.11 for SDK 0.12.0
Update the docker image we build with to grab SDK 0.12.0 in addition to
0.11.4.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-01-05 18:58:05 -05:00
Christian Taedcke c6c5a371a7 tests: adc: Add support for lpcxpresso55s28 in the ADC test
Add lpcxpresso55s28 board to the ADC test to prevent compilation issues.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2021-01-05 15:38:04 -06:00
Christian Taedcke 0371b867b8 boards: arm: Add LPCXpresso55S28 dev board
Add initial support for NXP LPCXpresso55S28 development board.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2021-01-05 15:38:04 -06:00
Christian Taedcke 7ecca2976e dts: arm: nxp: Add initial LPC55S28 devicetree
Add initial devicetree for the NXP LPC55S28.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2021-01-05 15:38:04 -06:00
Christian Taedcke ddf13a3256 soc: arm: nxp: Add LPC55S28 support
Add initial support for NXP LPC55S28.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2021-01-05 15:38:04 -06:00
Christian Taedcke 7780b44250 west.yml: Update NXP HAL to include LPC55S28 support
Pull in change to NXP HAL to include LPC55S28 SoC support.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2021-01-05 15:38:04 -06:00
Kumar Gala 4dd143f26f driver: i2c: npcx: Convert drivers to new DT device macros
Convert i2c npcx drivers from:

DEVICE_AND_API_INIT -> DEVICE_DT_DEFINE
DEVICE_GET -> DEVICE_DT_GET

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-01-05 13:19:32 -06:00
Enjia Mai 478ddde6cc tests: skip memory mapping execution testing of qemu_x86_64 coverage
Skip the memory mapping execution test case when code coverage enabled
for qemu_x86_64 platform. See issue #30434.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2021-01-05 10:32:38 -08:00
Enjia Mai 56f84b60ed tests: fix some issues when enabling coverage for qemu_x86_64
Fix some issues in linker.ld when enabling coverage report feature
for qemu_x86_64 platform:
1. Fix the gcov record data should not be in BSS section.
2. Fix some test case crash due to lack of memory page align before
gcov rodata.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2021-01-05 10:32:38 -08:00
Enjia Mai 8d5a22c3c1 tests: enable the code coverage report for qemu_x86_64
Enable the code coverage report for qemu_x86_64 platform.
See issue #17991 please.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2021-01-05 10:32:38 -08:00
Daniel Leung 0d7bdbc876 xtensa: use highest available EPC/EPS regs in restore context
There may be Xtensa SoCs which don't have high enough interrupt
levels for EPC6/EPS6 to exist in _restore_context. So changes
these to those which should be available according to the ISA
config file.

Fixes #30126

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-01-05 10:31:45 -08:00
Daniel Leung e36ef3e302 audio: intel_dmic: convert to use devicetree
This converts the intel_dmic driver to use devicetree.

Fixes #30870

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-01-05 12:08:51 -06:00
Daniel Leung e793e0871f boards: intel_s1000_crb: add a node for DMIC
This adds a node for the Intel DMIC driver to use.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-01-05 12:08:51 -06:00
Daniel Leung ab4a1238e3 dts: add a binding for Intel DMIC node
This adds a new binding for Intel Digital PDM Microphone node.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-01-05 12:08:51 -06:00
Henrik Brix Andersen 38ae2f9cda drivers: eeprom: mark the EEPROM API as stable
Mark the EEPROM API as stable for the upcoming Zephyr v2.5.0. The EEPROM
API was introduced in Zephyr v2.1.0 and has not seen any changes since.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-05 18:02:54 +01:00
Lukasz Majewski e33f756f0e board: ip_k66f: Update list of used (supported) features
The following features: 'i2c' and 'netif:eth' are now used in the
ip_k66f board. Let's mark them in the "supported:" section of the
ip_k66f.yaml.

The latter one is necessary as a prerequisite to run some tests (like
e.g. netif:eth is necessary to run network related ones).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-01-05 10:24:45 -06:00