Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NXP S32 introduce support SENT #80117

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions boards/nxp/s32z2xxdc2/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ The boards support the following hardware features:
+-----------+------------+-------------------------------------+
| EDMA | on-chip | dma |
+-----------+------------+-------------------------------------+
| SENT | on-chip | sent |
+-----------+------------+-------------------------------------+

Other hardware features are not currently supported by the port.

Expand Down
1 change: 1 addition & 0 deletions drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ add_subdirectory_ifdef(CONFIG_RETAINED_MEM retained_mem)
add_subdirectory_ifdef(CONFIG_RTC rtc)
add_subdirectory_ifdef(CONFIG_SDHC sdhc)
add_subdirectory_ifdef(CONFIG_SENSOR sensor)
add_subdirectory_ifdef(CONFIG_SENT sent)
add_subdirectory_ifdef(CONFIG_SERIAL serial)
add_subdirectory_ifdef(CONFIG_SMBUS smbus)
add_subdirectory_ifdef(CONFIG_SPI spi)
Expand Down
1 change: 1 addition & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ source "drivers/retained_mem/Kconfig"
source "drivers/rtc/Kconfig"
source "drivers/sdhc/Kconfig"
source "drivers/sensor/Kconfig"
source "drivers/sent/Kconfig"
source "drivers/serial/Kconfig"
source "drivers/sip_svc/Kconfig"
source "drivers/smbus/Kconfig"
Expand Down
8 changes: 8 additions & 0 deletions drivers/sent/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2024 NXP
# SPDX-License-Identifier: Apache-2.0

zephyr_syscall_header(${ZEPHYR_BASE}/include/zephyr/drivers/sent/sent.h)

zephyr_library()

zephyr_library_sources_ifdef(CONFIG_SENT_NXP_S32 sent_nxp_s32.c)
23 changes: 23 additions & 0 deletions drivers/sent/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 NXP
# SPDX-License-Identifier: Apache-2.0

menuconfig SENT
bool "Single Edge Nibble Transmission (SENT)"
help
Enable SENT Driver Configuration

if SENT

module = SENT
module-str = sent
source "subsys/logging/Kconfig.template.log_config"

config SENT_INIT_PRIORITY
int "SENT driver init priority"
default KERNEL_INIT_PRIORITY_DEVICE
help
SENT driver device initialization priority.

source "drivers/sent/Kconfig.nxp_s32"

endif # SENT
9 changes: 9 additions & 0 deletions drivers/sent/Kconfig.nxp_s32
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2024 NXP
# SPDX-License-Identifier: Apache-2.0

config SENT_NXP_S32
bool "NXP S32 SENT driver"
default y
depends on DT_HAS_NXP_S32_SENT_CONTROLLER_ENABLED && DT_HAS_NXP_S32_SENT_CHANNEL_ENABLED
help
Enable support for NXP S32 SENT driver.
351 changes: 351 additions & 0 deletions drivers/sent/sent_nxp_s32.c

Large diffs are not rendered by default.

121 changes: 121 additions & 0 deletions dts/arm/nxp/nxp_s32z27x_r52.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -1245,5 +1245,126 @@
status = "disabled";
};

sent_0: sent@40a50000 {
compatible = "nxp,s32-sent-controller";
reg = <0x40a50000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <GIC_SPI 428 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>,
<GIC_SPI 429 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>,
<GIC_SPI 430 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>;
interrupt-names = "fast_msg", "slow_msg", "error";
clocks = <&clock NXP_S32_P1_REG_INTF_CLK>;
status = "disabled";

sent_0_ch0: ch@0 {
compatible = "nxp,s32-sent-channel";
reg = <0>;
status = "disabled";
};

sent_0_ch1: ch@1 {
compatible = "nxp,s32-sent-channel";
reg = <1>;
status = "disabled";
};

sent_0_ch2: ch@2 {
compatible = "nxp,s32-sent-channel";
reg = <2>;
status = "disabled";
};

sent_0_ch3: ch@3 {
compatible = "nxp,s32-sent-channel";
reg = <3>;
status = "disabled";
};

sent_0_ch4: ch@4 {
compatible = "nxp,s32-sent-channel";
reg = <4>;
status = "disabled";
};

sent_0_ch5: ch@5 {
compatible = "nxp,s32-sent-channel";
reg = <5>;
status = "disabled";
};

sent_0_ch6: ch@6 {
compatible = "nxp,s32-sent-channel";
reg = <6>;
status = "disabled";
};

sent_0_ch7: ch@7 {
compatible = "nxp,s32-sent-channel";
reg = <7>;
status = "disabled";
};
};

sent_1: sent@42050000 {
compatible = "nxp,s32-sent-controller";
reg = <0x42050000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <GIC_SPI 455 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>,
<GIC_SPI 456 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>,
<GIC_SPI 457 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>;
interrupt-names = "fast_msg", "slow_msg", "error";
clocks = <&clock NXP_S32_P4_REG_INTF_CLK>;
status = "disabled";

sent_1_ch0: ch@0 {
compatible = "nxp,s32-sent-channel";
reg = <0>;
status = "disabled";
};

sent_1_ch1: ch@1 {
compatible = "nxp,s32-sent-channel";
reg = <1>;
status = "disabled";
};

sent_1_ch2: ch@2 {
compatible = "nxp,s32-sent-channel";
reg = <2>;
status = "disabled";
};

sent_1_ch3: ch@3 {
compatible = "nxp,s32-sent-channel";
reg = <3>;
status = "disabled";
};

sent_1_ch4: ch@4 {
compatible = "nxp,s32-sent-channel";
reg = <4>;
status = "disabled";
};

sent_1_ch5: ch@5 {
compatible = "nxp,s32-sent-channel";
reg = <5>;
status = "disabled";
};

sent_1_ch6: ch@6 {
compatible = "nxp,s32-sent-channel";
reg = <6>;
status = "disabled";
};

sent_1_ch7: ch@7 {
compatible = "nxp,s32-sent-channel";
reg = <7>;
status = "disabled";
};
};
};
};
49 changes: 49 additions & 0 deletions dts/bindings/sent/nxp,s32-sent-channel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2024 NXP
#
# SPDX-License-Identifier: Apache-2.0

description: Properties for Single Edge Nibble Transmission (SENT) Receiver channel

compatible: "nxp,s32-sent-channel"

include: base.yaml

properties:
num-data-nibbles:
type: int
required: true
description: |
The number of data nibbles.

tick-time-prescaler-us:
type: int
required: true
description: |
The tick time prescaler in us.

bus-timeout-cycles:
type: int
required: true
enum:
- 0
- 256
- 512
- 1024
- 2048
description: |
The bus timeout cycles.

calib-method-low-latency:
type: boolean
description: |
The successive calibration pulse check method with low latency.

slow-crc-no-data-nibble-xor:
type: boolean
description: |
The slow message CRC implementation does not use the zero data nibble XOR method.

fast-crc-no-data-nibble-xor:
type: boolean
description: |
The fast message CRC implementation does not use the zero data nibble XOR method.
9 changes: 9 additions & 0 deletions dts/bindings/sent/nxp,s32-sent-controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2024 NXP
#
# SPDX-License-Identifier: Apache-2.0

description: Properties for Single Edge Nibble Transmission (SENT) Receiver

compatible: "nxp,s32-sent-controller"

include: [base.yaml, pinctrl-device.yaml]
Loading
Loading