Commit graph

41120 commits

Author SHA1 Message Date
Carles Cufi
058724f329 Bluetooth: controller: Optimize calls to hci_get_class()
Cache the result of calling hci_get_class() to avoid repeatedly invoking
it on the same data. In order to cache it we take advantage of the fact
that both radio_pdu_node_rx_hdr and node_rx_hdr are not packed
structures and they currently have a spare padding byte (between type
and handle).

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-10-11 13:31:52 +02:00
Carles Cufi
9c32a6d287 Bluetooth: controller: hci: Obtain pdu_data using a macro
Hide the details of obtaining a pointer to the PDU data from a node_rx
structure to simplify the code.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-10-11 13:31:52 +02:00
Carles Cufi
db5e6f861d Bluetooth: controller: Further trim connection-related code
Conditionally compile additional code that is only relevant when
enabling connections.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-10-11 13:31:52 +02:00
Andrzej Puzdrowski
cfffd1f782 tests/subsys/settings/nffs: fix not initialized variables issues
A few settings module variables were not initialized before used.
Normally these variable are initialized in the back-end
initialization call which couldn't be done in affected unit tests.

This path initialize these variable via assignments in test code.

fixes #19722

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-10-11 13:30:36 +02:00
Wolfgang Puffitsch
34b95feb54 Bluetooth: controller: split: Call LLL reset functions from ll_reset
Call LLL reset functions when calling ll_reset to avoid carrying LLL
state across HCI resets. Respective functions already exist in LLL but
had not been called from anywhere.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2019-10-11 08:58:33 +02:00
Andrew Boie
ccfccae3bc x86: intel64: don't drop debug sections
Pull in a header specifically for suppressing orphan section
messages.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-10 13:41:13 -07:00
Andrew Boie
e340f8d22e x86: intel64: enable no-execute
Set the NXE bit in the EFER MSR so that the NX bit can
be set in page tables. Otherwise, the NX bit is treated
as reserved and leads to a fault if set.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-10 13:41:02 -07:00
Tom Burdick
1e919f2b68 boards: nucleo_f446re flash layout
Adds the missing flash partition layout to the board dts

Signed-off-by: Tom Burdick <tom.burdick@electromatic.us>
2019-10-10 11:21:39 -05:00
Tommy Vestermark
99e96da8f5 stm32: stm32_min_dev.dtsi enable use of UART_2 and UART_3
For some reason UART_2 and UART_3 was not marked "okay" in the device
tree, making use difficult.
I have tested both UARTs on a "blue pill" board (stm32_min_dev_blue)
with both polling and RX/TX interrupts and found them to work as
expected.

Signed-off-by: Tommy Vestermark <tovsurf@vestermark.dk>
2019-10-10 11:18:28 -05:00
Markus Fuchs
be21d3fab2 kernel: improve C++ compatibility
This patch improves C++ compatibility by reordering the
K_POLL_EVENT_STATIC_INITIALIZER designated initializer macro so its
designators appear in the same order as the members they initialize.

Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
2019-10-10 10:59:06 -05:00
Erwan Gouriou
fe303c42cc soc: stm32: replace use of Kconfig I2C by I2C_STM32
For LL header inclusion, use _STM32 Kconfig symbol
(related to the driver), rather than generic symbol,
that could theoretically use an alternate solution.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-10-10 10:54:44 -05:00
Erwan Gouriou
88b71bdf6c soc: stm32: Move clock_control Kconfig selection to common
Factorize this setting rather than doing it in multiple
places.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-10-10 10:54:44 -05:00
Kumar Gala
df311fc36a dts/bindings: Remove intel,intel-spi.yaml
There is no code that utilizes this binding so remove it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-10 10:52:32 -05:00
Ulf Magnusson
91384ef01e scripts: genrest: Support splitting symbol documentation up by path
Add a --modules flag to genrest.py for generating separate index pages
for symbols defined within certain paths.

Passing

    --modules Shell🐚subsys/shell Storage:storage:subsys/storage

will generate these index pages, instead of a single index.rst file:

 - index-shell.rst: Lists the symbols defined in subsys/shell

 - index-storage.rst: Lists the symbols defined in subsys/storage

 - index-main.rst: Lists all symbols that are not in subsys/shell or
   subsys/storage

 - index-all.rst: Lists all symbols

 - index.rst: Contains links to the other index pages

The string before the first ':' ('Shell' and 'Storage' above) is used
when generating the title of the index page. 'Shell' gives
'Shell Configuration Options', for example.

The title for index-main.rst can be set by passing
'--non-module-title <title>'. It defaults to "Zephyr".

By default, paths in symbol information pages that are within modules
are shown as '<title>/<path relative to module>'. This can be disabled
by passing --keep-module-paths.

--keep-module-paths would make sense for the example above, but
stripping the path to the module is nice when dealing with modules
defined outside the Zephyr repository.

If a symbol is defined in multiple modules (or both in a module and
outside all modules), it will appear on multiple index pages.

This commit also simplifies how genrest.py is called a bit, making the
Kconfig filename optional (default: Kconfig).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-10 15:36:11 +02:00
Trond Einar Snekvik
f7d9af8cb2 Bluetooth: Mesh: Proxy forwards ALL_NODES addr
Unless explicitly blacklisted, the Proxy node will forward all messages
for the ALL_NODES address to the GATT proxy client.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2019-10-10 13:09:42 +02:00
Vinayak Kariappa Chettimada
d12c53f89f Bluetooth: controller: split: Fix missing data len update event
Fix missing generation of data length update HCI event when
effective tx and rx timings change due to PHY update
procedure.

Fixes BT LL TS 5.1.0 test:
LL/CON/MAS/BV-52-C [Master Receiving Data, LE Coded, CI
Change]

Relates to #17097.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-10-10 12:13:54 +02:00
Vinayak Kariappa Chettimada
186a584d0a Bluetooth: controller: split: cond. compile job disable
When ULL High and ULL Low are not at same execution priority
level, it is not necessary to disable ULL Low execution when
updating ticker using stop and start. Also, ULL Low need not
be disable inside Radio Events. This commit corrects some of
the conditional compiles.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-10-10 12:12:47 +02:00
David B. Kinder
36603a3bda doc: make consistent release notes titles
For a long time, release notes were titled "Zephyr Kernel x.x.x".  With
the 2.0 release the title was changed to "Zephyr RTOS 2.0.0" and for the
1.14.1 update the title was "Zephyr 1.14.1" and for the 2.1.0 working
draft the title went back to "Zephyr Kernel 2.1.0". The end result was
the release notes index looking like this:

   Zephyr Kernel 2.1.0 (Working Draft)
   Zephyr RTOS 2.0.0
   Zephyr 1.14.1
   Zephyr Kernel 1.14.0
   Zephyr Kernel 1.13.0
   Zephyr Kernel 1.12.0
   Zephyr Kernel 1.11.0

I think the intention was to drop the "Kernel" name (since the release
is more than a kernel), so let's make the release notes titles
consistent by calling post 1.14.0 release notes "Zephyr x.x.x"

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-10-09 19:28:32 -04:00
David B. Kinder
c686ef1240 doc: forward-port 1.14.1 release notes to master
Integrate the 1.14.1 release notes into the master release notes
documents.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-10-09 19:28:32 -04:00
Erwan Gouriou
628a0336bf boards: stm32: Set arduino gpio connector on nucleo 144 pins boards
Apply same scheme for all nucleo 144 pins boards:
-provide a separate arduino connector dtsi file
-provide complete gpio map
-update board.yaml vs arduino support (i2c, spi and gpio)

Done using following references:
http://www.st.com/resource/en/user_manual/dm00105823.pdf
http://www.st.com/resource/en/user_manual/dm00368330.pdf

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-10-09 18:04:28 -05:00
Ioannis Glaropoulos
61c60be302 arch: arm: core: add Cortex-R in the files description headers
arch/arm/core is shared between Cortex-M and Cortex-R, so
enhance the file description headers accordingly.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-10-09 17:54:16 -05:00
Ioannis Glaropoulos
463d8f7e86 arch: arm: clean up inclusions in assembly files
A clean-up commit that removes unnecessary inclusions from
assembly files in arm/core and arm/core/cortex_m. It also
ogranizes the inclusions based on the following order and
set of rules:
- never include kernel_structs.h
- include toolchain.h and linker/sections.h in all ASM files
- include offsets-short.h, if ASM accesses offset constants
- include arch/cpu.h, if ASM accesses CMSIS constants
  (defined locally in include/arch/arm)
- include file-specific headers, if needed (e.g. vector-table.h)

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-10-09 17:54:16 -05:00
Nicolas Pitre
923a909db8 tests/mem_pool_threadsafe: use actual minimum mempool block size
On 64-bit targets, the minimum possible mempool block size is not 8
but 16. With a max block size of 32, the mempool allocator cannot
split it into 4 sub-blocks, reducing the available memory allocations
to that original 32-byte block only.

To get the same allocation patterns and test behavior whether it is
built for a 32-bit or 64-bit architecture, let's define BLK_SIZE_MIN
and BLK_SIZE_MAX in terms of _MPOOL_MINBLK instead of literal values.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-10-09 17:45:40 -05:00
Andrei Emeltchenko
3aac8e3e19 samples: usb: webusb: Update sample README
Add Requirements and Building instructions

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-10-09 17:16:41 -05:00
Andrei Emeltchenko
3fac9c183a samples: usb: wpanusb: Update documentation
Add sample location and fix incorrect goal for the
zephyr-app-commands.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-10-09 17:16:41 -05:00
Wayne Ren
eb2422ed76 arch: arc: enlarge the exception handling stack
after recent changes in zephyr's fault handling, e.g. use log
to repace printk, it requires more stack to exception handling, or
the stack overflow may happen and crash the system.

this commit adds a kconfig option for exception stack size with
a larger default size.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-10-09 14:21:56 -04:00
Nicolas Pitre
0125cabec7 test_pipe_contexts: don't free memory blocks handed to k_pipe_block_put
Documentation for k_pipe_block_put() says:

  This routine writes the data contained in a memory block to pipe.
  Once all of the data in the block has been written to the pipe,
  it will free the memory block.

Therefore it is wrong to free the memory block within the test code.
When the mempool allocator is instrumented to detect double-free
instances, this case is signaled right away.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-10-09 11:15:46 -07:00
Vinayak Kariappa Chettimada
b71eb71de7 Bluetooth: controller: Fix Kconfig conditional optionals
Fix Kconfig conditional include of Minimum Channels Used
and Channel Selection Algorithm #2.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-10-09 15:53:14 +02:00
Alberto Escolar Piedras
b237597ab9 arch: posix: isolate arch-soc/board IF from kernel-arch IF
The POSIX ARCH delegates some of the tasks which normally
are taken care of by the ARCH to the SOC or BOARD levels.

To avoid changes in the kernel-arch IF propagating into
the arch-soc and arch-board interfaces (which would break
off-tree posix boards) isolate them.

Also move arch inlined functions into the arch.h header,
and out from the headers which specify the  posix arch-soc
and arch-board interfaces.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-10-09 09:14:18 -04:00
Andrew Boie
d1aca7f11b x86_64: fix arch headers
arch/cpu.h and kernel_arch_func.h are expected to define different
functions, per the architecture interface.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-09 09:14:18 -04:00
Andrew Boie
7f715bd113 intel64: add inline definition of z_arch_switch()
This just calls the assembly code. Needed to be
inline per the architecture API.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-09 09:14:18 -04:00
Andrew Boie
b12a094d63 drivers: hpet: fix includes
IRQ APIs were being used without pulling in the proper header.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-09 09:14:18 -04:00
Andrew Boie
3ffb89ad7f arches: fix z_arch_k_cycle_get_32() definitions
These need to all be inline functions and not macros.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-09 09:14:18 -04:00
Andrew Boie
c968422a78 xtensa: fix z_arch_switch()
This was in the wrong header and declared as a macro instead
of an inline function.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-09 09:14:18 -04:00
Andrew Boie
747fec226c arm: move z_arch_switch_to_main_thread to C code
There's no compelling reason why this should be inline unlike all
other arches, it's a large function, called exactly once.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-09 09:14:18 -04:00
Andrew Boie
54506b5a9b arches: fix z_arch_is_in_isr() defintion
For some reason these were implemented as macros when they
should be inline functions.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-09 09:14:18 -04:00
Andrew Boie
f0f700c121 posix: expose z_arch_irq_lock/unlock as inlines
The specification for these arch APIs is to have them inline,
and the bodies were just oneliners calling another function
anyway.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-09 09:14:18 -04:00
Andrew Boie
4970bb092e kernel_includes: add irq.h
A lot of code assumes kernel.h pulls in irq_lock(),
guarantee this.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-09 09:14:18 -04:00
Andrew Boie
b1a73a17bc sys_io: pull in toolchain.h
Needed for ALWAYS_INLINE.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-09 09:14:18 -04:00
Peter Bigot
e28f330a8e coccinelle: standardize k_thread create/define calls with integer timeouts
Re-run with updated script to convert integer literal delay arguments
to k_thread_create and K_THREAD_DEFINE to use the standard timeout
macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
Peter Bigot
03c22b8c94 scripts/coccinelle: add k_thread create/define to timeout standardization
k_thread_create and K_THREAD_DEFINE both take a delay as the final
parameter.  Most uses of K_THREAD_DEFINE pass either `K_NO_WAIT` or
`K_FOREVER`.  Ensure that all uses of K_THREAD_DEFINE follow that
practice, and that the runtime k_thread_create calls do so as well.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
Peter Bigot
6e5db350b2 coccinelle: standardize k_sleep calls with integer timeouts
Re-run with updated script to convert integer literal delay arguments to
k_sleep to use the standard timeout macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
Peter Bigot
f0c0b3b5dc scripts/coccinelle: add sleep to int literal to timeout standardization
k_sleep uses the same underlying thread infrastructure as the other
functions that take timeouts, so the delay should be specified as a
timeout rather than milliseconds.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
Peter Bigot
3423d8b2a4 coccinelle: standardize k_mbox_data_block_get call with timeout
Re-run with updated script to convert integer literal delay arguments to
k_mbox_data_block_get to use the standard timeout macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
Peter Bigot
567d3c4a3e scripts/coccinelle: more cleanup of int literal to timeout
Sort the functions within the regular expression so they can be
checked more easily.

Remove k_thread_deadline_set as it takes an argument in cycles.  (The
one in-tree call to this function was not affected by this error.)

Add missed k_mbox_data_block_get.

Fix an overly ambitious multi-match disjunct that covered some
non-existent functions.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
Tommy Vestermark
22be864af3 stm32: Fix uart_irq_tx_complete() to output correct status
Currently both uart_stm32_irq_tx_complete() and
uart_stm32_irq_tx_ready() return the TXE flag. However
uart_irq_tx_complete() should really return the TC flag to output true
"Transmit Complete" status.

Signed-off-by: Tommy Vestermark <tovsurf@vestermark.dk>
2019-10-09 06:30:14 -05:00
Alexander Wachter
8b214117ec drivers: CAN: MCP2515: Move OSC frequency definition to device-tree
Move the oscillator frequency definition from Kconfig to device-tree.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-09 06:27:53 -05:00
Alexander Wachter
ffa59f1327 shields: link_board_can: Fix bus-speed and SPI definition
Set the bus speed to 125000 like the other boards.
Remove the SPI definition.

Move the definition of the oscillator frequency from Kconfig
to the device-tree.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-09 06:27:53 -05:00
Krzysztof Chruscinski
ab288a8e9e tests: drivers: counter: Add test suite for nrf rtc fixed top value feature
Added test suite which performs sanity check on instances with
fixed-top feature enabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-09 13:25:36 +02:00
Krzysztof Chruscinski
1d6ba06ea7 tests: drivers: counter: Enable ppi-wrap feature on one instance
Enable ppi-wrap feature to test it on at least one instance.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-09 13:25:36 +02:00