Commit graph

48871 commits

Author SHA1 Message Date
Sylvio Alves 8a00e2c024 west.yml: update version to support SPI
fix build failure due to unknown symbol

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-02-22 08:17:04 -05:00
Sylvio Alves 679e36bf54 clock: esp32: fix wrong clock assert
guarantee proper clock bank is used

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-02-22 08:17:04 -05:00
Glauber Maroto Ferreira 74922049ba drivers: spi: esp32: add basic SPI master support
Include SPI master support for blocking and asynchronous calls.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-02-22 08:17:04 -05:00
Daniel Leung c0ee8c4a43 x86: use z_bss_zero and z_data_copy
Instead of doing these in assembly, use the common z_bss_zero()
and z_data_copy() C functions instead. This simplifies code
a bit and we won't miss any additions to these two functions
(if any) under x86 in the future (as x86_64 was actually not
clearing gcov bss area).

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-21 22:28:33 -05:00
Daniel Leung dd98de880a x86: move calling z_loapic_enable into z_x86_prep_c
This moves calling z_loapic_enable() from crt0.S into
z_x86_prep_c(). This is done so we can move BSS clearing
and data section copying inside z_x86_prep_c() as
these are needed before calling z_loapic_enable().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-21 22:28:33 -05:00
Kumar Gala 5a9f997a80 drivers: serial: stm32: Fix compile issues
The stm32 uart driver fails to build on certian platforms due to
changes introduced by:

commit 3c18bcbf77
Author: Francois Ramu <francois.ramu@st.com>
Date:   Wed Jan 27 10:27:33 2021 +0100

    drivers: serial: stm32 restore uart after lowpower

Fix this by adding some ifdef's around the code that is specific to the
given platforms that the code works on.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-21 22:28:16 -05:00
Fabio Baltieri 951c99c61a driver: uart_npcx: do not check for irq enable in irq ready functions
Current implementation of uart_npcx_irq_{tx,rx}_ready always returns
false if the respective interrupt enable bit is not set, which means
that the api cannot be used if the interrupts are temporarily disabled
for whatever reasons, breaking patterns such as [1].

Other uart drivers also seems to not have this check, this patch removes
it from the NPCX driver too.

[1] https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/console/uart_console.c#L549

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2021-02-21 22:27:45 -05:00
Ioannis Glaropoulos c4bedf30cc samples: tfm integration: rename qemu targets after refactor
Now that we have consolidated tf-m signing, the combined
binary is always named tfm_merged, so we need to modify
the QEMU targets in the tfm-integration samples.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-02-21 18:44:18 +03:00
Øyvind Rønningstad 5137135ead boards: Consolidate all TFM signing code
Place the new signing code in the TFM module CMakeLists.txt.
Make some small tweaks and add a sentence to the docs.

In the process, make a few changes to the signing code:
- Change some names of files created.
- Minimize the number of files created.
- Use hex files instead of bin files. This is so we don't need to know
  the offset when creating hex files from bin files.

Also add signing for MCUBOOT_IMAGE_NUMBER=1 based on the code from the
v2m_musca_b1 board, though, this board does not build with =1 now
because of (I assume) some flash aliasing which places the S and NS
images 0x10000000 apart, where the manual algorithm places them next to
each other. It builds with =2, though.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-02-21 18:44:18 +03:00
Rafał Kuźnia d96c517bab west.yml: Update hal_nordic revision
The new revision fixes a problem with long build paths on Windows.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2021-02-19 22:40:21 -05:00
Mulin Chao 30a5424d0e tests: kernel: profiling: Add customized pm device policy handler.
Besides implementing a customized pm_policy_next_state() in the
application layer, a customized device policy handler of power
management, pm_policy_low_power_devices(), is also needed if
CONFIG_PM_POLICY_APP is enabled. This CL adds this function to prevent
build errors.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-02-19 22:39:53 -05:00
Mulin Chao 715efe25cd driver: uart: npcx: Add pm_deivce support for uart driver.
Since the uart device clock will be stopped after ec entered sleep or
deep sleep state and restore its clock automatically, there is no need
to implement code for suspending and resuming devices manually.

The driver still needs to check the current status of uart device when
it wants to change its power state to LOW or SUSPEND power state. It is
crucial to forbid ec enters sleep or deep sleep state when uart device
is busy with transmitting data. Or we will observe broken characters on
the uart console.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-02-19 22:39:53 -05:00
Mulin Chao 1f731c6c02 driver: soc: power: npcx: Add power managerment support.
This CL introduces power management driver that improves the efficiency
of ec operation by adjusting the chip’s power consumption to the level
of activity required by the application in npcx series.

The following list summarizes the main properties of the various chip
power states. Please refer the power.c file for more detail.

Main power states in npcx series include:
- Active: Core, RAM and modules operate at the clocks generated by PLL.
- Idle: Enter this state when the Core executes WFI or WFE instruction.
- Sleep: clock is stopped for most of modules but PLL is enabled.
- Deep Sleep: As Sleep mode but PLL is disabled.
- Standby: All power rails are turned off besides standby and battery
  power rails.

And this CL implements one power state, PM_STATE_SUSPEND_TO_IDLE, with
two sub-states for Zephyr power management system.
Sub-state 0 - "Deep Sleep" mode with “Instant” wake-up if residency
              time is greater or equal to 1 ms
Sub-state 1 - "Deep Sleep" mode with "Standard" wake-up if residency
              time is greater or equal to 201 ms

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-02-19 22:39:53 -05:00
Mulin Chao e5caae8e0a driver: timer: npcx: add system kernel timer support.
This CL introduces a kernel device driver implemented by the internal
64/32-bit timers in Nuvoton NPCX series. Via these two kinds of timer,
the driver provides an standard "system clock driver" interface.

It includes:
 - A system timer based on an ITIM64 (Internal 64-bit timer) instance,
   clocked by APB2 which freq is CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC.
 - Its prescaler is set to 1 and provide the kernel cycles reading
   without handling overflow mechanism.
 - A event timer based on an ITIM32 (Internal 32-bit timer) instance,
   clocked by LCLK which frequency is 32KHz and still activated when ec
   entered "idle/deep idle" power state for better power consumption.
 - Its prescaler is set to 1 and provide timeout event mechansim.
 - Compensate system timer which clock is gating for better power
   consumption after ec left"idle/deep idle" power state.

This CL passed starve, timer_api, and timer_monotonic test suites.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-02-19 22:39:53 -05:00
Alexandre Bourdiol f7738fad1b tests: drivers: spi: spi_loopback: add nucleo_wl55jc board
Add nucleo_wl55jc board support.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-02-19 22:39:24 -05:00
Alexandre Bourdiol 68f5626b64 boards/dts: add SPI support to nucleo_wl55jc board
Add SPI support to nucleo_wl55jc board

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-02-19 22:39:24 -05:00
Alexandre Bourdiol d98ce0b9d4 boards/dts: add i2c support to nucleo_wl55jc
Add I2C support to nucleo_wl55jc

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-02-19 22:39:24 -05:00
Alexandre Bourdiol 59ce5af11b drivers: i2c: add support of STM32WL
Add I2C support to STM32WL

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-02-19 22:39:24 -05:00
Alexandre Bourdiol 6663982fde boards: arm: add nucleo_wl55jc board support
Add support of nucleo_wl55jc board

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-02-19 22:39:24 -05:00
Alexandre Bourdiol 0ea63a5a17 soc: arm: st_stm32: add STM32WL support
Add STM32WL soc serie

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-02-19 22:39:24 -05:00
Alexandre Bourdiol 7d11f300b7 dts: arm: st: add STM32WL support
Add STM32WL55Xc device tree

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-02-19 22:39:24 -05:00
Alexandre Bourdiol 096c34114b drivers: interrupt_controller add STM32WL support
Add STM32WL support to interrupt_controller driver

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-02-19 22:39:24 -05:00
Alexandre Bourdiol 91b4350969 drivers: gpio add STM32WL support
Add STM32WL support to gpio driver

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-02-19 22:39:24 -05:00
Alexandre Bourdiol 6e5b0d01f5 drivers: clock_control: add STM32WL support
Add STM32WL support to clock_control driver

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-02-19 22:39:24 -05:00
Francois Ramu b1514d198b tests: subsys: power: add stm32 targets to the power_mgmt_soc test case
New stm32 nucleo boards with CONFIG_PM_DEVICE can pass this test.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-02-19 22:38:50 -05:00
Francois Ramu fc41846935 drivers: clock: stm32 clock control with low power modes
This will export the stm32_clock_control_init function
to restore the clocks after the low power modes.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-02-19 22:38:50 -05:00
Francois Ramu f561c87023 soc: arm: stm32 devices supporting low power modes
stm32wb and stm32l4 are devices which supports the low power
from the Kernel PM, so is the PM_DEVICE defined.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-02-19 22:38:50 -05:00
Francois Ramu 398d52de68 soc: arm: stm32l4 give a weak low power mode devices for policy
In case the policy is not available or defined by th application
the pm_policy_low_power_devices is still valid

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-02-19 22:38:50 -05:00
Francois Ramu d7fab9b0e9 soc: arm: stm32l4 low power mode restoring clocks
The clock configuration is restored by the stm32_clock_control_init
function of the clock_stm32_ll_common driver
when exiting the low power mode

Signed-off-by: Francois Ramu <francois.ramu@st.com>


Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-02-19 22:38:50 -05:00
Francois Ramu 3c18bcbf77 drivers: serial: stm32 restore uart after lowpower
This adds a function to control the uart device during lowpower modes

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-02-19 22:38:50 -05:00
Francois Ramu 930df38e23 soc: arm: stm32wb give a weak low power mode devices for policy
In case the policy is not available or defined by th application
the pm_policy_low_power_devices is still valid

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-02-19 22:38:50 -05:00
Francois Ramu 6e5eb88367 soc: arm: stm32wb low power mode restoring clocks
The clock configuration is restored by the stm32_clock_control_init
function of the clock_stm32_ll_common driver
when exiting the low power mode.
Keeping the stm32wbxx_ll_utils.h in case the PLL is used for wb.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-02-19 22:38:50 -05:00
Daniel Leung e0fe89cdda tests: fpu_sharing: allow board qemu_x86_lakemont
This adds qemu_x86_lakemont to the platform allow list
for the FPU sharing tests. Since Lakemont supports SSE3
and SSSE3, it is better to test them also.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-19 18:51:04 -05:00
Daniel Leung d2602de329 board: x86: add new board qemu_x86_lakemont
This adds a new board qemu_x86_lakemont for testing
the Lakemont SoC configuration.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-19 18:51:04 -05:00
Daniel Leung 78837c769a soc: x86: add Lakemont SoC
This adds a very basic SoC configuration for Intel Lakemont SoC.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-19 18:51:04 -05:00
Daniel Leung cd703ae9cf boards: x86/qemu: enable CPU flags for MMX/SSE
Tells QEMU to enable CPU flags corresponding to MMX/SSE
kconfigs.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-19 18:51:04 -05:00
Daniel Leung 9a189da03b x86: add kconfig CONFIG_X86_MEMMAP
This adds a new kconfig to enable the use of memory map.
This map can be populated automatically if
CONFIG_MULTIBOOT_MEMMAP=y or can be manually defined
via x86_memmap[].

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-19 18:51:04 -05:00
Daniel Leung c027494dba x86: add kconfig CONFIG_X86_PC_COMPATIBLE
This is an hidden option to indicate we are building for
PC-compatible devices (where there are BIOS, ACPI, etc.
which are standard on such devices).

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-19 18:51:04 -05:00
Kumar Gala 49f1e22a13 samples: portability: set integration_platforms to native_posix
Set integration_platforms on these samples to just native_posix.  This
should be sufficient to make sure these tests build and run.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-19 18:49:54 -05:00
Peter Bigot 1fa3447b4e shell: device_service: refine level output
Fix the order so that it reflects the actual initialization order,
rather than putting PRE_KERNEL initializations after APPLICATION.

Add SMP in the proper location.

Use the helper function to provide unique identifiers for "devices"
that don't have a device pointer (so don't have a name).

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-19 15:46:16 -05:00
Peter Bigot f0df72c269 shell: device_service: add dependency information
Refactor the output of device list to use standard API to retrieve the
list of devices, and to always display a status rather than hiding
disabled/failed devices.

Add API to associate a distinct identifier with any "device" that does
not have a name.

Where a device has requires dependencies display the devices on which
it depends.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-19 15:46:16 -05:00
Peter Bigot 9ef62d564d tests: devicetree: add test for devicetree node data
Verify that device dependencies are encoded into and retrievable from
the device structure.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-19 15:46:16 -05:00
Peter Bigot d554d34137 device: add post-process of elf file to manage device handles
Following the idiom used for system calls, add script support to read
the initial application binary to identify which devices are defined,
and to use their offset in the device array as their unique handle
rather than the externally-defined ordinal from devicetree.  The
device dependency arrays are updated to use these handles.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-19 15:46:16 -05:00
Peter Bigot 669bc6b86f device: inject device dependency information from devicetree nodes
Generate arrays of dependency information for each device.  If a
device definition is being constructed from devicetree these come from
the devicetree dependency information.  Additional dependencies may be
passed through using the DT_ macros.

Define flag values for device handles so we can partition the
dependency array into distinct sets, which include things it requires,
things it supports (may not be needed), and child nodes (not
implemented, may not be needed).

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-19 15:46:16 -05:00
Seppo Takalo 91869f3ba5 runners: jlink: Use specific target device for nrf9160DK
When proper target device is specified, instead of generic
Cortex-M33, JLinkGDBServer is able to flash the device on "load"
command.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2021-02-19 14:26:25 -06:00
Anas Nashif ff24090527 tests: filter default platforms
Do not attempt to build/run all tests. Emulation platforms should
primarily build kernel and architecture related tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-19 14:41:01 -05:00
Johann Fischer 9a3ebcccfa usb: hid: make config USB_DEVICE_HID menuconfig
This makes USB device support menu appear more tidy.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-19 14:39:26 -05:00
Johann Fischer dac91c0bdc usb: move USB Loopback class configuration to its own Kconfig
Move USB Loopback class configuration to its own Kconfig

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-19 14:39:26 -05:00
Johann Fischer 092a9de285 usb: move USB Bluetooth classes configuration to its own Kconfig
Move USB Bluetooth classes configuration to its own Kconfig.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-19 14:39:26 -05:00
Johann Fischer 12e32c2b70 usb: move USB MSC configuration to its own Kconfig file
Move USB MSC configuration to its own Kconfig file.

Align with other class designations and rename
mass_storage.c to msc.c

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-19 14:39:26 -05:00