Skip to content

Commit

Permalink
tests: drivers: can: Add support for RZ/G3S-SMARC
Browse files Browse the repository at this point in the history
Add test support for CAN driver of RZ/G3S-SMARC

Signed-off-by: Hieu Nguyen <hieu.nguyen.ym@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
  • Loading branch information
Hieu Nguyen authored and nhutnguyenkc committed Jan 10, 2025
1 parent 87f5a89 commit b37f36e
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/ {
chosen {
zephyr,canbus = &canfd0;
};
};

&canfd_global {
status = "okay";
};

&gpio13{
status = "okay";
};

&canfd0 {
pinctrl-0 = <&can0_pins>;
pinctrl-names = "default";
status = "okay";
rx-max-filters = <32>;
phys = <&transceiver0>;
};
4 changes: 4 additions & 0 deletions tests/drivers/can/api/src/canfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,11 @@ ZTEST_USER(canfd, test_set_timing_data_while_started)
struct can_timing timing = { 0 };
int err;

#ifdef CONFIG_CAN_RENESAS_RZ_CANFD
err = can_calc_timing_data(can_dev, &timing, TEST_BITRATE_3, TEST_SAMPLE_POINT_2);
#else
err = can_calc_timing_data(can_dev, &timing, TEST_BITRATE_3, TEST_SAMPLE_POINT);
#endif
zassert_ok(err, "failed to calculate data timing (err %d)", err);

err = can_set_timing_data(can_dev, &timing);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/ {
chosen {
zephyr,canbus = &canfd0;
};
};

&canfd_global {
status = "okay";
};

&gpio13{
status = "okay";
};

&canfd0 {
pinctrl-0 = <&can0_pins>;
pinctrl-names = "default";
status = "okay";
rx-max-filters = <32>;
phys = <&transceiver0>;
};

0 comments on commit b37f36e

Please sign in to comment.