From 285f810ce31b6de9a582b2ef2c5f69e81a616dbe Mon Sep 17 00:00:00 2001 From: Huaqi Fang <578567190@qq.com> Date: Tue, 25 Jun 2024 18:06:19 +0800 Subject: [PATCH] src/flash/nor: redirect fespi to nuspi for hbird and hbirdv2 SoC Change-Id: I3d7d58971e7739b5e1104c9595952005c840a5dc Signed-off-by: Huaqi Fang <578567190@qq.com> --- src/flash/nor/drivers.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/flash/nor/drivers.c b/src/flash/nor/drivers.c index dd9995ecb..981f5b599 100644 --- a/src/flash/nor/drivers.c +++ b/src/flash/nor/drivers.c @@ -8,6 +8,7 @@ #include "config.h" #endif #include "imp.h" +#include /** * The list of built-in flash drivers. @@ -91,8 +92,14 @@ static const struct flash_driver * const flash_drivers[] = { const struct flash_driver *flash_driver_find_by_name(const char *name) { + char *flash_name = name; + if (strcmp(flash_name, "fespi") == 0) { + /* Nuclei added: redirect fespi for old hbird/hbirdv2 SPI driver to nuspi driver */ + flash_name = "nuspi"; + } + for (unsigned int i = 0; flash_drivers[i]; i++) { - if (strcmp(name, flash_drivers[i]->name) == 0) + if (strcmp(flash_name, flash_drivers[i]->name) == 0) return flash_drivers[i]; } return NULL;