From 3a280bab8283f838ade2872d6d06d44aa2462f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= Date: Thu, 22 Sep 2022 11:11:08 +0200 Subject: [PATCH] boards: posix: native_posix: enable can_loopback0 by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .yaml file states that CAN is supported, but the basic sample application samples/drivers/can/counter cannot be compiled without additional configuration. The loopback driver does not require any additional steps like the linux SocketCAN driver, so it is safe to enable it by default and get rid of the many overlay files in the tests. ISO-TP tests and the counter sample are excluded via .yaml from twister tests because of timing issues. Signed-off-by: Martin Jäger --- boards/posix/native_posix/native_posix.dts | 2 +- samples/drivers/can/counter/sample.yaml | 1 + samples/net/sockets/can/boards/native_posix.overlay | 9 --------- samples/net/sockets/can/boards/native_posix_64.overlay | 9 --------- tests/drivers/can/api/boards/native_posix.overlay | 9 --------- tests/drivers/can/api/boards/native_posix_64.overlay | 9 --------- tests/drivers/can/canfd/boards/native_posix.overlay | 9 --------- tests/drivers/can/canfd/boards/native_posix_64.overlay | 9 --------- tests/drivers/can/timing/boards/native_posix.overlay | 9 --------- tests/drivers/can/timing/boards/native_posix_64.overlay | 9 --------- tests/subsys/canbus/isotp/conformance/testcase.yaml | 1 + tests/subsys/canbus/isotp/implementation/testcase.yaml | 1 + 12 files changed, 4 insertions(+), 73 deletions(-) delete mode 100644 samples/net/sockets/can/boards/native_posix.overlay delete mode 100644 samples/net/sockets/can/boards/native_posix_64.overlay delete mode 100644 tests/drivers/can/api/boards/native_posix.overlay delete mode 100644 tests/drivers/can/api/boards/native_posix_64.overlay delete mode 100644 tests/drivers/can/canfd/boards/native_posix.overlay delete mode 100644 tests/drivers/can/canfd/boards/native_posix_64.overlay delete mode 100644 tests/drivers/can/timing/boards/native_posix.overlay delete mode 100644 tests/drivers/can/timing/boards/native_posix_64.overlay diff --git a/boards/posix/native_posix/native_posix.dts b/boards/posix/native_posix/native_posix.dts index 3bd5555088985..3a3605ac23a96 100644 --- a/boards/posix/native_posix/native_posix.dts +++ b/boards/posix/native_posix/native_posix.dts @@ -188,7 +188,7 @@ }; can_loopback0: can_loopback0 { - status = "disabled"; + status = "okay"; compatible = "zephyr,can-loopback"; sjw = <1>; sample-point = <875>; diff --git a/samples/drivers/can/counter/sample.yaml b/samples/drivers/can/counter/sample.yaml index fa7177a9f46da..b6ff5158db1a8 100644 --- a/samples/drivers/can/counter/sample.yaml +++ b/samples/drivers/can/counter/sample.yaml @@ -5,6 +5,7 @@ tests: tags: can depends_on: can filter: dt_chosen_enabled("zephyr,canbus") + platform_exclude: native_posix native_posix_64 harness: console harness_config: type: one_line diff --git a/samples/net/sockets/can/boards/native_posix.overlay b/samples/net/sockets/can/boards/native_posix.overlay deleted file mode 100644 index 93b1c32d28697..0000000000000 --- a/samples/net/sockets/can/boards/native_posix.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2022 Vestas Wind Systems A/S - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&can_loopback0 { - status = "okay"; -}; diff --git a/samples/net/sockets/can/boards/native_posix_64.overlay b/samples/net/sockets/can/boards/native_posix_64.overlay deleted file mode 100644 index 93b1c32d28697..0000000000000 --- a/samples/net/sockets/can/boards/native_posix_64.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2022 Vestas Wind Systems A/S - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&can_loopback0 { - status = "okay"; -}; diff --git a/tests/drivers/can/api/boards/native_posix.overlay b/tests/drivers/can/api/boards/native_posix.overlay deleted file mode 100644 index c185f31f6053f..0000000000000 --- a/tests/drivers/can/api/boards/native_posix.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2021 Vestas Wind Systems A/S - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&can_loopback0 { - status = "okay"; -}; diff --git a/tests/drivers/can/api/boards/native_posix_64.overlay b/tests/drivers/can/api/boards/native_posix_64.overlay deleted file mode 100644 index c185f31f6053f..0000000000000 --- a/tests/drivers/can/api/boards/native_posix_64.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2021 Vestas Wind Systems A/S - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&can_loopback0 { - status = "okay"; -}; diff --git a/tests/drivers/can/canfd/boards/native_posix.overlay b/tests/drivers/can/canfd/boards/native_posix.overlay deleted file mode 100644 index 93b1c32d28697..0000000000000 --- a/tests/drivers/can/canfd/boards/native_posix.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2022 Vestas Wind Systems A/S - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&can_loopback0 { - status = "okay"; -}; diff --git a/tests/drivers/can/canfd/boards/native_posix_64.overlay b/tests/drivers/can/canfd/boards/native_posix_64.overlay deleted file mode 100644 index 93b1c32d28697..0000000000000 --- a/tests/drivers/can/canfd/boards/native_posix_64.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2022 Vestas Wind Systems A/S - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&can_loopback0 { - status = "okay"; -}; diff --git a/tests/drivers/can/timing/boards/native_posix.overlay b/tests/drivers/can/timing/boards/native_posix.overlay deleted file mode 100644 index c185f31f6053f..0000000000000 --- a/tests/drivers/can/timing/boards/native_posix.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2021 Vestas Wind Systems A/S - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&can_loopback0 { - status = "okay"; -}; diff --git a/tests/drivers/can/timing/boards/native_posix_64.overlay b/tests/drivers/can/timing/boards/native_posix_64.overlay deleted file mode 100644 index c185f31f6053f..0000000000000 --- a/tests/drivers/can/timing/boards/native_posix_64.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2021 Vestas Wind Systems A/S - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&can_loopback0 { - status = "okay"; -}; diff --git a/tests/subsys/canbus/isotp/conformance/testcase.yaml b/tests/subsys/canbus/isotp/conformance/testcase.yaml index 222b854df31b8..3366607882c56 100644 --- a/tests/subsys/canbus/isotp/conformance/testcase.yaml +++ b/tests/subsys/canbus/isotp/conformance/testcase.yaml @@ -3,3 +3,4 @@ tests: tags: can isotp depends_on: can filter: dt_chosen_enabled("zephyr,canbus") + platform_exclude: native_posix native_posix_64 diff --git a/tests/subsys/canbus/isotp/implementation/testcase.yaml b/tests/subsys/canbus/isotp/implementation/testcase.yaml index 1262b76652291..85daa69cacd0f 100644 --- a/tests/subsys/canbus/isotp/implementation/testcase.yaml +++ b/tests/subsys/canbus/isotp/implementation/testcase.yaml @@ -3,3 +3,4 @@ tests: tags: can isotp depends_on: can filter: dt_chosen_enabled("zephyr,canbus") + platform_exclude: native_posix native_posix_64