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 <tokita.hiroshi@gmail.com>
This commit is contained in:
parent
60dc055f9e
commit
eebed141cf
6 changed files with 96 additions and 0 deletions
8
tests/drivers/build_all/flash/CMakeLists.txt
Normal file
8
tests/drivers/build_all/flash/CMakeLists.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Copyright (c) 2024 TOKITA Hiroshi
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(build_all)
|
||||
|
||||
target_sources(app PRIVATE src/main.c)
|
37
tests/drivers/build_all/flash/app.overlay
Normal file
37
tests/drivers/build_all/flash/app.overlay
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) 2024 TOKITA Hiroshi
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/ {
|
||||
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";
|
||||
clock-frequency = <2000000>;
|
||||
|
||||
/* one entry for every devices at spi.dtsi */
|
||||
cs-gpios = <&test_gpio 0 0>,
|
||||
<&test_gpio 0 0>,
|
||||
<&test_gpio 0 0>,
|
||||
<&test_gpio 0 0>,
|
||||
<&test_gpio 0 0>;
|
||||
|
||||
#include "spi.dtsi"
|
||||
};
|
||||
};
|
||||
};
|
2
tests/drivers/build_all/flash/prj.conf
Normal file
2
tests/drivers/build_all/flash/prj.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
CONFIG_FLASH=y
|
||||
CONFIG_GPIO=y
|
26
tests/drivers/build_all/flash/spi.dtsi
Normal file
26
tests/drivers/build_all/flash/spi.dtsi
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2024 TOKITA Hiroshi
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
at45@0 {
|
||||
compatible = "atmel,at45";
|
||||
reg = <0x0>;
|
||||
status = "okay";
|
||||
spi-max-frequency = <5000000>;
|
||||
jedec-id = [00 11 22];
|
||||
size = <1048576>;
|
||||
sector-size = <1>;
|
||||
sector-0a-pages = <1>;
|
||||
block-size = <1>;
|
||||
page-size = <1>;
|
||||
};
|
||||
|
||||
spi-nor@1 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0x1>;
|
||||
status = "okay";
|
||||
spi-max-frequency = <5000000>;
|
||||
size = <1048576>;
|
||||
jedec-id = [00 11 22];
|
||||
};
|
6
tests/drivers/build_all/flash/src/main.c
Normal file
6
tests/drivers/build_all/flash/src/main.c
Normal file
|
@ -0,0 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2024 TOKITA Hiroshi
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* It is okay if main() is not included since just checking the build. */
|
17
tests/drivers/build_all/flash/testcase.yaml
Normal file
17
tests/drivers/build_all/flash/testcase.yaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Copyright (c) 2024 TOKITA hiroshi
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
common:
|
||||
build_only: true
|
||||
tags:
|
||||
- drivers
|
||||
- flash
|
||||
tests:
|
||||
drivers.flash.build:
|
||||
platform_allow:
|
||||
- native_sim
|
||||
drivers.flash.emul.build:
|
||||
platform_allow:
|
||||
- native_sim
|
||||
extra_configs:
|
||||
- CONFIG_EMUL=y
|
Loading…
Add table
Add a link
Reference in a new issue