Skip to content

Commit

Permalink
tests: drivers: build_all: can: Add spi-devices build test
Browse files Browse the repository at this point in the history
Add build tests for following devices.

- microchip,mcp2515
- microchip,mcp251xfd
- ti,tcan4x5x

Signed-off-by: TOKITA Hiroshi <[email protected]>
  • Loading branch information
soburi committed Sep 17, 2024
1 parent 0bca195 commit b5f1740
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
63 changes: 63 additions & 0 deletions tests/drivers/build_all/can/spi_devices.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/ {
test {
#address-cells = <1>;
#size-cells = <1>;

test_gpio: gpio@deadbeef {
compatible = "vnd,gpio";
gpio-controller;
reg = <0xdeadbeef 0x1000>;
#gpio-cells = <0x2>;
status = "okay";
};

test_spi: spi@33334444 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "vnd,spi";
reg = <0x33334444 0x1000>;
status = "okay";

cs-gpios = <&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>;

test_spi_mcp2515: mcp2515@0 {
compatible = "microchip,mcp2515";
reg = <0x0>;
status = "okay";

spi-max-frequency = <1000000>;
int-gpios = <&test_gpio 0 0>;

osc-freq = <16000000>;
};

test_spi_mcp2515fd: mcp2515fd@1 {
compatible = "microchip,mcp251xfd";
reg = <0x1>;
status = "okay";

spi-max-frequency = <18000000>;
int-gpios = <&test_gpio 0 0>;

osc-freq = <40000000>;
};

test_spi_tcan4x5x: tcan4x5x@2 {
compatible = "ti,tcan4x5x";
reg = <0x2>;
status = "okay";

spi-max-frequency = <2000000>;

clock-frequency = <40000000>;
device-state-gpios = <&test_gpio 0 0>;
device-wake-gpios = <&test_gpio 0 0>;
reset-gpios = <&test_gpio 0 0>;
int-gpios = <&test_gpio 0 0>;
bosch,mram-cfg = <0x0 15 15 7 7 0 10 10>;
};
};
};
};
9 changes: 9 additions & 0 deletions tests/drivers/build_all/can/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,12 @@ tests:
- native_posix/native/64
- native_sim
- native_sim/native/64
drivers.can.build_all.spi:
extra_args: DTC_OVERLAY_FILE="spi_devices.overlay"
extra_configs:
- CONFIG_SPI=y
platform_allow:
- native_posix
- native_posix/native/64
- native_sim
- native_sim/native/64

0 comments on commit b5f1740

Please sign in to comment.