Commit graph

54884 commits

Author SHA1 Message Date
Yuriy Vynnychek
d011e782c7 dts: riscv: add Telink B91 IEEE802154 driver support
Added IEEE802154 driver DTSI support for Telink B91 platform.

Signed-off-by: Yuriy Vynnychek <yura.vynnychek@telink-semi.com>
2021-08-04 11:58:02 +02:00
Vinayak Kariappa Chettimada
4661ae3c21 Bluetooth: Controller: Fix Extended Scanning Address Resolution
Fix the received Extended Advertising PDU's address
resolution latency due to missing reset of pending IRQ in
the NVIC which caused the wait loop from not exit correctly.

Fixes #30243.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-04 10:37:08 +02:00
Vinayak Kariappa Chettimada
fcc15f713a Bluetooth: Controller: Fix resolving index from being overwritten
When generating LE Extended Advertising Report the device
address can be either in primary or auxiliary channel PDU,
do not overwrite resolving list index if present in primary
channel PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-04 10:36:46 +02:00
Kumar Gala
8566bfec26 ci: github: bump SDK usage to 0.13.0
Now that SDK 0.13.0 is out, bump all github workflows to utilize it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-08-03 22:58:14 -04:00
Kumar Gala
8bac519604 docs: Update for SDK 0.13.0
Update docs to reference SDK 0.13.0.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-08-03 22:57:57 -04:00
Kumar Gala
2f2bc57ba6 ci: Bump to use SDK 0.13.0
Now that SDK 0.13.0 is released bump buildkite based CI to utilize it

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-08-03 22:57:41 -04:00
Johann Fischer
4b79912dc7 usb: check request direction in request handlers
Check request direction in standard device,
interface, and endpoint request handlers.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
af3e1096f5 usb: cleanup standard interfave request handler
Cleanup standard device request handler.
Pass pointer to setup packet as argument where
it is reasonable.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
49745250e4 usb: cleanup standard endpoing request handler
Cleanup standard endpoint request handler.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
d2ff6f4fdc usb: cleanup standard device request handler
Cleanup standard device request handler.
Pass pointer to setup packet as argument where
it is reasonable.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
961d4a63fd usb: hid: obtain the requested length from wLength
Obtain the requested length from wLength and assign the
possible length to len argument.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
315e148864 usb: dfu: halt endpoint on flash API error or block mismatch
Halt endpoint on flash API error or block mismatch.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
d6e2c8afa1 usb: dfu: check control request direction
Check control request direction and split class request handler
by request direction.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
8c592e4155 samples: wpanusb: return -ENOTSUP on unsupported device-to-host requests
Control pipe in wpanusb is used only for host-to-device requests.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
63707e304a samples: webusb: return -ENOTSUP on host-to-device control requests
The sample only supports device-to-host control requests.
Return -ENOTSUP on host-to-device control requests.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
7aeed96e5d usb: msc: additionally check control request direction
Rework class control request handler and add control
request direction check.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
4e6bf5b567 usb: bt_h4: return -ENOTSUP on vendor requests
This class does not handle any vendor request,
therefore just return -ENOTSUP on any vendor request.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
4adde81b43 usb: bluetooth: additionally check control request direction
HCI commands are always directed to controller and should be
host-to-device class control requests.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
78b9acf852 usb: audio: additionally check control request direction
Rework mute request handling and add checks for
control request direction.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
37d8236be4 usb: rndis: return error on incorrect/unsupported request
Return ENOTSUP if request is unsupported and pass on the error
from encapsulated command/response functions.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
a5493a5c71 usb: cdc_ecm: return error on incorrect/unsupported request
Control request handler from CDC ECM implementation does not
care at all about returning errors when a request is not supported.
Return EINVAL/ENOTSUP if request is incorrect/unsupported.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
e9f9138997 usb: loopback: use class internal buffer to store request data
Use internal buffer to store request data and not
the data OUT stage buffer.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
5698e17aa0 usb: cdc_acm: enhance verification of the class control requests
Rework CDC ACM class control request handling and
check the control transfer direction.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
781c367730 usb: set data stage length variable to zero by default
Set data stage length variable to zero as a precaution
so that no trouble happens if control request handler
does not check the request values sufficiently.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Jordan Yates
6cf6d515b1 sensor: sht3xd: convert to i2c_dt_spec
Convert sht3xd driver to `struct i2c_dt_spec` as a demonstration.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-08-03 19:05:14 -04:00
Jordan Yates
7bdb22941c sensor: bme680: convert to i2c_dt_spec
Convert bme680 driver to `struct i2c_dt_spec` as a demonstration.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-08-03 19:05:14 -04:00
Jordan Yates
c894ad12b5 i2c: add _dt variants of i2c functions
Add variants of all i2c transfer functions that accept an `i2c_dt_spec`
as the bus specifier. This helps reduce code duplication in device
drivers.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-08-03 19:05:14 -04:00
Jordan Yates
6964fa8fbd i2c: introduce struct i2c_dt_spec
Introduces the `struct i2c_dt_spec` type, which contains the complete
I2c bus information derived from devicetree. It serves the same purpose
as `struct spi_dt_spec` in that it can be constructed automatically in
`DEVICE_DT_INST_DEFINE` macros and provided as a single handle to I2C
API calls. While I2C has much less instance configuration than SPI, this
is still useful to enable the following pattern in device drivers that
support both I2C and SPI comms:

```
struct config {
    union {
        struct spi_dt_spec spi;
        struct i2c_dt_spec i2c;
    };
};
```

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-08-03 19:05:14 -04:00
Scott Worley
2070c0997f Microchip: MEC172x: Update pinmux driver
Update the Microchip XEC pinmux driver to use system I/O
routine for read/write of registers instead of direct use
of volatile and CMSIS defines. Add GPIO port number to
bindings instead of using hard coded value from chip headers.
Modify SoC DTSI pinmux syntax, requires "pinmux: pinumx {..."
or the DT macros will not work. Since pinmux is used by MEC152x
we update its chip pinmux DT.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-08-03 19:04:56 -04:00
John Kjellberg
f452a086fb drivers: led: Add LED driver support for TLC59108
Add support for TI TLC59108 an I2C 8-bit LED driver.
Supported blinkink period: 41ms to 10730ms
Supported brightness value: 0 to 100%

This driver supports the following APIs:

1. led_blink
2. led_set_brightness
3. led_on
4. led_off

This is a modified version of the NXP PCA9633 driver.

Signed-off-by: John Kjellberg <kjellberg.john@gmail.com>
2021-08-03 19:03:29 -04:00
Fabio Baltieri
94711f1ced doc: reference: add a page for iterable sections
Group together the iterable section functions and add a corresponding
documentation page.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2021-08-03 19:02:43 -04:00
Fabio Baltieri
ae3b792016 toolchain: redefine iterable section APIs as non internal
Redefine the APIs used to deal with iterable sections to an alias
without the Z_ prefix, so that they can be used by Zephyr applications.

Fix the associated comments so that they are handled correctly by
Doxygen.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2021-08-03 19:02:43 -04:00
Fabio Baltieri
4dfe7d24fe doc: doxygen: predefine _LINKER
Linker APIs are defined in a "#ifdef _LINKER" block. Adding _LINKER to
the Doxygen PREDEFINED list so that they get picked up when generating
the documentation.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2021-08-03 19:02:43 -04:00
Johann Fischer
eb8fc7a727 doc: release-notes-2.7: add note about the removal of USB option
Add release note about removal of Kconfig USB option.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Johann Fischer
3240e0cc51 tests: remove USB configuration option
Remove USB configuration option, replace it where necessary
with USB_DEVICE_STACK.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Johann Fischer
946964e374 samples: remove USB configuration option
Remove USB configuration option, replace it where necessary
with USB_DEVICE_STACK.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Johann Fischer
76364215f3 boards: remove USB option for STM32 based boards
It is enough to set the USB_DEVICE_STACK option to enable
USB device support.
Remove USB_DC_STM32 for mikroe_mini_m4_for_stm32 board
since it is already selected on SoC level.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Johann Fischer
9512ae488a boards: remove USB option for nRF based boards
It is enough to set the USB_DEVICE_STACK option to enable
USB device support. Also the option USB_NRFX is not necessary
here because it is selected in drivers/usb/device/Kconfig anyway.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Johann Fischer
775a69f09d boards: remove USB configuration option for xtensa/native_posix boards
Remove USB configuration option.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Johann Fischer
3692f03501 boards: remove USB configuration option from *_defconfig
The USB option alone only caused the driver to be built
and actually has no benefit. Remove it from *_defconfig files.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Johann Fischer
6e1e2fba82 soc: replace USB configuration option with USB_DEVICE_DRIVER
Replace USB configuration option with USB_DEVICE_DRIVER
since on the SoC level the specific driver is selected.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Johann Fischer
ae074e81d4 usb: remove Kconfig option CONFIG_USB
The USB configuration option is actually a global switch
to enable USB drivers in general, but currently only
the device controller drivers are meant.

USB device controller drivers also have USB_DEVICE_DRIVER option.
Thus the option USB is actually redundant and can be replaced
by the self-explanatory option USB_DEVICE_DRIVER.
The name USB itself is not unique and should not be used as an
configuration option.

With these changes the option USB_DEVICE_DRIVER generally
enables USB device controller drivers. The option USB_DEVICE_STACK
enables USB device support. It is sufficient to enable only option
USB_DEVICE_STACK because it selects USB_DEVICE_DRIVER.

CONFIG_USB Kconfig option is temporary added to subsys/usb/Kconfig.
This is necessary to pass CI and will be removed again
when the USB configuration has been adapted in modules.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Krzysztof Chruscinski
8c68a7a587 tests: subsys: logging: log_api: Fix test for 64 bit timestamp
Test for dropping log messages was expecting certain number of
dropped messages assuming that buffer size is dividable by the
message size. That was not the case when timestamp was 64 bit.
In that case, additional message is dropped.

Modified the test to take that into account.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-08-03 16:11:49 -05:00
Krzysztof Chruscinski
013c2da3e1 tests: subsys: logging: log_api: Minor improvemnt in mock
Use long long to print 64 bit timestamps in zassert macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-08-03 16:11:49 -05:00
Krzysztof Chruscinski
12f366c954 logging: Add resetting of dropped_cnt to init
It is mainly for testing purposes where logging is multiple times
reinitialized.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-08-03 16:11:49 -05:00
Martí Bolívar
c4079e4be2 scripts: rework edtlib warnings-turned-errors
Create a "global" gen_defines.py option and edtlib.EDT constructor
kwarg that turns edtlib-specific warnings into errors. This applies to
edtlib-specific warnings only. Warnings that are just dupes of dtc
warnings are not affected.

Use it from twister to increase DT testing coverage in upstream zephyr.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-03 12:21:45 -05:00
Martí Bolívar
f261d77c75 cmake: dts: warn on unrecognized vendor prefixes
This uses the list of vendor prefixes provided by the user by default.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-03 12:21:45 -05:00
Martí Bolívar
6719fae101 edtlib: warn on unrecognized vendors
An unknown vendor prefix is now a warning. We augment the list of
vendor prefixes passed by the user with a grandfathered-in bunch from
Linux.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-03 12:21:45 -05:00
Martí Bolívar
7b60fa3a15 edtlib: move vendor-prefixes.txt parsing in here
Take this helper from the doc tooling and expose it as API.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-03 12:21:45 -05:00
Martí Bolívar
043304bf7e dts: vendor-prefixes.txt: add 'arduino'
This is a common Zephyr addition.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-03 12:21:45 -05:00