dts: bindings: can: rename bus-speed/bus-speed-data properties
Deprecate the CAN controller bus-speed/bus-speed-data properties and rename them to bitrate/bitrate-data to match the terminology used in other CAN devicetree properties and the CAN subsystem API. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
parent
23b4706e47
commit
695e704b5d
8 changed files with 33 additions and 11 deletions
|
@ -101,7 +101,7 @@ stopping the processing of CAN frames.
|
|||
.. note::
|
||||
The CAN controller mode and timing can only be changed while the CAN controller is stopped, which
|
||||
is the initial setting upon boot-up. The initial CAN controller mode is set to ``normal`` and the
|
||||
initial timing is set according to the ``bus-speed``, ``sample-point``, ``bus-speed-data``, and
|
||||
initial timing is set according to the ``bitrate``, ``sample-point``, ``bitrate-data``, and
|
||||
``sample-point-data`` :ref:`devicetree` properties.
|
||||
|
||||
Timing
|
||||
|
|
|
@ -247,8 +247,9 @@ Controller Area Network (CAN)
|
|||
=============================
|
||||
|
||||
* Removed the following deprecated CAN controller devicetree properties. Out-of-tree boards using
|
||||
these properties need to switch to using the ``bus-speed``, ``sample-point``, ``bus-speed-data``,
|
||||
and ``sample-point-data`` devicetree properties for specifying the initial CAN bitrate:
|
||||
these properties can switch to using the ``bitrate``, ``sample-point``, ``bitrate-data``, and
|
||||
``sample-point-data`` devicetree properties (or rely on :kconfig:option:`CAN_DEFAULT_BITRATE` and
|
||||
:kconfig:option:`CAN_DEFAULT_BITRATE_DATA`) for specifying the initial CAN bitrate:
|
||||
|
||||
* ``sjw``
|
||||
* ``prop-seg``
|
||||
|
@ -259,6 +260,9 @@ Controller Area Network (CAN)
|
|||
* ``phase-seg1-data``
|
||||
* ``phase-seg1-data``
|
||||
|
||||
The ``bus-speed`` and ``bus-speed-data`` CAN controller devicetree properties have been
|
||||
deprecated.
|
||||
|
||||
(:github:`68714`)
|
||||
|
||||
* Support for manual bus-off recovery was reworked (:github:`69460`):
|
||||
|
|
|
@ -28,7 +28,7 @@ config CAN_DEFAULT_BITRATE
|
|||
default 125000
|
||||
help
|
||||
Default initial CAN bitrate in bits/s. This can be overridden per CAN controller using the
|
||||
"bus-speed" devicetree property.
|
||||
"bitrate" devicetree property.
|
||||
|
||||
config CAN_DEFAULT_BITRATE_DATA
|
||||
int "Default CAN data phase bitrate"
|
||||
|
@ -36,7 +36,7 @@ config CAN_DEFAULT_BITRATE_DATA
|
|||
depends on CAN_FD_MODE
|
||||
help
|
||||
Default initial CAN data phase bitrate in bits/s. This can be overridden per CAN controller
|
||||
using the "bus-speed-data" devicetree property.
|
||||
using the "bitrate-data" devicetree property.
|
||||
|
||||
config CAN_SHELL
|
||||
bool "CAN shell"
|
||||
|
|
|
@ -4,6 +4,14 @@ include: base.yaml
|
|||
|
||||
properties:
|
||||
bus-speed:
|
||||
type: int
|
||||
deprecated: true
|
||||
description: |
|
||||
Deprecated. This property has been renamed to bitrate.
|
||||
|
||||
Initial bitrate in bit/s. If this is unset, the initial bitrate is set to
|
||||
CONFIG_CAN_DEFAULT_BITRATE.
|
||||
bitrate:
|
||||
type: int
|
||||
description: |
|
||||
Initial bitrate in bit/s. If this is unset, the initial bitrate is set to
|
||||
|
|
|
@ -4,6 +4,14 @@ include: can-controller.yaml
|
|||
|
||||
properties:
|
||||
bus-speed-data:
|
||||
type: int
|
||||
deprecated: true
|
||||
description: |
|
||||
Deprecated. This property has been renamed to bitrate-data.
|
||||
|
||||
Initial data phase bitrate in bit/s. If this is unset, the initial data phase bitrate is set
|
||||
to CONFIG_CAN_DEFAULT_BITRATE_DATA.
|
||||
bitrate-data:
|
||||
type: int
|
||||
description: |
|
||||
Initial data phase bitrate in bit/s. If this is unset, the initial data phase bitrate is set
|
||||
|
|
|
@ -374,11 +374,12 @@ struct can_driver_config {
|
|||
.phy = DEVICE_DT_GET_OR_NULL(DT_PHANDLE(node_id, phys)), \
|
||||
.min_bitrate = DT_CAN_TRANSCEIVER_MIN_BITRATE(node_id, _min_bitrate), \
|
||||
.max_bitrate = DT_CAN_TRANSCEIVER_MAX_BITRATE(node_id, _max_bitrate), \
|
||||
.bus_speed = DT_PROP_OR(node_id, bus_speed, CONFIG_CAN_DEFAULT_BITRATE), \
|
||||
.bus_speed = DT_PROP_OR(node_id, bitrate, \
|
||||
DT_PROP_OR(node_id, bus_speed, CONFIG_CAN_DEFAULT_BITRATE)), \
|
||||
.sample_point = DT_PROP_OR(node_id, sample_point, 0), \
|
||||
IF_ENABLED(CONFIG_CAN_FD_MODE, \
|
||||
(.bus_speed_data = DT_PROP_OR(node_id, bus_speed_data, \
|
||||
CONFIG_CAN_DEFAULT_BITRATE_DATA), \
|
||||
(.bus_speed_data = DT_PROP_OR(node_id, bitrate_data, \
|
||||
DT_PROP_OR(node_id, bus_speed_data, CONFIG_CAN_DEFAULT_BITRATE_DATA)), \
|
||||
.sample_point_data = DT_PROP_OR(node_id, sample_point_data, 0),)) \
|
||||
}
|
||||
|
||||
|
|
|
@ -15,8 +15,9 @@
|
|||
LOG_MODULE_REGISTER(app);
|
||||
|
||||
#define CAN_INTERFACE DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus))
|
||||
#define CAN_BITRATE (DT_PROP_OR(DT_CHOSEN(zephyr_canbus), bus_speed, \
|
||||
CONFIG_CAN_DEFAULT_BITRATE) / 1000)
|
||||
#define CAN_BITRATE (DT_PROP_OR(DT_CHOSEN(zephyr_canbus), bitrate, \
|
||||
DT_PROP_OR(DT_CHOSEN(zephyr_canbus), bus_speed, \
|
||||
CONFIG_CAN_DEFAULT_BITRATE)) / 1000)
|
||||
|
||||
static struct gpio_dt_spec led_green_gpio = GPIO_DT_SPEC_GET_OR(
|
||||
DT_ALIAS(green_led), gpios, {0});
|
||||
|
|
|
@ -22,7 +22,7 @@ The Zephyr end of the CAN fixture can be configured as follows:
|
|||
* The CAN controller to be used is set using the ``zephyr,canbus`` chosen devicetree node.
|
||||
* The CAN bitrates are set using :kconfig:option:`CONFIG_CAN_DEFAULT_BITRATE` and
|
||||
:kconfig:option:`CONFIG_CAN_DEFAULT_BITRATE_DATA`, but can be overridden on a board level using
|
||||
the ``bus-speed`` and ``bus-speed-data`` CAN controller devicetree properties if needed. Default
|
||||
the ``bitrate`` and ``bitrate-data`` CAN controller devicetree properties if needed. Default
|
||||
bitrates are 125 kbits/s for the arbitration phase/CAN classic and 1 Mbit/s for the CAN FD data
|
||||
phase when using bitrate switching (BRS).
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue