Skip to content

Commit eebed14

Browse files
soburinashif
authored andcommitted
tests: drivers: build_all: Add a build_all test for flash
The test targets the following devices at this time. - atmel,at45 - jedec,spi-nor Signed-off-by: TOKITA Hiroshi <[email protected]>
1 parent 60dc055 commit eebed14

File tree

6 files changed

+96
-0
lines changed

6 files changed

+96
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2024 TOKITA Hiroshi
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
cmake_minimum_required(VERSION 3.20.0)
5+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
6+
project(build_all)
7+
8+
target_sources(app PRIVATE src/main.c)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2024 TOKITA Hiroshi
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/ {
7+
test {
8+
#address-cells = <1>;
9+
#size-cells = <1>;
10+
11+
test_gpio: gpio@deadbeef {
12+
compatible = "vnd,gpio";
13+
gpio-controller;
14+
reg = <0xdeadbeef 0x1000>;
15+
#gpio-cells = <0x2>;
16+
status = "okay";
17+
};
18+
19+
test_spi: spi@33334444 {
20+
#address-cells = <1>;
21+
#size-cells = <0>;
22+
compatible = "vnd,spi";
23+
reg = <0x33334444 0x1000>;
24+
status = "okay";
25+
clock-frequency = <2000000>;
26+
27+
/* one entry for every devices at spi.dtsi */
28+
cs-gpios = <&test_gpio 0 0>,
29+
<&test_gpio 0 0>,
30+
<&test_gpio 0 0>,
31+
<&test_gpio 0 0>,
32+
<&test_gpio 0 0>;
33+
34+
#include "spi.dtsi"
35+
};
36+
};
37+
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_FLASH=y
2+
CONFIG_GPIO=y
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2024 TOKITA Hiroshi
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
at45@0 {
7+
compatible = "atmel,at45";
8+
reg = <0x0>;
9+
status = "okay";
10+
spi-max-frequency = <5000000>;
11+
jedec-id = [00 11 22];
12+
size = <1048576>;
13+
sector-size = <1>;
14+
sector-0a-pages = <1>;
15+
block-size = <1>;
16+
page-size = <1>;
17+
};
18+
19+
spi-nor@1 {
20+
compatible = "jedec,spi-nor";
21+
reg = <0x1>;
22+
status = "okay";
23+
spi-max-frequency = <5000000>;
24+
size = <1048576>;
25+
jedec-id = [00 11 22];
26+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/*
2+
* Copyright (c) 2024 TOKITA Hiroshi
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/* It is okay if main() is not included since just checking the build. */
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2024 TOKITA hiroshi
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
common:
5+
build_only: true
6+
tags:
7+
- drivers
8+
- flash
9+
tests:
10+
drivers.flash.build:
11+
platform_allow:
12+
- native_sim
13+
drivers.flash.emul.build:
14+
platform_allow:
15+
- native_sim
16+
extra_configs:
17+
- CONFIG_EMUL=y

0 commit comments

Comments
 (0)