Commit graph

41266 commits

Author SHA1 Message Date
Andrzej Głąbek cab631e00c boards: arm: nrf5340pdk: Fix i2c1 pin assignments
Pins p0.02/p0.03 that were assigned to the i2c1 node are NFC pins.
Use p1.02/p1.03 instead, which are routed to the standard I2C location
in the Arduino header.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-05-22 14:52:40 +02:00
Maureen Helm cec9735d8a boards: riscv: Conditionalize pinmuxes on rv32m1_vega board
Conditionalizes pinmuxes on associated driver configs (CONFIG_SERIAL,
CONFIG_I2C, etc.) for the rv32m1_vega board to avoid possible conflicts
between peripherals.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-22 14:51:07 +02:00
Emil Obalski 19f6ed02b8 usb: driver: Fix Nordic driver for fragmented control OUT transfers.
Nordic driver must allow read from control OUT endpoint by
itself. For data stage transactions with length > MPS (64Bytes)
this must be performed for each 64B + Residue data packet.

Residue - data packet with len < 64B.

The exact length of data transfer is known from wLength field
form setup packet in setup stage. Until now driver was incorrectly
initializing the length of the data stage and at some point will
not allow for next data stage.

This commit addresses the issue #23980.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-05-22 12:50:35 +02:00
Anas Nashif 77946fa835 sanitycheck: remove wrong message about --qemu-testing
--qemu-testing does not exist.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-21 22:47:36 -04:00
Peter Bigot b0d509bc0d boards: arm: nrf5340pdk: fix pin assignments
I2C1 used LED pins rather than the ones in the Arduino header
position.  SPI2 used Arduino D0 for both SCK and MOSI; replace all
pins with D11-D13 which are the standard location for SPI on the
Arduino header.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-21 22:30:25 +02:00
Daniel Leung 2887fbcccf x86: mmu: fix type mismatch of memory address in assert
In one of the ASSERT() statement, the PHYS_RAM_ADDR (alias
of DT_REG_ADDR()) may be interpreted by the compiler as
long long int when it's large than 0x7FFFFFFF, but is
paired with %x, resulting in compiler warning. Fix this
by type casting it to uintptr_t and use %lx instead.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-21 22:30:14 +02:00
Peter Bigot 726bff2353 tests: kernel: device: bypass device pm tests
The dummy driver never implemented device power management, so the
fact the not-implemented stub returned success was a false negative.
Verify the expected behavior now, leaving the test code in place for
when somebody provides a non-trivial PM control function.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-21 20:32:12 +02:00
Peter Bigot d99aa367f6 power: device: adapt to new behavior for devices with nop pm ctrl
For backwards compatibility ignore not-supported errors for devices
that don't support power management.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-21 20:32:12 +02:00
Peter Bigot de9ed4e6a1 kernel: sys_clock: update weak pm control function
The weak implementation returns 0 for all operations without doing
anything, which incorrectly suggests that an operation like
device_get_power_state() returned an accurate description of the
system clock power state.  Return -ENOTSUP instead.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-21 20:32:12 +02:00
Peter Bigot ae935dccdf device_pm: correct nop documented behavior
The device_pm_control_nop function is documented to always return zero
regardless of operation.  However, when device_get_power_state() is
invoked with this control function it returns success leaving the
output parameter state unmodified, which may not be a valid device
state.

Document and implement that the nop control function returns -ENOTSUP
always.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-21 20:32:12 +02:00
Martí Bolívar c0fcff9b7d dts: nrf5340_cpuapp: add cryptocell node
Add the missing node and bindings. This is a secure-mapped peripheral,
so do not add it to the common include file
nrf5340_cpuapp_common.dtsi.

Fixes: #25493
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-21 20:09:44 +02:00
Anas Nashif 2c8cb643bb templates: use correct label for Enhancement
enhancement -> Enhancement

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-21 13:21:09 -04:00
Krzysztof Chruscinski a719b8c5e4 drivers: timer: nrf: Remove RTC1 dependency
Removed RTC1 dependencies in the code. Single define picks the instance.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-05-21 17:43:08 +02:00
Krzysztof Chruscinski 699b717452 drivers: timer: nrf: Fix premature timeouts
If timeout is being overwrite exactly when previous one is expiring
then hardware event was cleared correctly but interrupt was already
triggered. Interrupt routine was assuming that compare event is set
and proceed with that assumption. However, in that corner case when
compare event was overwritten and event was cleared, that was not the
case.

As the outcome, timeout could be triggered prematurely. Fixed by
clearing pending interrupt after handling previous compare value.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-05-21 17:43:08 +02:00
Marek Pieta 775b2457d7 settings_fcb: Fix storing the data
Change fixes storing the data by adding missing write retry after
the last compression. Without the change error was returned instead
of retrying.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2020-05-21 17:42:20 +02:00
Peter Bigot bfb56c5e20 drivers: flash: nrf_qspi_nor: support read of sub-word lengths
mcuboot and possibly other tools read single byte values to determine
the state of objects.  Rather than fail to do the read of values too
short for this peripheral detect the situation and read into a stack
buffer that meets the length criteria, and on success copy the data
into the provided buffer.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-21 17:04:05 +02:00
Kumar Gala 2ef135dc23 samples: usb: audio: Fix building off sample with sanitycheck
The USB audio samples when added didn't have any tests: sections in the
sample.yaml so they would never get build on any platform as part of
sanitycheck.  Add the tests: section and limit the samples to build on
nrf52840dk_nrf52840 as that was the intended platform these samples
where initially developed for.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-21 16:55:27 +02:00
Ruslan Mstoi 56b65e43de scripts: gen_offset_header: add argument help text
Help text is set to documentation string of the script.

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-05-21 14:45:24 +02:00
Ruslan Mstoi 4695eb4e1d scripts: net: Fix incorrect error messages
If environment variables ZEPHYR_BASE or NET_TOOLS_BASE are unset, an
incorrect message is printed saying that "it is set, but it is not a
directory":

$ZEPHYR_BASE is unset
$ZEPHYR_BASE is set, but it is not a directory
$NET_TOOLS_BASE is unset, no net-tools found
$NET_TOOLS_BASE set, but it is not a directory

This patch fixes that issue.

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-05-21 14:45:07 +02:00
Ruslan Mstoi aa051857e5 x86: gen_idt.py: typo fix
Fix "consule" as "consult"

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-05-21 14:44:33 +02:00
Abhishek Shah f156057b20 dts: arm: Fix incorrect interrupt cells order
In aarch64 DTs, priority and flags cells have been swapped,
fix the same.

Correct interrupt property per the GIC binding document
looks like:
interrupts = <irq_type irq_num irq_flags irq_priority>;

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-05-21 13:56:00 +02:00
Wayne Ren bc6f11b730 drivers: arcv2_timer0: minor fix and optimization for SMP case
* still need to clear IP bit in timer irq handler

* last_time should be aligned to ticks, old code will miss some
cycles which are about (curret_time - last_time) % CYC_PER_TICK

* in timeout set, shorten the delay needed when tick is 0, this
 will improve the response of timer irq

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-05-21 12:37:41 +02:00
Wayne Ren ac5dc1dd34 drivers: arcv2_timer0: back to use level triggered irq
the pulse triggered timer irq doesn't work for all targets. In
iotdk, we found the clear of IP bit will clear int request
when elapsed called in thread context. So come back to level
triggered way which is supported in all targets, and use the sw
triggered irq to remember the irq request which may be cleared
in non timer int handler.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-05-21 12:37:41 +02:00
Wayne Ren f511d51ca3 drivers: arcv2_timer0: rename overflow_cyc to overflow_cycles
* rename overflow_cyc to overflow_cycles for better understanding
* use MIN macro to replace if .. else ..
* typo fix in comments

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-05-21 12:37:41 +02:00
Emil Obalski 2a2d92f9c2 usb: driver: nordic: Unlock mutex in case of error.
Mutex that was previously locked must be unlocked in case
of an error.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-05-21 11:02:02 +02:00
Joel Westerberg b2da4e24cb tracing: cpu_stats: add missing macro
add missing macro K_MSEC() for CONFIG_TRACING_CPU_STATS_INTERVAL

Signed-off-by: Joel Westerberg <joel@teenage.engineering>
2020-05-21 11:01:50 +02:00
Maureen Helm 164434a01e tests: adc: Configure adc_api test for frdm_k82f board
Configures the adc api test to use the arduino header A2 pin on the
frdm_k82f board. This follows frdm_k64f and frdm_kw41z boards, which
also use the arduino header A2 pin for the test.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-21 11:01:18 +02:00
Maureen Helm 7197e7c8fc boards: frdm_k82f: Enable adc instance and pinmux
Enables the adc instance and pinmux associated with arduino header pin
A2 on the frdm_k82 board. Adds adc to the board yaml to ensure we build
adc samples/tests for this board in CI.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-21 11:01:18 +02:00
Maureen Helm d9a0dd3967 dts: arm: Add missing adc property for kinetis k8x and kv5x socs
Adds the required #io-channel-cells property to kinetis k8x and kv5x
socs. We are now consistently defining this property for all
nxp,kinetis-adc16 compatible nodes.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-21 11:01:18 +02:00
Wayne Ren e0470d0f93 tests: add a workaround for arc emsdp
arc emsdp's console will use irq 108/107 which will
conflict with irqs used in tests (emsdp has 112 irqs),
so add a workaround for emsdp.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-05-21 10:59:36 +02:00
Wayne Ren 74be178386 soc: fix the int numbers of emsdp
emsdp is a FPGA based platform, can be loaded with different
configurations. Different configuration have different
interrupts:

* em5d, em7d and em11d have 111 interrupts
* em4 and em6 have 113 interrupts
* em7d_esp has 112 interrupts

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-05-21 10:59:36 +02:00
Wayne Ren d72d903581 boards: fix the sys ticks per second for emsk
As a slow FPGA platform with max. freq < 25 Mhz,
the default CON_SYS_CLOCK_TICKS_PER_SEC=10000 is
not suitable. CON_SYS_CLOCK_TICKS_PER_SEC=100 is
a better value.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-05-21 10:58:40 +02:00
Martí Bolívar 3ea8293ef0 Revert "cmake: introduction of ZephyrExtension package"
This reverts commit ac898bc49e.

This commit was merged by mistake, but in a way that was against the
decision of the TSC on May 20, 2020, which was to wait a week to let
people digest befor merging.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-21 00:33:06 +02:00
Daniel Leung 251cb61e20 x86_64: instrument code for timing information
On x86_64, the arch_timing_* variables are not set which
results in incorrect values being used in the timing_info
benchmarks. So instrument the code for those values.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-20 22:36:04 +02:00
Daniel Leung 625b5f5a49 tests: timing_info: need to calibrate TSC frequency on x86
For x86, TSC is being used to gather timing information. However,
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC is not the same as TSC
frequency when HPET (or other) timer is used. So use the system
clock to calibrate the TSC frequency so we can use it to
calculate timing information.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-20 22:34:39 +02:00
Andrew Boie ffbc75f95d docs: fix user mode sidebar
The sidebar for User Mode wasn't set up correctly and
it wasn't obvious that there are linked sub-pages with
design details about memory domains, system calls, kernel
objects, and so forth.

Split the introductory material into its own overview
page and set up the table of contents properly.

The text of the threat model, high level policy details,
and constraints sections is unchanged.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-05-20 20:08:54 +02:00
Torsten Rasmussen ac898bc49e cmake: introduction of ZephyrExtension package
The ZephyrExtension package allow downstream users to extend the current
Zephyr package.
A ZephyrExtension package allows for setting of additional DTS_ROOT,
BOARD_ROOT, and similar variables without having to patch Zephyr repo.

The repository or folder containing the ZephyrExtension package must be
on toplevel in the Zephyr workspace.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-20 19:27:15 +02:00
Henrik Brix Andersen 784c4728b5 drivers: pwm: mcux_ftm: allow configuring the clock prescaler
Allow configuring the clock prescaler divider for the NXP Kinetis
FlexTimer. Setting the prescaler to a lower value allows for much
higher resolution/accuracy for the generated PWM waveforms.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-05-20 19:03:14 +02:00
Andrei Gansari 99dcc2a3b9 boards: lpcxpresso55s69 add Arduino mapping
Map Arduino interface to LPCXpresso55S69 pins.
Also tell which SPI interface is used by Arduino.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-05-20 19:02:36 +02:00
Andrei Gansari d9315ba44b boards: lpcxpresso55s69 add mikroBUS mapping
Map mikroBUS interface to LPCXpresso55S69 pins.
Also tell which SPI interface is used by mikroBUS.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-05-20 19:02:36 +02:00
Andrei Gansari 714211acfb boards: Eth Click MikroElectronica shield
Adds support for a new SHIELD, Eth Click.
Mikro-BUS type shield supported in Zephyr.
Adds Kconfig for mikroe_eth_click shield.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-05-20 19:02:36 +02:00
Andrei Gansari 2a75139b7c dts: mikro-bus definition
Adds new Mikro-BUS interface defined by MikroElectronica used
by some expansion boards.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-05-20 19:02:36 +02:00
Paul Sokolovsky 8af7187255 samples: net: echo_async_select: Use read()/write() if possible
If build with full POSIX API, use read()/write() instead of
recv()/send() calls for sockets.

We have read()/write() support for a while, but no samples/tests
actually performed at least a build test for it (so it will be
done now).

Fixes: #25407
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-05-20 15:37:23 +02:00
Jukka Rissanen c6a19a2046 cmake: qemu: Allow user to add parameters to Ethernet TAP
User can now add extra Ethernet TAP parameters when starting QEMU.
This is useful if we want to set for example the MAC address
of the network interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-20 15:36:39 +02:00
Jukka Rissanen b97adfba59 doc: net: Add info how to run multiple Zephyr network instances
Give instructions how to run multiple Zephyr instances in QEMU
or native_posix, and connect them together.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-20 15:36:39 +02:00
chao an 32e6347f42 Bluetooth: host: foreach bond only SMP is enabled
build breakage if SMP is disabled

In function `bt_unpair':
bluetooth/host/hci_core.c:2640: undefined reference to `bt_foreach_bond'

Signed-off-by: chao an <anchao@xiaomi.com>
2020-05-20 15:36:10 +02:00
Peter Bigot edd9aecddf device: avoid casting away const from config_info pointer
Re-run the const_config_info Coccinelle patch to fix code.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-20 13:30:17 +02:00
Stephanos Ioannidis fb35591f1e cmake: Correct PATHS usage
`PATH` is not a valid option for `find_program`; correct all such
usages to `PATHS`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-20 12:10:20 +02:00
Erwan Gouriou f87586b06c boards: stm32: pinmux: Restore Kconfig control on pinmux(sdmmc)
In order to avoid pin configuration conflicts between peripherals,
add CONFIG_DISK_ACCESS_STM32_SDMMC flag to for each SDMMC pinmux
configuration.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-20 12:09:19 +02:00
Erwan Gouriou 25dfbe3e7e boards: stm32: pinmux: Restore Kconfig control on pinmux (i2s)
In order to avoid pin configuration conflicts between peripherals,
add CONFIG_I2S flag to for each i2s pinmux configuration.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-20 12:09:19 +02:00