Commit graph

41120 commits

Author SHA1 Message Date
Loic Poulain
99ae556fb6 dts: arm: nxp: rt: Create dedicated rt1060 dtsi
i.MX-RT1060 has 512KB additional on-chip RAM mapped at 0x20280000.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-03-15 06:40:23 -05:00
Erwan Gouriou
70f95a25f5 soc: stm32f4: fixup: Rename UART generated DT_ defines
On stm32f4 series, uart4 is not an usart, so generated with
'st,stm32-usart' compatible and hence generated defined should be
prefixed with DT_ST_STM32_UART_ rather than DT_ST_STM32_USART.

Fixes #14542

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-03-15 06:39:37 -05:00
Erwan Gouriou
ad816f7453 dts/st: stm32f4: uart4 is not available on whole series
uart4 is not available on whole stm32f4 series (not on stm32f401
for instance), remove from stm32f4.dtsi
It is actually correctly defined in f405, f413 but missing in f446,
so add it in there.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-03-15 06:39:37 -05:00
Vinayak Kariappa Chettimada
d570e139dc Bluetooth: controller: Fix tx power level set and get
Fix implementation to correctly return the configured
default Tx Power Level.

Also, fix the missing use of RADIO_TXP_DEFAULT in the new
ULL/LLL implementation of Advertiser and Observer states.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-03-15 11:07:32 +01:00
Vinayak Kariappa Chettimada
5d78a5f07a Bluetooth: controller: Read Tx Power Level depends on Connections
Conditionally compile HCI Read Tx Power Level command for
connections support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-03-15 11:07:32 +01:00
Vinayak Kariappa Chettimada
f4281c38f8 Bluetooth: controller: Add range delay calculations
Add implementation in controller to use range delay
alongwith the active clock accuracy jitter.

Range has been hard coded to 1000 meters, suffices
modules out in the market.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-03-15 11:07:00 +01:00
Vinayak Kariappa Chettimada
fd334a2aa5 Bluetooth: controller: Fix disabled Prop. PHY Update for nRF51 series
Due to regression the option to enable PHY Update Procedure
on proprietary 2M PHY for nRF51 series was disable.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-03-15 11:06:23 +01:00
Vinayak Kariappa Chettimada
0437fd7aff Bluetooth: controller: Workaround multi-link DLE assert
Workaround from asserting when Rx PDU buffers from pool
needing resize is acquired by another connection. By
skipping the connection events to give some headroom for
the host to process the Rx packets and eventually make the
pool available for resize.

Fixes #11841.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-03-15 11:05:12 +01:00
Wayne Ren
a1c2159acb arch: arc: refactor the ARC MPU driver
* separate the ARC MPU driver into 2 parts
  * arc_mpu_v2_internal.h for ARC MPUv2
  * arc_mpu_v3_internal.h for ARC MPUv3
* For ARC MPUv2, keep the main design, but update and optimize the code
* For ARC MPUv3, implement mpu region split to supprt MPU region overlap
* misc updates and bug fixes

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-03-14 23:53:16 -07:00
Kumar Gala
ea5d54c61b arm: asm: Fix inline asm in Z_ARCH_EXCEPT for clang
The clang ARM assembler is a bit stricter than GNU as.  Change mov to
movs for ARMv6 case of Z_ARCH_EXCEPT.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-15 06:02:34 +01:00
Paul Sokolovsky
f38c4c97ce tests: socket_helpers: Use zsock_ prefixed socket functions
Don't depend on CONFIG_NET_SOCKETS_POSIX_NAMES being defined (e.g.,
it's going to conflict with POSIX API).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-03-15 06:00:21 +01:00
Johann Fischer
5ed4b6a334 samples: usb_dfu: update application signing in README.rst
Update application signing example in README.rst.

resolves: #14510

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-03-15 05:58:07 +01:00
Kumar Gala
626dd420fc drivers: usb: nrf: Fix mixing of enum types
When we build with clang we can a warning related to mixing of enum
types.  Just use nrfx_usbd_ep_status_t since that is the type returned
by nrfx_usbd_ep_status_get.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-15 05:53:32 +01:00
Andy Ross
c4e2f1b217 tests/kernel/mem_pool/mem_pool_threadsafe: Reduce tick rate
Qemu just can't handle 1000 Hz ticks.  On our CI machines, CONFIG_HZ
on the host (which is the limit of timing precision for things like
idle wakeups and signal delivery, both of which qemu seems to use for
timing) is 250.  When the mismatch gets this large, we start seeing
artifacts like interrupts being delivered "in the past" (i.e. code
sees a z_clock_elapsed() value of "2" ticks before getting a
z_clock_announce() call for "1").

As it happens, this test doesn't actually require timing with that
precision, it just wants "lots of context switching" to exercise the
threadsafety of the mem_pool APIs.  So decrease the tick rate to the
100Hz default, but put a loop counter in the worker threads to force
them to do 10x more work, keeping the number of preemptions constant.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-03-15 05:50:43 +01:00
Andy Ross
722aeead91 kernel/sched: Nonatomic swap workaround update for qemu behavior
The workaround for nonatomic swap had yet another edge case: it would
save off the _current pointer when pending a thread so that the next
time slice interrupt could test it to see if the swap had actually
happened before assuming that _current could be rescheduled (if it
just pended itself, that's impossible).  Then it would clear the
pending_current pointer so future interrupts wouldn't be confused.

BUT: it turns out that qemu, when faced with really rapid timer rates
that exceed its (host-based) timing accuracy, is perfectly willing to
"stack up" timer interrupts such the one goes pending before the
previous one is finished executing.  In that case, we can enter the
SECOND timer interrupt, to try timeslicing a SECOND time, STILL before
the PendSV exception has run to actually effect the context switch.
Except this time pending_current has been cleared and we try to
reschedule the pended _current thread incorrectly.  In theory real
hardware could do this too, though it would involve absolutely crazy
interrupt latency problems.

Work around this by moving the clear to the thread itself, immediately
after it wakes up from the pend call it retakes a lock and clears
pending_current if it still matches _current.  That is not a perfect
fix: there remains a 2-3 instruction race at that moment where we
return from pend and before we can lock interrupts again where a timer
interrupt will see an incorrect pointer.  But I hammered at this and
couldn't make qemu do that (i.e. return from a timer interrupt but
flag a new one in just a cycle or two).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-03-15 05:50:43 +01:00
David B. Kinder
6000a6205a doc: prepare for improving doc API linking
Linking to API material requires knowing the pecularities of how
doxygen, sphinx, and breathe work. In an attempt to hide some of this
we're preparing the current docs to allow use of configuration defaults
that will let us more simply use a default role that will hunt for a
reference target in the various domains that are available by using a
default "role" of "all".  This will let us use the simple notation
`functionname` or `typename` without fully specifying the reference as
:c:func:`functionname`.

This patch cleans up exising docs that were (incorrectly) using single
backtics where double backtics should have been used, and also found
some typos (such as a space between the role name and the reference,
such as :file: `filename`, and a missing colon such as
c:func:`functionname`)

This is a start to address issue #14313

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-15 05:47:19 +01:00
Andrew Boie
a514898ee7 userspace: don't modify optimization options
The gperf hashtables and support functions are created
after the initial zephyr_prebuilt.elf is created, using
data found within it.

A fixed-sized amount of memory is reserved for the
program text of these support functions, as their true
size isn't possible to predict in advance and we don't
want memory addresses after them to shift. To minimize
the amount of space reserved, it seemed reasonable to
hard-code -Os.

However, on ARC, building with -Os can cause various
millicode functions from libgcc to be included in the
binary which would not be present in zephyr_prebuilt.elf
unless zephyr_prebuilt.elf was also built with -Os,
causing anything after them to be shifted, wreaking all
kinds of havoc.

Just build without hardcoding any optimization parameters.
We have checks in the linker scripts to let us know if
we have overflowed the region for the gperf support
functions anyway, so there is no danger of this failing
silently.

Fixes: #14139

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-03-14 22:22:31 -05:00
Geoffroy Van Cutsem
96235c5027 boards/x86: scripts: build_grub.sh to use grub-2.02-285-g5bc41db75
The build_grub.sh script cherry-picks 3 commits from the master branch
of grub because more recent build tools fail to build the latest stable
release (which is 2.02). This solves the problem on Fedora 29 for
example, but is not sufficient for Clear Linux.

This patch modifies the build_grub.sh script to use
grub-2.02-285-g5bc41db75 (latest from master as of 13 of March 2019).
That version compiles 'out-of-the-box' in the latest Ubuntu, Fedora and
Clear Linux.

There are additional tools required on the host system and the
documentation has been updated accordingly.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-03-14 19:20:24 -05:00
Suryansh Sharma
fa3af77f83 doc: arm: Update stm32_min_dev doc
Updates the documentation to show PC13 instead
of PB12 as deafult LED Pin. Also adds note
about the default LED based on version of board.
Includes the change that needs to be made to
the dts file for changing default LED pin

Signed-off-by: Suryansh Sharma <suryansh@evilscientist.cc>
2019-03-14 19:19:11 -05:00
Michael Scott
9439a393b6 doc: net: Add LwM2M high-level description and usage
Add high-level documentation for the LwM2M library and examples
for client setup.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-14 19:17:55 -05:00
Flavio Ceolin
11abc64315 samples: can: Check return of can_attach_isr
Problem spotted by coverity, CID 195786

Fixes #14417

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-14 19:15:03 -05:00
Suryansh Sharma
c995b6a620 doc: Fix typo and markup elements
Fixes a typo in board_porting.rst
Fixes wrong syntax for file markup element
in build-flash-debug.rst

Signed-off-by: Suryansh Sharma <suryansh@evilscientist.cc>
2019-03-14 19:14:36 -05:00
Kumar Gala
e1c6d11e66 drivers: led: lp5562: Fix use of logical or vs bitwise
We are or'ing bit flags so use '|' instead of '||'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-14 17:11:36 -05:00
Ioannis Glaropoulos
78618fbc8f arch: arm: revert back to use assembly to jump to main thread
This commit partially reverts the changes introduced in
(bbe1a19786), where the PSP
modification, the interrupt enabling, and the branch to main
thread were refactored in C functions. This introduced an issue
with stack usage when compiling without any optimization.
Reverting to use assembly functions to jump to main thread
ensures, now, that the pointer to main() is preserved intact
while changing the PSP and passed correctly to z_thread_entry().

Fixes #14471.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-03-14 17:10:59 -05:00
Ioannis Glaropoulos
a22b779a97 arch: arm: move MPU reprogramming before switching to main stack
This commit simply moves the MPU re-programming of
dynamic regions during initialization to occur right
before switching PSP to the main thread stack. As a
result, the MPU re-programming will execute using
the interrupt stack. No functional changes are
introduced.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-03-14 17:10:59 -05:00
Kumar Gala
fdc59d7c2b Bluetooth: Mesh: Fix clang uninitialized var warning
There's a BT_DBG that will output the value of pub_addr before its ever
set to anything.  Remove output of pub_addr from BT_DBG().

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-14 14:31:57 -05:00
Ramakrishna Pallala
d910aa6029 samples: power: Add test for device Idle PM
Added test for Device Idle Power Management to invoke
device_pm_get/put API's.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2019-03-14 14:26:15 +01:00
Ramakrishna Pallala
6b21e1b7a7 power: Add device idle power management support
Add framework for device Idle Power Management(IPM)
for suspending devices based on device idle. This will
help in saving power even while system(CPU) is active.

The framework uses device_set_power_state() API set the
device power state accordingly based on the usage count.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2019-03-14 14:26:15 +01:00
Ramakrishna Pallala
e1639b5345 device: Extend device_set_power_state API to support async requests
The existing device_set_power_state() API works only in synchronous
mode and this is not desirable for devices(ex: Gyro) which take
longer time (few 100 mSec) to suspend/resume.

To support async mode, a new callback argument is added to the API.
The device drivers can asynchronously suspend/resume and call the
callback function upon completion of the async request.

This commit adds the missing callback parameter to all the drivers
to make it compliant with the new API.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2019-03-14 14:26:15 +01:00
Varun Sharma
0758e3a700 tests: subsys: fs : Fix coverity issue
Fix Unchecked return value for nffs_inode_data_len() in
func: inode_to_diren()

Coverity-CID: 190981
Fixes: #13840

Signed-off-by: Varun Sharma <varun.sharma@intel.com>
2019-03-14 14:20:45 +01:00
Kumar Gala
4e90103fcb arm: asm: Fix some asm issues when building with clang
The clang ARM assembler is a bit stricter than GNU as, make a few
changes so things build with both

Signed-off-by: Peter Smith <peter.smith@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-14 08:01:10 -05:00
Jun Li
b0d46a3175 watchdog: stm32: fix logic error
While installing timeout, the logic to judge if
timeout parameter is valid is wrong.

Signed-off-by: Jun Li <jun.r.li@intel.com>
2019-03-14 07:08:13 -05:00
Jukka Rissanen
dc41aad2a5 tests: net: mld: Check null ptr dereference
If pkt allocation fails, then prepare to handle NULL pointer.

Coverity-CID: 195844
Fixes #14405

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-14 13:01:01 +01:00
Kumar Gala
e509cdc5c4 boards: arm: Fix setting of xtools
efm32pg_stk3402a and lpcxpresso54114_m0 board yaml files didn't set
xtools under the toolchain category, fix that.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-14 06:48:37 -05:00
Anas Nashif
e20676d98a arch: remove unused arch defconfig
Architecture defconfigs are not used anymore and are stale. Remove them
to avoid confusion.

Related to #14442

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-14 06:43:16 -05:00
Tedd Ho-Jeong An
401a598503 tests: net: iface: Handle pkt allocation failure
This patch handles null pointer when packet allocation fails.

Fixes: #14390
Coverity-CID: 195903

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-14 12:06:21 +01:00
Paul Sokolovsky
8658e3fe79 net: socket: Split select-related declaration to separate header
select() is a rather peculiar construct, defining/depending on many
types and symbols. Making that to coexist with POSIX subsystem is
an ongoing challange. To facilitate that, let's split those
definitions to a separate header (which e.g. can be included without
including all the rest of socket defines).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-03-14 12:05:02 +01:00
Michael Scott
19de7ecc5b drivers: modem: wncm14a2a: remove left-over includes
Commit fd1401495b ("net/tcp: Move net_tcp_set_hdr() away from net
core") removed <net/tcp.h>.  This results in a not found error being
generated when CONFIG_NET_TCP is enabled.

We also, don't need to include <net/udp.h> anymore due to new
net_pkt API changes.

Let's clean up the includes by removing both of them.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-14 08:41:34 +01:00
Michael Scott
104effed85 drivers: modem: wncm14a2a: Fix timeout handling for AT@SOCKCONN
Socket-based API sends timeout K_FOREVER(-1) to net_context_connect()
function where previously net_app APIs used an actual timeout value.
Now that we've switched to socket-based APIs, we reveal poor handling
for the timeout value which causes an error in the WNC-M14A2A driver
due to math performed on the -1 value.

Let's be sure to check for valid timeout values prior to performing
math and then make sure it falls within the allowable range of values
for the AT@SOCKCONN command (30 seconds to 360 seconds).

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-14 08:41:34 +01:00
Michael Scott
a4cedf5a0b drivers: modem: remove leftover artifact from wncm14a2a split
In commit c1f24abb13 ("drivers: modem: wistron kconfig separation"),
A single line of the WNC-M14A2A congigs was left in the main modem
Kconfig.

Let's clean up the Kconfig file by removing the left over.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-14 08:41:34 +01:00
Michael Scott
e99af7db3d drivers: modem: wnc-m14a2a: imply GPIO usage
CONFIG_GPIO may not be enabled on some HW, so let's make sure to
enable it if the dependencies are met, as the WNC-M14A2A driver
needs to set power, reset and other GPIOs.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-14 08:41:34 +01:00
Tomasz Bursztyka
078be776ee samples/bluetooth: Switch ipsp sample to new net_context API
No need to build the net_pkt, just send the buffer directly.

Let's reuse already parsed ip/proto headers as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Tomasz Bursztyka
fa58d1e6ce samples/net: Switch zperf sample to new net_context API
No need to build the net_pkt, just send the buffer directly.

Let's reuse already parsed ip/proto headers as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Tomasz Bursztyka
4ab0e5a3b7 samples/net: Switch lldp sample to new net_pkt API
Use new net_pkt r/w API functions.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Tomasz Bursztyka
b517247835 samples/net: Switch wpan_serial to new net_pkt API
Minor changes, as wpan is low level and make use of the bare minimum
API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Tomasz Bursztyka
8af3df3519 samples/net: Switch wpanusb sample to new net_pkt API
Minor changes, as wpan is low level and make use of the bare minimum
API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Tomasz Bursztyka
3b1c91732d samples/net: Switch nats samples to new net_pkt/net_context API
Using new net_pkt r/w API and so on.

This sample would still need to be using socket API instead.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Krzysztof Chruscinski
9502b8b80b lib: os: ring_buffer: Fix not handled return value
Some function return values were not handled. Added assert in case
those functions return error. It is possible only if same ring buffer
instance is used without any protection from multiple contexts.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-03-14 08:40:18 +01:00
Michael Scott
4278bf5673 scripts/dts: Fix for PyYAML 5.1 Loader changes
PyYAML 5.1 was just released and it doesn't support !include as
previous versions do.  This breaks our DTS bindings parsing.

Let's fix our extract_dts_include.py script to work with both
3.13 and 5.1.

Also, update the pyyaml requirement to >=3.13 to be sure we're
compatible.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/14496

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-13 23:21:42 -05:00
Ioannis Glaropoulos
a907e694e9 doc: guides: porting: correct references to user mode APIs
User mode-related API functions have been renamed to use the
'z_' prefix, so we need to update the architecture porting
guide accordingly.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-03-13 16:08:46 -07:00