Skip to content

Commit 841093e

Browse files
committed
boards: sifli: add sf32lb52_devkit_lcd revisions
- declare n16r8 (default) and a128r8 revisions in board.yml - add revision.cmake to validate BOARD_REVISION and keep n16r8 as fallback Signed-off-by: Haoran Jiang <[email protected]>
1 parent 8b2c75a commit 841093e

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

MAINTAINERS.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4685,6 +4685,7 @@ SiFli SF32LB Platforms:
46854685
collaborators:
46864686
- cameled
46874687
- ck-telecom
4688+
- halfsweet
46884689
files:
46894690
- boards/sifli/
46904691
- drivers/*/*sf32lb*

boards/sifli/sf32lb52_devkit_lcd/board.cmake

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
# keep first
5-
board_runner_args(sftool "--chip=SF32LB52")
5+
set(_sf32lb52_sftool_args "--chip=SF32LB52")
6+
7+
if(DEFINED BOARD_REVISION)
8+
if(BOARD_REVISION STREQUAL "n16r8")
9+
list(APPEND _sf32lb52_sftool_args "--tool-opt=--memory nor")
10+
elseif(BOARD_REVISION STREQUAL "a128r8")
11+
list(APPEND _sf32lb52_sftool_args "--tool-opt=--memory nand")
12+
endif()
13+
endif()
14+
15+
board_runner_args(sftool ${_sf32lb52_sftool_args})
616

717
# keep first
818
include(${ZEPHYR_BASE}/boards/common/sftool.board.cmake)

boards/sifli/sf32lb52_devkit_lcd/board.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@ board:
55
name: sf32lb52_devkit_lcd
66
full_name: SF32LB52-DevKit-LCD
77
vendor: sifli
8+
revision:
9+
format: custom
10+
default: "n16r8"
11+
revisions:
12+
- name: "n16r8"
13+
- name: "a128r8"
814
socs:
915
- name: sf32lb525uc6
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
set(BOARD_REVISIONS "n16r8" "a128r8")
2+
3+
if(NOT DEFINED BOARD_REVISION)
4+
set(BOARD_REVISION "n16r8")
5+
else()
6+
if(NOT BOARD_REVISION IN_LIST BOARD_REVISIONS)
7+
message(FATAL_ERROR "${BOARD_REVISION} is not a valid revision for sf32lb52_devkit_lcd. Accepted revisions: ${BOARD_REVISIONS}")
8+
endif()
9+
endif()

0 commit comments

Comments
 (0)