Commit graph

41120 commits

Author SHA1 Message Date
Piotr Zierhoffer
54ce5eb32e build: west: Change the remote of civetweb to upstream
It was accidentaly set to a fork of Civetweb instead of the original
repo.

Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
2019-08-08 11:20:36 +02:00
Andrzej Puzdrowski
f46cf1d6d2 tests/subsys/fs/nvs: entry delete test
Added test for check behavior on deleting existent entry,
nonexistent entry and already deleted entry.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-08-08 11:07:48 +02:00
Andrzej Puzdrowski
d1bd2490f3 fs/nvs: skip deletion on non existing entry
No need to write deletion entry for non-existing entry.
Furthermore such a write to filled up storage will make another
writes impossible as it occupied delete nvs_ate space, but it
does not remove anything.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-08-08 11:07:48 +02:00
Andrzej Puzdrowski
369510af33 fs/nvs: fix initialization hang if sector is full
During initialization NVS analyzes open sector for
find write addresses. It was possible to infinite loop
in case when there was no space for any new ATE in the sector.

This patch introduce check for space available in the sector which
fix the issue.

fixes #17891

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-08-08 11:07:48 +02:00
Andrzej Puzdrowski
e941ea5af6 fs/nvs: fix delete ate accommodation
NVS always leave space for deletion ate in a full sector.
Even that it was not possible to write delete nvs_ate to the
full sector. Because of that it was possible to fill up NVS,
and be able to delete nothing.

This patch introduce recognition of case
the delete ate is writing, and allow to write such nvs_ate to
opened full sector.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-08-08 11:07:48 +02:00
Andrzej Puzdrowski
84d657c217 tests/subsys/fs/nvs: init on full storage test
Added test for check wheter initialization works well when nvs
storage is full filled. Test also check weheter can delet any
entry from full filled NVS.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-08-08 11:07:48 +02:00
Andrei Gansari
ef9fdc3137 drivers: eth_mcux: event corrected init->reset
Redoes ENET device bootup event sequence (K6x enters reset).

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2019-08-08 09:52:55 +02:00
Bradley Bolen
06a79cc82e arch: arm: cpu_idle: Remove unused functions
Since commit c535300539 ("drivers/timer: New ARM SysTick driver"),
_NanoIdleValGet and _NanoIdleValClear have been unused.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2019-08-08 09:10:09 +02:00
Jukka Rissanen
7c387a34ac net: context: Allow TCP to use sendmsg()
If sendmsg() is used for TCP sockets, the msghdr->msg_name is not
really used as the socket must already have been connected.
In that case just get the destination address directly from
net_context remote address field.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-08 09:44:50 +03:00
Nicolas Pitre
75bf3c5368 riscv: freedom: rename RISCV32 to RISCV
This code is common to 32- and 64-bit builds.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-08-08 00:29:24 -04:00
Nicolas Pitre
e5981f2b71 drivers: sifiv: make them 64-bit compatible
Make those drivers compatible with a 64-bit build.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-08-08 00:29:24 -04:00
Scott Worley
b948ca2097 ext : hal : Microchip MEC1501 PS/2 and global configuration updates.
Added header files for PS/2 and global configuration hardware
blocks to MEC1501 HAL.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2019-08-07 15:43:11 -07:00
Kumar Gala
27d8a639e2 dts/bindings: Remove unused snps,num-irq-priority-bits prop
The snps,designware-intc.yaml and xtensa,intc.yaml define a required
property snps,num-irq-priority-bits that isn't defined in any .dts

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-07 17:12:15 -04:00
Andrew Boie
ec5eb8f7d4 x86: add build assert that RAM bounds <= 4GB
DTS will fail this first, but there's no cost to adding
a second level of defense.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-07 12:50:53 -07:00
Andrew Boie
ce3cc4f974 x86: ia32: do not use the first megabyte
After witnessing some strange errors with memory not being
what it should be, lifiting everything above 1MB has solved
it. The Zephyr binary was being loaded into memory containing
reserved regions, resulting in data corruption.

We still simulate XIP for testing purposes by setting up the
memory map as follows:

0x000000 - 0x0FFFFF : Non-present
0x100000 - 0x4FFFFF : "Flash" ROM region
0x500000 - 0x8FFFFF : "SRAM" RAM region

For a total of 9 megabytes of physical RAM used.

Fixes problems observed in some large tests when code coverage
is enabled (which increases the amount of RAM used even more).

Fixes: #17782

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-07 12:50:53 -07:00
Andrew Boie
02629b69b5 x86: add prep_c function
Assembly language start code will enter here, which sets up
early kernel initialization and then calls z_cstart() when
finished.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-07 12:50:53 -07:00
Andrew Boie
c3b3aafaec x86: generate page tables at runtime
Removes very complex boot-time generation of page tables
with a much simpler runtime generation of them at bootup.

For those x86 boards that enable the MMU in the defconfig,
set the number of page pool pages appropriately.

The MMU_RUNTIME_* flags have been removed. They were an
artifact of the old page table generation and did not
correspond to any hardware state.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-07 12:50:53 -07:00
Andrzej Puzdrowski
c1864b4428 doc/reference: add FCB page
Added page for description FCB subsystem.
Content was ported from MyNewt.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-08-07 14:38:49 -05:00
Andrzej Puzdrowski
a6d44f6c8f fs/fcb: add API documentation to the header
Added doxygen documentation for FCB API.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-08-07 14:38:49 -05:00
Joakim Andersson
50b28c010d Bluetooth: controller: Fix assert in RPA timeout for advertiser
Fix assert in the RPA timeout when no resolving entry exists in the
resolving list, and the advertiser was requested to use a local IRK
to generate it's own address.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-07 20:49:49 +02:00
Kumar Gala
8622c3415d scripts/dts: Fix detection of a GPIO specifier
We should only assume a GPIO specifier is either named <FOO>-gpios or
gpios.  Any other form like ngpios should not be considered a GPIO
specifier.  especially since 'ngpios' is the standard property name for
the number of gpio's that are implemented.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-07 13:15:51 -04:00
Kumar Gala
99769990ed scripts/dts/gen_defines: Cleanup write_prop for which props we process
We don't create props for compound types so we dont need to check for
'pwms', 'gpios', 'clocks'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-07 13:15:51 -04:00
Kumar Gala
15700ff43b dts/bindings: Change clock type to compound
The clock property should be a compound type as that matches uses like
FOO-gpios, pwms, etc.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-07 13:15:51 -04:00
Andrew Boie
b6d961b7d4 kernel: remove log system support for fatal msgs
This needs further design work due to problems with logging
C strings. Just send always to printk() for now until this
is resolved.

Fixes: #18052

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-07 10:14:12 -07:00
Ulf Magnusson
b945b1041f drivers: sensors: Remove 'version:' field in Si7006 binding
Breaks CI, because it's flagged as an error. See
https://github.com/zephyrproject-rtos/zephyr/pull/17681.

Also remove a redundant document separator.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 18:46:21 +02:00
Joakim Andersson
16c24ea8d2 Bluetooth: SMP: Use error code for OOB data not available
If no callback for oob data request is registered, or the user decided
to abort authentication during OOB data request, we should return the
error code for no OOB data available to indicate that the user does not
have the correct OOB, or no OOB interface at all.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-07 18:32:32 +02:00
Joakim Andersson
a80ab8bcf6 Bluetooth: SMP: Fix kernel crash if auth handler is NULL
Fix kernel crash if bluetooth authentication handlers has not been
registered. The bt_auth object is then NULL, this dereference caused a
call to an invalid function pointer.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-07 18:32:32 +02:00
Andrzej Puzdrowski
f42617ad00 fs/nvs: preserve the previous ate searching
Previous ATE searching is accelerate by reading sector
close ate, which allow to skip reading whole storage.

ATE is already covered by crc8. That patch introduce
check on correctness offset read form close ate. This
increases meta-data integrity check level.
This also preserves against possible looping when read
incorrect or not a NVS storage image.

fixes #16899

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-08-07 18:31:34 +02:00
Mariusz Skamra
5a7a520ea1 Bluetooth: GATT: Add BTP Discover All Primary Services command handler
This will handle BTP Discover All Primary Services command.

Related TC: GATT/CL/GAD/BV-01-C
Fixes: #17861
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2019-08-07 18:07:45 +02:00
Ulf Magnusson
95deec1d24 scripts: edtlib: Reduce code duplication in phandle/value list parsing
Most of the logic for initializing 'clocks' and 'pwms' is the same and
can be shared. Add an EDT._simple_phandle_val_list() helper function for
initializing 'clocks', 'pwms', and any other properties on the form

    <foo>s = <phandle value phandle value ...>

where the nodes pointed at by the phandles are expected to have a
'#<foo>-cells' property.

This should make it easier to add similar properties.

There's still some code duplication in the classes (PWM, Clock, etc.),
but also some differences, so I'm wondering if requiring a class for
each might be okay. Maybe some more class-related stuff could be
factored out later.

Piggyback some related cleanup:

 - Have _phandle_val_list() take the name of the #foo-cells property
   instead of a function for fetching the value. The pattern is always
   the same.

 - Have _add_names() just take the "foo" part of "foo-names". Same
   pattern everywhere.

 - Clean up some redundant comments for stuff that's already documented
   in docstrings

 - Fix error messages printed by _named_cells() ("GPIOS controller" ->
   "GPIO controller", etc.)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 11:48:53 -04:00
Mariusz Skamra
83b50f6bee Bluetooth: Mesh: Fix rejecting invalid remote public key
The code was already rejecting the key, however that rejection
happened only after we had already sent our public key as response,
which got interpreted as acceptance by the tester (PTS).

This fixes issue that d4fd267086a56c270a793114e7575afae9a9befa
supposed to fix. The problem is bt_dh_key_gen is async.
Local public key cannot be sent from the same context
the bt_dh_key_gen is called because we don't know yet
if remote key is valid.

Fixes MESH/NODE/PROV/BI-13-C.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2019-08-07 17:13:32 +02:00
Kumar Gala
ade6cc633c dts: pwm: nxp: Fixup bindings and dtsi so they build
With the new DT checks the dts bindings for "nxp,flexpwm" and
"nxp,imx-pwm" had old conventions that we now treat as build errors.

Additionally fix the number of #pwm-cells for "nxp,imx-pwm" to be 1.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-07 11:08:28 -04:00
Krzysztof Chruscinski
b785ded9fa bluetooth: host: Fix Kconfig error
Fixed error 'The int symbol BT_DISCARDABLE_BUF_COUNT is being evaluated
in a logical context somewhere'.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-08-07 16:12:29 +02:00
Ulf Magnusson
b5b7853ad9 Bluetooth: L2CAP: Kconfig: Remove redundant BT_CONN dependency
subsys/bluetooth/host/Kconfig.l2cap is already sourced within an
'if BT_CONN' in subsys/bluetooth/host/Kconfig, so BT_DEBUG_L2CAP does
not need a 'depends on BT_CONN'.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 16:51:02 +03:00
Kim Sekkelund
87c3db9e0b Bluetooth: Host: Find by type should accept 128bit UUIDs
Find by type does only accept a UUID with the same length as the UUID
which is stored in the internal list. If a UUID is stored in the short
16 bit format then a request with 128 bit UUID will fail.
Add support for the missing formats.

Signed-off-by: Kim Sekkelund <ksek@oticon.com>
2019-08-07 15:39:11 +02:00
Ulf Magnusson
d1dff7129b drivers: gpio: Remove redundant GPIO dep. from GPIO_HT16K33
GPIO_HT16K33 is defined in drivers/gpio/Kconfig.ht16k33, which is
source'd within an 'if GPIO' in drivers/gpio/Kconfig.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 08:14:10 -05:00
Nicolas Pitre
af1510d3bb tests: fatal: make sure the illegal insn occupies a full word
... and is properly aligned. This may make a difference on
64-bit targets.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-08-07 08:12:56 -05:00
Loic Poulain
16d8ce519c sample: blink_led: Adjust PWM period
The maximum period a PWM controller can generate depends on its input
clock and its resolution (16-bit, 32-bit...). Setting a 1s max period
generates error with some hardwares (mimxrt1064_evk) because of clock
limitation.

This patch fixes this issue by calculating maximum period of the PWM
device to adjust max and min periods accordingly.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-08-07 07:38:40 -05:00
Loic Poulain
5533da9aa2 boards: mimzzrt1064_evk: Add pwm-led0 alias
Used to build/run blink_led sample.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-08-07 07:38:40 -05:00
Loic Poulain
2e1bed513a boards: mimxrt1064: Add PWM support
PWM on GPIO_AD_B0_09 (USER_LED/Arduino J22 pin 5)

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-08-07 07:38:40 -05:00
Loic Poulain
447029d7c3 drivers: pwm: Add NXP MCUX PWM driver
This driver handles eFlexPWM submodules via MCUX hal.
Each submodule has two channels (A/B).

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-08-07 07:38:40 -05:00
Loic Poulain
df583f27a9 soc: nxp_imx: Add PWM config
Enable MCUX PWM driver if PWM config is selected and hardware
support it.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-08-07 07:38:40 -05:00
Loic Poulain
3484d5c869 ext: mcux: Add HAS_MCUX_PWM config
For SoCs having PWM support.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-08-07 07:38:40 -05:00
Loic Poulain
630e0c7a6e dts: arm: nxp: rt: Add PWM nodes
i.MX RT10XX processors have four eFlexPWM modules, each containing
four 2-channels PWM submodules.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-08-07 07:38:40 -05:00
Alex Porosanu
453ee5e782 soc: riscv32: fix zero-riscy zephyr,flash node
For OpenVega board, in the case of the Zero Riscy core,
the flash partition used for the code and data is the
M0 ARM core's 256KB flash region. This is closest to
the RISC core.
The m0_flash node defines where the interrupt vector
is located for the Zero Riscy core, and one needs to
restrict the application so its interrupt vector is
placed accordingly.

Fixes: 34b0516466 ("boards: riscv32: rv32m1_vega:
                      enable MCUboot for ri5cy core")

Signed-off-by: Alex Porosanu <alexandru.porosanu@nxp.com>
2019-08-07 07:27:51 -05:00
Nick Ward
ea366e9aa3 drivers: can: mcp2515: Fix interrupt bit tests for empty TX buffers
TX1 and TX2 buffer empty busy flags would have been cleared only for
TX0 empty interrupts and there would have been extra unwarranted
TX callbacks for TX1 and TX2 if the callbacks had previously been used.

Signed-off-by: Nick Ward <nick.ward@setec.com.au>
2019-08-07 15:14:28 +03:00
Paul Sokolovsky
de7fb74750 posix: Add headers related to BSD Sockets API
A few of these headers are currently empty and provided to avoid
compiler errors when building existing software.

This set of headers is what is required to build
https://github.com/open62541/open62541 with Zephyr.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-08-07 15:02:11 +03:00
Morten Priess
3a9173afe1 bluetooth: controller: Revised ticker for improved conflict resolution
Changed ticker behavior to resolve conflicts in ticker_worker instead of
in ticker_job. This allows better real-time slot allocation, as well as
allowing callbacks even if ticker node doesn't get air-time (for audio
stream housekeeping). A priority property now also allows prioritizing
one ticker node over others.
Compatibility mode enables lagacy ticker behavior if needed.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2019-08-07 13:52:48 +02:00
Jukka Rissanen
303ef27535 samples: usb: hid-cdc: Use proper value in k_busy_wait()
The wait time value should be in microseconds.

Fixes #18059

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-07 12:24:23 +02:00
Jukka Rissanen
1c65789d85 samples: net: zperf: Use proper value in k_busy_wait()
The wait time value should be in microseconds.

Fixes #18059

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-07 12:24:23 +02:00