-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
6 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CONFIG_FLASH=y | ||
CONFIG_GPIO=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |