Commit Graph

6182 Commits

Author SHA1 Message Date
Joakim Andersson 1d0b03bb37 Bluetooth: host: Add phy update procedure options
Add options for phy update procedure. User can now set no preference
option for a particular PHY as well as preference for LE Coded PHY
coding scheme.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-06-19 13:42:29 +02:00
Martí Bolívar 1af73a66ab sys/util.h: remove deprecated MACRO_MAP()
Since this is an experimental API and MACRO_MAP() was deprecated in
favor of FOR_EACH() in zephyr v2.3.0, we are within our rights to just
remove it without notice now. Do so and mention it in the release
notes.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-06-18 19:38:10 +02:00
Martí Bolívar 04df8124ac api: promote sys/util.h to experimental
This file contains definitions for macros which are integral to
significant Zephyr use cases, such as CONTAINER_OF() and various
macros used by devicetree.h internally.

As such, in practice we expect at least advanced (if not intermediate)
users to understand it, so the fact that it's not formally documented
as an API with a stability level is a problem.

Fix that by giving the docstrings a once-over and adding new ones
where they are missing. Move all the remaining non-API macros to
util_internal.h.

Add a Sphinx API page for this header, and include it in the API
overview at "experimental" stability level.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-06-18 19:38:10 +02:00
Martí Bolívar 317eaa5a7e util.h: remove duplicate UTIL_EXPAND() definition
This is already defined (to the same expansion) higher up in the file.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-06-18 19:38:10 +02:00
Martí Bolívar 458ae3403c util.h: clean up UTIL_INC_x and UTIL_DEC_x
Move the repetitive definitions used to add and subtract 1 at
preprocessor time into their own file. Make the behavior consistent,
so that you can invoke UTIL_INC(x) for any x you can invoke
UTIL_DEC(x) on.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-06-18 19:38:10 +02:00
Andrew Boie 87dd0492db x86: add CONFIG_X86_KERNEL_OFFSET
Previously, DTS specification of physical RAM bounds did not
correspond to the actual bounds of system RAM as the first
megabyte was being skipped.

There were reasons for this - the first 1MB on PC-like systems
is a no-man's-land of reserved memory regions, but we need DTS
to accurately capture physical memory bounds.

Instead, we introduce a config option which can apply an offset
to the beginning of physical memory, and apply this to the "RAM"
region defined in the linker scripts.

This also fixes a problem where an extra megabyte was being
added to the size of system RAM.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-06-18 19:35:52 +02:00
Andy Ross 150e18de6e kernel/timeout: Fix 32 bit rollover conditions
There were two spots where CONFIG_TIMEOUT_64BIT wasn't being correctly
honored, leading to the possibility of long timeouts overflowing
internally and doing weird stuff.

Fixes #26248

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-06-18 13:21:06 +02:00
Henrik Brix Andersen 696fc3afbf drivers: sensor: add api function for getting a sensor attribute
Add an API function for getting the value of a sensor attribute.

Fixes #26167.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-06-17 17:13:14 +02:00
Tomasz Konieczny c73578f37a logging: enhanced external logsystems
Introduced interface for efficient logging from external logsystems:
Added handling of vaargs and automatic strdup to macros intended
to be used in logging interface function. Fast path to less then 4
arguments to speed up the execution. Made log_count_args external,
if external logsystem cannot count arguments.

Signed-off-by: Tomasz Konieczny <tomasz.konieczny@nordicsemi.no>
2020-06-17 17:08:12 +02:00
Roman Vaughan 42ee2e0938 fs: Set MAX_FILE_NAME appropiately with LFN and FATFS
Try to define MAX_FILE_NAME to the appropriate max length based on the
selected filesystm. Otherwise fallback to a standard filename of 12
(made up of 8.3 : <filename>.<extension>)

Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
2020-06-17 17:07:45 +02:00
Tobias Svehagen a5147dc15c net: Make it possible to include net/buf.h even if CONFIG_NET_BUF=n
Since CONFIG_NET_BUF_USER_DATA_SIZE was not defined when
CONFIG_NET_BUF=n, compilation would fail on struct net_buf.user_data.

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2020-06-17 16:17:39 +03:00
Markus Becker 81d5425210 net: l2: Remove unnecessary()
When compiling network subsystem, I was getting the following compiler
warning:

```
In file included from /home/markus/src/wrp-n4m/zephyr/include/net/net_if.h:29,
                 from /home/markus/src/wrp-n4m/app/src/main/node/main.cpp:20:
/home/markus/src/wrp-n4m/zephyr/include/net/net_l2.h:80:32: warning: unnecessary parentheses in declaration of '__net_l2_OPENTHREAD' [-Wparentheses]
   80 | #define NET_L2_GET_NAME(_name) (__net_l2_##_name)
      |                                ^
/home/markus/src/wrp-n4m/zephyr/include/net/net_l2.h:82:29: note: in
expansion of macro 'NET_L2_GET_NAME'
   82 |  extern const struct net_l2 NET_L2_GET_NAME(_name)
      |                             ^~~~~~~~~~~~~~~
/home/markus/src/wrp-n4m/zephyr/include/net/net_l2.h:114:1: note: in
expansion of macro 'NET_L2_DECLARE_PUBLIC'
  114 | NET_L2_DECLARE_PUBLIC(OPENTHREAD_L2);
      | ^~~~~~~~~~~~~~~~~~~~~
```

This patch fixes the warning.

Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-06-17 08:55:59 +03:00
Lukasz Maciejonczyk b0de2ee15b net: IPv6: Fix source address for mesh multicast destination
Currently there is chosen the link local address as a source address
for each multicast destination address. It is a bug for OpenThread
network where the mesh-local EID addres should be picked in this case.
This commit fixes it by distinquish the mesh local multicast among any
others.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2020-06-16 19:14:52 +02:00
Piotr Mienkowski 4b194eb4fc gpio: remove deprecated API functions/macros
This commit removes API functions and macros which were deprecated in
2.2 release. GPIO drivers are updated accordingly.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-06-16 19:13:05 +02:00
Krzysztof Chruscinski 47ebae40d3 drivers: uart: RX_RDY after rx_disable
Updated rx_disable() description so that RX_RDY event is generated
after calling rx_disable. It contains data received prior to abort.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-16 19:11:57 +02:00
Mohamed ElShahawi 4acac3e9ef drivers: esp32/clock_control: Add Clock Driver
- Support PLL for Higher Frequencies 80,160,240 MHz
- Support XTAL Frequencies 26MHz, 40MHz
- Clock Driver can't be disabled, because all of the other drivers
will depend on it to get their operating Frequency based on chosen
clock source (XTAL/PLL).

- Add needed references to BBPLL i2c bus ROM functions.
- Add `rtc` node to Device Tree.
- Since All Peripherals Frequency is depending on CPU_CLK Source,
`clock-source` property added to CPU node

Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
2020-06-16 09:00:51 -05:00
Jukka Rissanen 5f3d999bb9 net: log_strdup() was missing when printing thread name
If CONFIG_THREAD_NAME is enabled, we must use log_strdup() when
printing the thread name.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-16 15:54:20 +03:00
Robert Lubos bd7d6926c4 net: lwm2m: Add ObjLnk resource type support
Implement LWM2M ObjLnk resource type and plaintext, TLV and JSON
readers/writers.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-06-15 22:13:34 +03:00
NavinSankar Velliangiri 820bfb46bc net: http: client: Add port number to HTTP Header
Add port number to HTTP Header.

Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2020-06-15 16:59:20 +02:00
Jose Alberto Meza a1b6dd51d0 drivers: espi: Add support for KBC status operations
In some systems, eSPI host perform operations directly over KBC HW
status.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-06-15 16:52:53 +02:00
Oleg Zhurakivskyy d95a2c38e3 net: core: Output a thread name in NET_DBG() if enabled
In order to follow threads by name in the debug output,
output a thread name if CONFIG_THREAD_NAME is enabled.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-06-15 16:38:38 +03:00
Andrzej Puzdrowski 4f7f6c96be includes/storage/stream_flash: clarification on API usage
Clarify that number of bytes_written means bytes number of bytes
written belongs to the user's payload.

Added API note for emphasize that any flush write should be
the last write operation in any writes row.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-06-13 11:57:35 +02:00
Abhishek Shah 3c2fa8cd51 pcie: endpoint: Introduce API to achieve PCIe data transfer
Introduce common API to achieve data transfer using memcpy
to/from outbound region of PCIe EP.

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-06-13 01:35:19 -07:00
Abhishek Shah ca17315d7f pcie: endpoint: Add public APIs for PCIe endpoint driver
Add public APIs for PCIe endpoint driver:
- EP configuration space read/write
- Mapping/Unmapping of Host buffer and PCIe outbound region
- Raise interrupt to Host
These are minimal base APIs to make PCIe EP functional.

Also, add a Kconfig and an empty CMakeLists.txt for drivers to extend.

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-06-13 01:35:19 -07:00
Hake Huang 5582c2f00b dt-bindings: dts/arm/nxp : add MCUX EDMA Support
add MCUX EDMA support for dts binding

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-06-12 13:03:28 -05:00
Hake Huang 77c4015082 dma: add support for MCUX EDMA
1. expand PERIPHERAL_TO_PERIPHERAL
2. add slot size to 128 as i.MX-rt has 127 slot
3. add link_channel member in dma_conf which is used to
   support chain channel

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-06-12 13:03:28 -05:00
Christopher Friedt 8bcf005084 lib: posix: nanosleep
This change adds support for nanosleep(2) documented at
https://pubs.opengroup.org/onlinepubs/9699919799/functions/nanosleep.html

N.B: Currently, this provides no better resolution than
k_busy_wait()

Fixes #25554

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-06-12 17:02:03 +02:00
Xavier Chapron 8c29aa9881 net: mqtt: Constify utf8 pointer in mqtt_utf8 struct
mqtt_utf8 structure is used to store the client_id, user_name, password,
topic, will_message.
There is no reason for the mqtt code to modify such data, therefore we
can constify the utf8 pointer.

This would also means that theses client, topic, ... strings can be
safely stored in ROM.

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
2020-06-12 16:47:36 +02:00
Kumar Gala 9ca541a504 linker: Remove deprecated Kconfig options related to linker scripts
Remove Kconfig, linker script, and related bits associated with
CUSTOM_RODATA_LD, CUSTOM_RWDATA_LD, CUSTOM_SECTIONS_LD,
SOC_NOINIT_LD, SOC_RODATA_LD, and SOC_RWDATA_LD options that have been
deprecated since Zephyr 2.2.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-12 11:14:28 +02:00
Emil Gydesen c55280a7f0 Bluetooth: host: Added inline function for gatt notify by uuid
Added a static inline helper function to notify by uuid,
similar to `bt_gatt_notify`.

Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
2020-06-12 11:12:17 +02:00
Lingao Meng 7239dc1cbd Bluetooth: Mesh: Add key-value concept to store model data
Previous mode store function only can store single data,
change this to store as KV model, let's app-layer to manager
model data, other than by stack when node reset.

Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
2020-06-12 11:09:11 +02:00
Kumar Gala 59708769ea net: lwm2m: Remove deprecated functions
Remove deprecated functions that have been marked deprecated since
Zephyr 2.0.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-11 15:50:48 +03:00
Andrew Boie 9ee56e7195 linker-defs: remove KEXEC_PGALIGN_PAD
This has been unused for ages, delete it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-06-10 18:37:28 -04:00
Andrew Boie 038c9584b3 linker-defs: remove x86 code
This should never have been here. This is already specified
in x86's linker script anyway.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-06-10 18:37:28 -04:00
Andrew Boie 02df2a4f96 linker: un-abstract some definitions
These made sense before we had the common-rom/common-ram
files, as the same boilerplate was repeated for every arch's
linker script, but this is no longer necessary.

Move these inline for simplicity.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-06-10 18:37:28 -04:00
Peter Bigot fe74218956 sys: util.h: remove template implementation of ARRAY_SIZE
This was added because GNU G++ doesn't support the built-in function
used to produce a compile-time error when invalid parameters are
passed to the macro imlementation.  The template implementation does
not work on declarations like this:

  mytype array[] = { ... }

because it requires an explicit size for the template parameter.

Remove the template specialization, and support C++ with a version of
the macro that doesn't involve references to undefined builtins.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-10 12:02:45 +02:00
Krzysztof Chruscinski 1b4b9386e5 sys: util: Added separator to FOR_EACH_ macros
Added separator (e.g. comma or semicolon) parameter to FOR_EACH_ family.
Separator is added between macro execution for each argument and not at
the end.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-10 11:58:13 +02:00
Xavier Chapron 57db336b98 dfu: flash_img: Constify flash_img_buffered_write() data parameter
The data passed has no reason to be changed and can therefore be passed
as read only.

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
2020-06-10 09:30:08 +02:00
Peter Bigot 4bc1ca9e7e arch: x86: add extern "C" to arch.h
Without this builds for qemu_x86 can't invoke k_cycle_get_32()
because z_timer_cycle_get_32() is installed with a mangled name.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-09 17:45:09 -04:00
Gerson Fernando Budke 76e32ba32b net: coap: Add coap_get_option_int public method
Any CoAP implementation when use at least block transfer or is a server
side need access some CoAP options as integer values. This add a method
at public interface and defines for block wise operations to avoid code
useless code duplication.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-06-09 21:25:11 +03:00
Peter Bigot a4337bde28 drivers: pwm: clarify behavior
As written the specification when both period and pulse are zero is
inconsistent: allowed behavior would be to drive the pin at constant
active or constant inactive, depending on which condition was checked
first.

Clarify that driving constant active level requres a non-zero pulse
equal to period.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-09 18:12:53 +02:00
Emil Gydesen bf414c5559 logging: Fixed compile warning with extern array declaration
The extern array declaration of size 0 gives a warning when
compiling with GCC. Updated to use [] rather than [0].

Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
2020-06-09 14:42:16 +02:00
Kumar Gala 1737bd082d zephyr: Use deprecated instead of legacy for Kconfig int types
Rename the Kconfig symbol from LEGACY_ZEPHYR_INT_TYPES to
DEPRECATED_ZEPHYR_INT_TYPES.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-09 06:49:56 -05:00
Stephanos Ioannidis 6098f099ca arch: arm: Remove header shims
This commit removes the header shims introduced after AArch32/64
re-organisation in the commit d048faacf2.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-06-09 10:38:36 +02:00
Peter Bigot 7d3b299b33 device: use helper macro in device define macros
Avoid duplication of the encoding of the public device identifier by
using the constructing macro in definitions.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-08 15:01:52 -04:00
Peter A. Bigot 2f269b2ecf Bluetooth: GATT: allow references to const uuids
User and implementation code may change the uuid pointer stored in
discover and gatt_read parameter structures, but it should never
mutate the pointed-to-value.  Add a const qualifer so UUIDs stored in
flash can be referenced.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-06-08 19:56:04 +03:00
Ilya Tagunov 2b076d8bc7 net: wifi: add extern "C" to wifi_mgmt.h
Add extern "C" to net/wifi_mgmt.h to support C++ usage.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2020-06-08 19:48:05 +03:00
Kumar Gala e353d123fd zephyr: Make Zephyr int types deprecated by default
As the int types defined in include/zephyr/types.h are typdef's we
utilize a Kconfig option (LEGACY_ZEPHYR_INT_TYPES) to enable/disable
the support for them.  By default to LEGACY_ZEPHYR_INT_TYPES not
being enabled and add an explicit test to ensure the types continue to
function until removed in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Kumar Gala 7dc3ecd63d stdint.h: Make {u}int64_t types consistent regardless of arch
On 64-bit arch's like AARCH64, x86_64, or riscv-64 the way {u}int64_t
will differ from how its defined on 32-bit arch's.  Do the same trick we
do for {u}int32_t for {u}int64_t so that the type is the same regardless
of what we are building for.

This keeps things like %lld working the same regardless of 32-bit or
64-bit arch.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00