Commit graph

55626 commits

Author SHA1 Message Date
Martí Bolívar
831332068b pwm: it8xxx2: use new DT pinctrl accessors
Update to use the new APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
7ab602a843 soc: stm32: use new DT pinctrl accessors
Update to use the new APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
02b45f522f soc: riscv-ite: use new DT pinctrl accessors
Update to use the new APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
d40037c56e soc: nuvoton_npcx: use new DT pinctrl accessors
Update to use the new APIs. Fix a typo while I'm here.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
73c7f55a45 soc: cypress: use new DT pinctrl accessors
Update to use the new APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
865ea9c5f7 soc: atmel: use new DT pinctrl accessors
Update to use the new APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
e0b41a8f51 doc: document devicetree/pinctrl.h macros
Add a new section in the API reference for the newly added
devicetree/pinctrl.h macros.

Amend macros.bnf in the guide to reflect the new generated macros for
getting at pinctrl information by name.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
aa8fc3d7ff devicetree: add tests for devicetree/pinctrl.h macros
Test cases for new APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
f4115423fa devicetree: add devicetree/pinctrl.h
This contains accessor macros for getting phandles out of pinctrl
properties by name and index. As usual, the representation in C for a
phandle is a node identifier.

Add these new macros:

- DT_PINCTRL_BY_IDX(node_id, pc_idx, idx): phandle at index idx
  in the pinctrl-<pc_idx> property

- DT_PINCTRL_0(node_id, idx): pinctrl-0 convenience for the same

- DT_PINCTRL_BY_NAME(node_id, name, idx): phandle at index idx
  in the pinctrl property named 'name'

- DT_PINCTRL_NAME_TO_IDX(node_id, name): convert a pinctrl property
  name to its index number

- DT_NUM_PINCTRLS_BY_IDX(node_id, pc_idx): number of phandles in
  pinctrl-<pc_idx>

- DT_NUM_PINCTRLS_BY_NAME(node_id, name): number of phandles in a
  named pinctrl property

- DT_NUM_PINCTRL_STATES(node_id): total number of pinctrl-<pc_idx>
  properties

- DT_PINCTRL_HAS_IDX(node_id, pc_idx): does pinctrl-<pc_idx> exist?

- DT_PINCTRL_HAS_NAME(node_id, name): does a named pinctrl property
  exist?

- DT_PINCTRL_IDX_TO_NAME_TOKEN(node_id, pc_idx): convert a pinctrl
  index to its name as a token, similar to DT_STRING_TOKEN()

- DT_PINCTRL_IDX_TO_NAME_UPPER_TOKEN(node_id, pc_idx): like
  DT_PINCTRL_IDX_TO_NAME_TOKEN, but with an uppercase result

As well as DT_DRV_INST equivalents, which take inst wherever node_id
appears above:

- DT_INST_PINCTRL_BY_IDX()
- DT_INST_PINCTRL_0()
- DT_INST_PINCTRL_BY_NAME()
- DT_INST_PINCTRL_NAME_TO_IDX()
- DT_INST_NUM_PINCTRLS_BY_IDX()
- DT_INST_NUM_PINCTRLS_BY_NAME()
- DT_INST_NUM_PINCTRL_STATES()
- DT_INST_PINCTRL_HAS_IDX()
- DT_INST_PINCTRL_HAS_NAME()
- DT_INST_PINCTRL_IDX_TO_NAME_TOKEN()
- DT_INST_PINCTRL_IDX_TO_NAME_UPPER_TOKEN()

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
d85118fde9 dts: test: fix vnd,adc-temp-sensor binding path
This isn't following the <compatible>.yaml naming convention; fix it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
9df0493dc3 scripts: gen_defines: emit pinctrl helper macros
We need to be able to access pinctrl-<index> property contents by
name, convert names to indexes, convert indexes to names, and perform
existence checks by name and by index.

This is currently not possible because we don't track these properties
the same way we do other named properties. That in turn is because
they are different then the usual named properties.

The usual case looks like this, picking DMAs just for the sake of
example:

  dmas = <&dma0 ...>, <&dma1 ...>;
  dma-names = "tx", "rx";

So "tx" is the name for the <&dma0 ...> element, and "rx" is the name
for the <&dma1 ...> element, all in a single "dmas" property.

By contrast, pinctrl properties look like this:

  pinctrl-0 = <&foo &bar ...>;
  pinctrl-1 = <&baz &blub ...>;
  pinctrl-names = "default", "sleep";

Here, "default" is the name for the entire pinctrl-0 property.
Similarly, "sleep" is the name of the pinctrl-1 property. It's a
strange situation where the node itself is kind of a container for an
array of pin control properties, which Zephyr's bindings language
can't really capture and has some special case handling in edtlib.

This is easiest to handle with ad-hoc code. Add special case macros
for pinctrls.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
7f69a03f72 scripts: gen_defines: refactor write_special_props
Move the partition handling code into its own function and rework the
comment. This is prep work for adding additional generated macros to
this function.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
3252821b4c scripts: gen_defines: fix typo
Missing 's'.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
fa2e82becd edtlib: emit pinctrl names as tokens
This will be necessary to going back and forth between indexes and
names in C.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Jordan Yates
9505ee89a3 linker: xtensa: move IDT_LIST region
Move the IDT_LIST memory region to the location recommended by
`intlist.ld`. The documentation specifies that this region should not
overlap other regions, and there is no guarantee that the area after the
`SRAM` region is not used. The end of the address space is much less
likely to be a valid RAM address.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-08-25 18:08:36 -04:00
Jordan Yates
b2dc1fc9fb linker: arm: move IDT_LIST region
Move the IDT_LIST memory region to the location recommended by
`intlist.ld`. The documentation specifies that this region should not
overlap other regions, and there is no guarantee that the area after the
`SRAM` region is not used. The end of the address space is much less
likely to be a valid RAM address.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-08-25 18:08:36 -04:00
Vinayak Kariappa Chettimada
43d8d34dc4 Bluetooth: Controller: Remove memcpy of SCAN_REQ and CONN_REQ PDUs
Removed implementation that used memcpy of received PDUs and
instead using the free Rx buffers; use the scratch PDU for
transmitting scan requests and connection requests.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:07:53 -04:00
Vinayak Kariappa Chettimada
c409b74f0d Bluetooth: Controller: Add lll_prof_reserve profiling function
Add the lll_prof_reserve and lll_prof_reserve_send profiling
functions to use when profiling active scanning and
initiator.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:07:53 -04:00
Vinayak Kariappa Chettimada
7426045a28 Bluetooth: Controller: Define invalid/unassigned node rx handle value
Add a define for invalid/unassigned node rx handle value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:07:53 -04:00
Erik Brockhoff
f41b3d7879 Bluetooth: Controller: Fix conn param req ack/req reset
llcp.conn_param.ack was reset on tx of conn param rsp, however this
should only be done once the expected conn update ind is received
and sets the cu.ack flag to indicate cu procedure 'takes over'.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:07:35 -04:00
Stephanos Ioannidis
8676ff01ec doc: getting_started: Fix incorrect literal block usage
The newly added CMake installation instruction incorrectly specified
*double* colon (literal block) instead of *single* colon after its list
item.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-25 18:07:17 -04:00
Emil Gydesen
a6fa3fb3aa Bluetooth: host: Define recommended per adv constants
These constants are based on (i.e. exactly as) the
recommended values for regular (i.e. non-periodic)
advertising.

The GAP spec does not actually specifiy these numbers (or any
numbers for periodic advertising), but they are sane
numbers to use for periodic advertisement.

The issue with using the non-periodic advertising
whereas the peridic advertising unit is 1.25ms.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-25 18:07:00 -04:00
Vinayak Kariappa Chettimada
5123b45761 Bluetooth: Controller: Initial support for advertising on S2/S8 coding
Added implementation to support advertising on S2/S8 coding
scheme.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Vinayak Kariappa Chettimada
193ce73109 Bluetooth: Controller: Fix missing resume of primary channel scanning
Fix missing implementation to release Auxiliary PDU chains
and then resume back to scanning on primary channel.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Vinayak Kariappa Chettimada
1ce46fd7a6 Bluetooth: Controller: Add PDU time calculation for S2 Coded PHY
Add PDU time calculation macro for S2 and S8 Coded PHY.
Rename PKT_AC_US to PDU_AC_MAX_US.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Vinayak Kariappa Chettimada
88b155de31 Bluetooth: Controller: Rename PKT_US to PDU_DC_MAX_US
Rename PKT_US to PDU_DC_MAX_US.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Vinayak Kariappa Chettimada
869d3c24d7 Bluetooth: Controller: Rename PKT_DC_US to PDU_MAX_US
Rename PKT_DC_US to PDU_MAX_US.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Vinayak Kariappa Chettimada
48f5990eea Bluetooth: Controller: Add missing range delay for extended active scan
Add missing range delay value when calculating the header
complete timeout value for the reception of extended scan
response PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Vinayak Kariappa Chettimada
6911e7e1d8 Bluetooth: Controller: Use the received coding scheme when scanning
Use the received coding scheme when scanning for correctly
calculating the receive chain delay and on-air PDU time.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Vinayak Kariappa Chettimada
cee9ce6b8e Bluetooth: Controller: Add Coded PHY Rx-ed coding get interface
Added a radio interface to fetch the received Coded PHY
coding scheme of the PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Henrik Brix Andersen
a2791ccfef drivers: interrupt_controller: plic is independent of risc-v privileged
The RISC-V Platform-Level Interrupt Controller (PLIC) was moved from the
RISC-V Privileged Specification v1.11 to a separate specification
(see https://github.com/riscv/riscv-plic-spec).

Reflect this by not automatically enabling the PLIC interrupt controller
driver for all RISC-V privileged SoCs, but only for SoCs with the
CONFIG_RISCV_HAS_PLIC Kconfig option enabled.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-08-25 18:06:34 -04:00
Emil Gydesen
7854088116 Bluetooth: ISO: Fixes missing handling of broadcast ISO TX
After 31045c7 was merged, it was possible to use broadcast
iso without CONFIG_BT_CONN, but it did not properly handle
TX as there were missing support to read the buffer
size from the controller, as well as missing support
for handling the number of completed packets event.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-25 18:06:09 -04:00
Emil Gydesen
96dfad0eef Bluetooth: host: Add ISO support for num_completed_packets event
Change so that num_completed_packets event handling is also
enabled for broadcast ISO only builds. This is because sending
data on a broadcast ISO still generates this event.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-25 18:06:09 -04:00
Emil Gydesen
24226b0135 Bluetooth: Host: Move bt_conn_create_pdu* out of ACL group
Move the function out of the ACL group as it may be used
for broadcast ISO only builds.

er 31045c7 was merged, it was possible to use broadcast
iso without CONFIG_BT_CONN, but it did not properly handle
TX and RX as there were missing support to read the buffer
size from the controller, as well as missing support
for handling the number of completed packets event.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-25 18:06:09 -04:00
Henrik Brix Andersen
e6a3e238b9 soc: riscv: privilege: define soc_interrupt_init() as weak symbol
Define soc_interrupt_init as a weak symbol in the common RISC-V
privileged instruction set SoC support.

This allows overriding soc_interrupt_init for SoCs which are not fully
compliant with the RISC-V privileged specification.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-08-25 18:05:50 -04:00
Henrik Brix Andersen
d8e0027082 soc: riscv: privilege: define __soc_handle_irq as weak symbol
Define __soc_handle_irq as a weak symbol in the common RISC-V privileged
instruction set SoC support.

This allows overriding __soc_handle_irq for SoCs which are not fully
compliant with the RISC-V privileged specification.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-08-25 18:05:50 -04:00
Johann Fischer
9ad610d1a7 bluetooth: remove Kconfig options CONFIG_BT_*_ON_DEV_NAME
Follow up on commit bfd45e5b8c
("drivers: remove Kconfig option CONFIG_UART_CONSOLE_ON_DEV_NAME")
Remove Kconfig options
CONFIG_BT_UART_ON_DEV_NAME and CONFIG_BT_MONITOR_ON_DEV_NAME
since all UART drivers are converted to devicetree and we can just use
DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_uart)) and
DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_mon_uart)).

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-25 18:05:17 -04:00
Stephanos Ioannidis
58dbd41b96 tests: arch: arm_no_multithreading: Run on mps3_an547 board
This commit updates the `arm_no_multithreading` test to run on the
recently added `mps3_an547` board.

The `mps3_an547` SoC includes the Cortex-M55 processor which implements
the ARMv8.1-M architecture that is not covered by any of the boards in
the current "allowed platforms" list for this test.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-25 18:05:01 -04:00
Stephanos Ioannidis
ba7fda70ff tests: arch: arm_no_multithreading: Fix FPSCR validation for ARMv8.1-M
This commit fixes the FPSCR register initialisation validation test
for the ARMv8.1-M architecture.

For ARMv8.1-M, the newly added LTPSIZE field in the FPSCR may always
read the value of 4 when the M-Profile Vector Extension (MVE) is not
implemented or FP context is not active, so we must ignore its value
when validating the FPSCR register initialisation.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-25 18:05:01 -04:00
Stephanos Ioannidis
06b1501694 tests: arch: arm_thread_swap: Fix FPSCR validation for ARMv8.1-M
This commit fixes the FPSCR register initialisation validation test
for the ARMv8.1-M architecture.

For ARMv8.1-M, the newly added LTPSIZE field in the FPSCR may always
read the value of 4 when the M-Profile Vector Extension (MVE) is not
implemented or FP context is not active, so we must ignore its value
when validating the FPSCR register initialisation.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-25 18:05:01 -04:00
Tim Lin
9938519c93 ITE: soc: it8xxx2: add register build asserts to validate the offsets
Add build asserts to validate the offsets are the expected value.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2021-08-25 18:04:37 -04:00
Tim Lin
033eb55aca ITE: riscv: it8xxx2: declare gctrl dts node and registers
Add general control(gctrl) node in dts, and declare gctrl registers

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2021-08-25 18:04:37 -04:00
Carlo Caione
3dd7fd4f70 ipc: Call ipm_set_enabled() on RX channel also for dual IPM support
The IPC drivers rpmsg_service and rpmsg_multi_instance are not
explicitly enabling the RX IPM channel when two different devices are
used for TX and RX. While this could be redundant for some IPM drivers,
in some cases the hardware needs to be enabled before using it.

Add the missing calls to ipm_set_enabled() for both the devices.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-08-25 18:04:01 -04:00
Erwan Gouriou
661bf176bb boards: nucleo_g01re: Missing zephyr_udc0 alternate node label
This board is missing new usb device controller alternate node label.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-08-25 18:03:31 -04:00
Martí Bolívar
6e9e984e60 dtlib: remove pylint suppression
This became useless when _init_tokens() was refactored not to use
global variables (in "dtlib: use IntEnum for token IDs"), and the
linter is complaining about it now.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:03:17 -04:00
Martí Bolívar
227ce89c41 edtlib: use f-strings where it makes sense
Similarly to what was done for dtlib, use f-strings in places where it
improves readability. Some places, e.g. __repr__ methods that
construct a string using something like

    "<SomeType, {}>".format(", ".join(...))

are better left off as-is.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:03:17 -04:00
Martí Bolívar
66ee3d291c dtlib: use f-strings where it makes sense
The library was originally developed before Python 3.6 was the minimum
supported version. Use f-strings now that we can do that, as they tend
to be easier to read.

There are a few places where str.format() makes sense to preserve,
specifically where the same argument is used multiple times; leave
those alone.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:03:17 -04:00
Stephanos Ioannidis
a61517b58e doc: release-notes: Mention CMSIS version update
Mention that the CMSIS version has been updated to 5.8.0 in the Zephyr
2.7 release.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-25 18:02:54 -04:00
Stephanos Ioannidis
2df354313a west.yml: Update CMSIS-Core components to 5.8.0 release
Update the CMSIS-Core components to the CMSIS 5.8.0 release:

* CMSIS-Core(M) 5.5.0
* CMSIS-Core(A) 1.2.1

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-25 18:02:54 -04:00
Piotr Pryga
0395f46126 Bluetooth: controller: hci: Add missing DF conn-less cmds to supp list
There were missing commands in local supported commands list that
are related with connectionless direction finding.
The commands are implemented but they haven't been added
to HCI_Read_Local_Supported_Commands list.
The commit fixes that.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-08-25 18:02:39 -04:00