Commit graph

47391 commits

Author SHA1 Message Date
Anas Nashif f336a8ea1b soc: intel_adsp: set trace size to non-zero
Looks like those two SoCs still had old header information depending on
Kconfig from SOF, remove those and set trace size directly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-12 20:53:40 -05:00
Eden Desta fa6ac271ec Update can_common: Check bitrate is greater than 0
Ensure bitrate is greater than 0 so the program does not fault when RESET nmt command is sent
2021-01-12 15:11:18 -06:00
Giancarlo Stasi af4c1cf58e drivers/timer: stm32_lptim: Fix stm32 ll header list
LPTIM stm32 ll header list was not adequate for debug builds.
Add _system.

Signed-off-by: Giancarlo Stasi <giancarlo.stasi.co@gmail.com>
2021-01-12 15:09:16 -06:00
Henrik Brix Andersen 7aeb3df5c6 drivers: pwm: fix compilation with CONFIG_PWM_CAPTURE=n
Fix compilation with pwm.h with CONFIG_PWM_CAPTURE=n.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-12 15:55:43 -05:00
Henrik Brix Andersen 90825a8812 tests: drivers: pwm: add PWM loopback test
Add test cases for the PWM capture API using PWM signal loopback.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-12 19:43:06 +01:00
Henrik Brix Andersen 54fed42f23 boards: arm: frdm_k64f: enable FlexTimer 0 as PWM
Enable FlexTimer 0 (FTM0) as PWM and setup PTC1 as FTM0 channel 0 for
use in PWM loopback test.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-12 19:43:06 +01:00
Henrik Brix Andersen 38279ef365 drivers: pwm: mcux_ftm: add PWM capure support
Add PWM capture support to the NXP MCUX FlexTimer driver.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-12 19:43:06 +01:00
Henrik Brix Andersen 9259fb4c77 MAINTAINERS: add myself as collaborator on PWM
Add myself as collaborator on the PWM code.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-12 19:43:06 +01:00
Henrik Brix Andersen 714b6b15ba CODEOWNERS: take ownership of PWM capture helper functions
Take ownership of the PWM capture helper functions.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-12 19:43:06 +01:00
Henrik Brix Andersen 77b8440fd1 drivers: pwm: add API for capturing pwm pulse width and period
Extend the PWM API with optional API functions for capturing PWM pulse
width and period cycles.

Fixes #26026.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-12 19:43:06 +01:00
Peter Bigot 92324d9a4d doc: dts: update howtos with new API
Document the use of DEVICE_DT_GET() to fetch device pointers at
compile time, and update the documentation on defining device
instances to use the devicetree macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-12 12:19:15 -06:00
Henrik Brix Andersen 5f35ee74b9 samples: canbus: canopen: mark program download test as build-only
Mark the CANopen sample with program download support as build-only
since it depends on MCUboot being flashed to the board prior to the
generated application firmware image.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-12 11:59:19 -06:00
Christian Taedcke 331e8e4645 soc: silabs: Replace defconfig singe-symbol 'if's with 'depends on'
All other silabs_exx32 socs already have this change applied, only
efr32bg13p was missing. This is now done, so all silabs_exx32 are
similar.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2021-01-12 11:52:46 -06:00
Christian Taedcke 1c44e59765 soc: silabs: Enable SPI_GECKO if SPI is enabled
This is now done for all SiLabs EXX32 SOCs in the same way.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2021-01-12 11:52:46 -06:00
Alexander Wachter d7a5b9f43d drivers: can: flexcan: Fix incorrect timing.
The timing values need to be subtracted by one.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2021-01-12 09:34:45 -06:00
Kumar Gala 86e98f0894 device: deprecate DEVICE_AND_API_INIT
Make DEVICE_AND_API_INIT deprecated in favor of DEVICE_DT_INST_DEFINE
or DEVICE_DEFINE.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-01-12 08:31:12 -06:00
Jingru Wang d1665d32f4 gcov: Add coverage support for arc nsim platform
* add toolchain abstraction for coverage
* add select HAS_COVERAGE_SUPPORT to kconfig
* port gcov linker code to CKake for arc
* give user permission to gcov bss section
* expand the size of iccm and dccm to 1M

Signed-off-by: Jingru Wang <jingru@synopsys.com>
2021-01-12 07:16:19 -05:00
Carlo Caione e710d36f77 aarch64: mmu: Enable CONFIG_MMU
Enable CONFIG_MMU for AArch64 and add the new arch_mem_map() required
function.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-01-12 06:51:09 -05:00
Carlo Caione 6a3401d6be aarch64: mmu: Fix variable types
Before hooking up the MMU driver code to the Zephyr MMU core code it's
better to match the expected variable types of the two parts.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-01-12 06:51:09 -05:00
Carlo Caione 0a0061d901 aarch64: mmu: Do not assume a single set of pagetables is used
The MMU code is currently assuming that Zephyr only uses one single set
of page tables shared by kernel and user threads. This could possibly be
not longer true in the future when multiple set of page tables can be
present and swapped at run-time.

With this patch a new arm_mmu_ptables struct is introduced that is used
to host a buffer pointing to the memory region containing the page
tables and the helper variables used to manage the page tables. This new
struct is then used by the ARM64 MMU code instead of assuming that the
kernel page tables are the only ones present.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-01-12 06:51:09 -05:00
Carlo Caione 1a4a73da97 aarch64: mmu: Makes memory mapping functions more generic
The ARM64 MMU code used to create the page tables is strictly tied to
the custom arm_mmu_region struct. To be able to hook up this code to the
Zephyr MMU APIs we need to make it more generic.

This patch makes the mapping function more generic and creates a new
helper function add_arm_mmu_region() to map the regions defined by the
old arm_mmu_region structs using this new generic function.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-01-12 06:51:09 -05:00
Carlo Caione 2581009c3e aarch64: mmu: Move xlat tables to one single array
In the current code the base xlat table is a standalone array. This is
done because we know at compile time the size of this table so we can
allocate the correct size and save a bit of memory. All the other xlat
tables are statically allocated in a different array with full size.

With this patch we move all the page tables in one single array,
including the base table. This is probably going to waste a bit of space
but it makes easier to:

- have all the page tables mapped in one single contiguous memory region
  instead of having to take care of two different arrays in two
  different locations
- duplicate the page tables more quickly if we need to
- use a pre-allocated space to host the page tables
- use a pre-computed set of page tables saved in a contiguous memory
  region

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-01-12 06:51:09 -05:00
Michał Narajowski 419d2aa85b Bluetooth: Mesh: Fix heartbeat subscription tests
MESH/NODE/CFG/HBS/BV-01-C expects the MinHops to be 0x7f after
disabling subscription, but 0x00 for subsequent Get requests.

MESH/NODE/CFG/HBS/BV-02-C expects us to return previous
count value and then reset it to 0.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-01-12 06:49:38 -05:00
Gerard Marull-Paretas 084c810820 drivers: clock_control: add support for PLL3 on STM32 H7
Add support for enabling and configuring PLL3 on STM32 H7 series. PLL3
is used as a clock source by certain peripherals, e.g. LTDC.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-01-12 06:49:10 -05:00
Gerard Marull-Paretas 3c1ef8852e drivers: clock_control: provide function to compute PLL VCO input range
Provide a utility function to compute PLL VCO input range so that it
can be re-used for other PLLs.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-01-12 06:49:10 -05:00
Alexandre Bourdiol b6b77312ee drivers: flash: flash_stm32h7x.c: manage bank1/2 discontinuity
When flash is Dualbank and flash size is lower than 512K,
then there is a discontinuity between bank1 and bank2.
Also take into account bank swap capability.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-01-12 06:48:47 -05:00
Erwan Gouriou 37c7b89e43 drivers/serial: stm32: Force oversampling value
When setting baudrate register, baudrate value is computed according
to the oversampling given value, which is default boot time
value (16).
In case oversampling value has been changed by bootloader (as in case
of TFM bootloader), a desynchronsation happens between OVR and BRR
values and the ouptut baudarate is incorrect.
For oversampling register before setting the baudrate to avoid this
situation.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-01-12 06:48:16 -05:00
Henrik Brix Andersen 4b7a71962f boards: arm: twr_ke18f: only enable HW stack protection if !userspace
Only enable hardware stack protection by default on the NXP TWR-K18F
development board if userspace is not enabled.

The NXP KE1xF SoC has 8 MPU regions, which is insufficient for using HW
stack protection and userspace simultaneously.

Fixes bc9a498bdf.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-12 06:47:33 -05:00
Emil Gydesen d661eb7605 net: tcp2: Fixed IS_ENABLED check for NET_TCP_MAX_SEND_WINDOW_SIZE
The #if statement used IS_ENABLED to check if it was defined.
IS_ENABLED will only return true if the value is 1, and false otherwise.
If the NET_TCP_MAX_SEND_WINDOW_SIZE value would be e.g. 8, then the
check would fail.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-01-12 13:40:42 +02:00
Jukka Rissanen 408a6ceff3 tests: net: tcp2: Add tests for TCP recv data queueing
Make sure that received and out-of-order TCP segments are queued
until we receive proper segments.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-01-12 13:40:05 +02:00
Jukka Rissanen ef801886b6 net: tcp2: Queue received out-of-order data
If we receive data that is out-of-order, queue sequential
TCP segments until we have received earlier segment or a timeout
happens.

Note that we only queue data sequentially in current version i.e.,
there should be no holes in the queue. For example, if we receive
SEQs 5,4,3,6 and are waiting SEQ 2, the data in segments 3,4,5,6 is
queued (in this order), and then given to application when we receive
SEQ 2. But if we receive SEQs 5,4,3,7 then the SEQ 7 is discarded
because the list would not be sequential as number 6 is be missing.

Fixes #30364

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-01-12 13:40:05 +02:00
chao an 1027b0e4f0 Bluetooth: host: add support for unregister scanner callback
This is a pairing function with bt_le_scan_cb_register()
to used for remove the scanner callback from callback list.

Signed-off-by: chao an <anchao@xiaomi.com>
2021-01-12 12:31:00 +02:00
chao.an bc7e86b9ec Bluetooth: host: Unified namespace of hci event
BT_HCI_EV_LE_REMOTE_FEAT_COMPLETE ->
BT_HCI_EVT_LE_REMOTE_FEAT_COMPLETE

Signed-off-by: chao an <anchao@xiaomi.com>
2021-01-12 12:30:11 +02:00
Marc Herbert 43187e2723 doc Makefile: convert to a real Makefile to get rid of duplication
Zero user interface or functional change.

Also change undocumented cmake -H option to documented -S
https://stackoverflow.com/questions/31090821/what-does-the-h-option-means-for-cmake

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-11 19:27:06 -05:00
Marc Herbert 2fd1d3ca07 doc-build.yml: add top-level Makefile
Dunno why the top-level Makefile is doc/ specific but it is.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-11 19:27:06 -05:00
Nicolas VINCENT eb534d39d2 driver: uart stm32: Check irq enabled in API calls
When calling irq_rx_ready or irq_tx_ready API, return the logical AND
between the irq status and the enable of that irq.

Signed-off-by: Nicolas VINCENT <nicolas.vincent@vossloh.com>
2021-01-11 16:55:29 -05:00
Erwan Gouriou 4c514b39df dts/arm: st: Fix use of "st,mem2mem" dma property
"st,mem2mem" property is supposed to be limited to dma-v1.
Remove its use in dma-v2 components.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-01-11 16:49:39 -05:00
Erwan Gouriou 60e10dadce dts/arm/st: stm32h7: Fix dma2 interrupts on STM32H7 series
Fix DMA2 Interrupts numbers likely due to copy/paste issue.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-01-11 16:49:39 -05:00
Erwan Gouriou b226f1d446 drivers/dma: stm32: Base Konfig symbols on dts compatible status
In order to simplify the handling of DMA_STM32_V1/V2 and DMAMUX_STM32
symbols, set them directly based on related compatible status.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-01-11 16:49:39 -05:00
Erwan Gouriou a214f41992 dts/arm/st: Split "st,stm32-dma" compatible into -v1 and -v2
2 versions of DMA hardware blocks could be found across stm32 series.
In order to simplify the handling of matching Kconfig symbols,
make this visible in dts files by creating "st,stm32-dma-v1" and
"st,stm32-dma-v2" and set them accordingly in dtsi files.

Duplicate and update related bindings to reflect that new state.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-01-11 16:49:39 -05:00
Anas Nashif 67d8738790 samples: audio: sof: add cavs25
We are now able to build cavs25.
add all board to integration platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-11 16:13:25 -05:00
Anas Nashif 5dae7b6059 modules: update SOF module to latest upstream
Update to 551bb2d95 of SOF tree which has few relevant bug fixes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-11 16:13:25 -05:00
Aastha Grover b644432720 boards: x86: acrn : Add configurations for acrn_ehl_crb
Adding acrn configurations specific to the platform
on which acrn boots zephyr, Only the EHL specifc
configurations for now. Keeping the HW clock frequency to
1900Mhz for EHL and using the new APIc timer driver.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2021-01-11 16:11:59 -05:00
Guennadi Liakhovetski cf005546ad bootloader: use ceiling_fraction() instead of open-coding it
Use the existing ceiling_fraction() function instead of open-
coding it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-11 16:10:23 -05:00
Guennadi Liakhovetski 44bf4a124b cavs: (cosmetic) remove redundant LPRAM_* macros
LPRAM_BASE and LPRAM_SIZE are duplicates of LP_SRAM_BASE and
LP_SRAM_SIZE respectively. Remove them and use LP_SRAM_*
consistently everywhere.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-11 16:10:23 -05:00
Guennadi Liakhovetski 7242b567fc cavs: fix LSPGISTS and LSPGCTL access
On cAVS 1.8, 2.0 and 2.5 LSPGISTS and LSPGCTL are located in a
different shim register range, they cannot be accessed, using the
usual SHIM_BASE offset.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-11 16:10:23 -05:00
Guennadi Liakhovetski c5a763f607 cavs: remove unused mcuboot support
CONFIG_BOOTLOADER_MCUBOOT is never used in cAVS builds, remove
code, supposedly supporting it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-11 16:10:23 -05:00
Guennadi Liakhovetski 8a9d2ded2f cavs_v25: fix copy-pasted definitions
shim.h on cAVS 2.5 contains register definitions, copy-pasted
from other architectures. Fix them to correct values.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-11 16:10:23 -05:00
Guennadi Liakhovetski 2a6c70ab19 cavs_v25: switch over to Tigerlake H configuration
Tigerlake H has less RAM and fewer cores. Both should be
supported, selectable at the board level. For now use the H
configuration as more readily available for testing.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-11 16:10:23 -05:00
Guennadi Liakhovetski 183076289d cavs_v18, v20, v25: calculate trace base address correctly
RAM window layout differs between cAVS versions. Fix apparent
copy-paste definition blocks to match cAVS 1.8, 2.0 and 2.5.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-11 16:10:23 -05:00