From f5e871d5e0d8d092d9bb97f23bb62a53a418428d Mon Sep 17 00:00:00 2001 From: HaiLong Yang Date: Thu, 30 Nov 2023 17:25:43 +0800 Subject: [PATCH] test: flash: add gd32 boards This add gd32vf103v_eval, gd32a503v_eval and gd32f470i_eval boards to flash common test. Boards | Flash Type ------------------------------- gd32vf103v_eval | gd32 fmc v1 gd32a503v_eval | gd32 fmc v2 gd32f470i_eval | gd32 fmc v3 Signed-off-by: HaiLong Yang --- boards/arm/gd32a503v_eval/gd32a503v_eval.yaml | 1 + boards/arm/gd32f470i_eval/gd32f470i_eval.yaml | 1 + .../gd32vf103v_eval/gd32vf103v_eval.yaml | 7 +++--- .../common/boards/gd32a503v_eval.overlay | 24 +++++++++++++++++++ .../common/boards/gd32f470i_eval.overlay | 24 +++++++++++++++++++ .../common/boards/gd32vf103v_eval.overlay | 24 +++++++++++++++++++ tests/drivers/flash/common/testcase.yaml | 5 ++++ 7 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 tests/drivers/flash/common/boards/gd32a503v_eval.overlay create mode 100644 tests/drivers/flash/common/boards/gd32f470i_eval.overlay create mode 100644 tests/drivers/flash/common/boards/gd32vf103v_eval.overlay diff --git a/boards/arm/gd32a503v_eval/gd32a503v_eval.yaml b/boards/arm/gd32a503v_eval/gd32a503v_eval.yaml index 396e68d24b6..e2e2145d9af 100644 --- a/boards/arm/gd32a503v_eval/gd32a503v_eval.yaml +++ b/boards/arm/gd32a503v_eval/gd32a503v_eval.yaml @@ -16,6 +16,7 @@ supported: - counter - dac - dma + - flash - gpio - pwm - spi diff --git a/boards/arm/gd32f470i_eval/gd32f470i_eval.yaml b/boards/arm/gd32f470i_eval/gd32f470i_eval.yaml index 868e4907f3f..9537f9aef30 100644 --- a/boards/arm/gd32f470i_eval/gd32f470i_eval.yaml +++ b/boards/arm/gd32f470i_eval/gd32f470i_eval.yaml @@ -14,6 +14,7 @@ toolchain: supported: - counter - dac + - flash - gpio - i2c - pwm diff --git a/boards/riscv/gd32vf103v_eval/gd32vf103v_eval.yaml b/boards/riscv/gd32vf103v_eval/gd32vf103v_eval.yaml index 306d3e11498..857fe8adf6d 100644 --- a/boards/riscv/gd32vf103v_eval/gd32vf103v_eval.yaml +++ b/boards/riscv/gd32vf103v_eval/gd32vf103v_eval.yaml @@ -10,10 +10,11 @@ flash: 128 toolchain: - zephyr supported: - - uart + - dma + - flash - gpio - pwm - - watchdog - - dma - spi + - uart + - watchdog vendor: gd diff --git a/tests/drivers/flash/common/boards/gd32a503v_eval.overlay b/tests/drivers/flash/common/boards/gd32a503v_eval.overlay new file mode 100644 index 00000000000..de16cdec869 --- /dev/null +++ b/tests/drivers/flash/common/boards/gd32a503v_eval.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2023, BrainCo Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Set 4KB of storage at the border of bank0(256KB) and bank1(128KB). */ + storage_partition: partition@3f800 { + label = "storage"; + reg = <0x0003f800 DT_SIZE_K(4)>; + }; + }; +}; + +/* To avoid test on nor_flash, disable it. */ +&nor_flash { + status = "disabled"; +}; diff --git a/tests/drivers/flash/common/boards/gd32f470i_eval.overlay b/tests/drivers/flash/common/boards/gd32f470i_eval.overlay new file mode 100644 index 00000000000..7d4fb75475e --- /dev/null +++ b/tests/drivers/flash/common/boards/gd32f470i_eval.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2023, BrainCo Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Set 512KB of storage at the end of 3072KB flash */ + storage_partition: partition@280000 { + label = "storage"; + reg = <0x00280000 DT_SIZE_K(512)>; + }; + }; +}; + +/* To avoid test on nor_flash, disable it. */ +&nor_flash { + status = "disabled"; +}; diff --git a/tests/drivers/flash/common/boards/gd32vf103v_eval.overlay b/tests/drivers/flash/common/boards/gd32vf103v_eval.overlay new file mode 100644 index 00000000000..7c2952d1155 --- /dev/null +++ b/tests/drivers/flash/common/boards/gd32vf103v_eval.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2023, BrainCo Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Set 2KB of storage at the end of 128KB flash */ + storage_partition: partition@1f800 { + label = "storage"; + reg = <0x0001f800 DT_SIZE_K(2)>; + }; + }; +}; + +/* To avoid test on nor_flash, disable it. */ +&nor_flash { + status = "disabled"; +}; diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index b0b0c9af91a..a3624f76be2 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -92,3 +92,8 @@ tests: - atsamd20_xpro - atsamr21_xpro - atsame54_xpro + drivers.flash.common.gd32: + platform_allow: + - gd32vf103v_eval + - gd32a503v_eval + - gd32f470i_eval