Skip to content

Commit

Permalink
platform: generic: Allow platform_override to perform firmware init
Browse files Browse the repository at this point in the history
We add a generic platform override callback to allow platform specific firmware init.

Signed-off-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
Reviewed-by: Chee Hong Ang <cheehong.ang@starfivetech.com>
Reviewed-by: Jun Liang Tan <junliang.tan@starfivetech.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
  • Loading branch information
Wei Liang Lim authored and avpatel committed Jan 7, 2023
1 parent 6957ae0 commit cb7e7c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions platform/generic/include/platform_override.h
Expand Up @@ -26,6 +26,7 @@ struct platform_override {
int (*fdt_fixup)(void *fdt, const struct fdt_match *match);
int (*extensions_init)(const struct fdt_match *match,
struct sbi_hart_features *hfeatures);
void (*fw_init)(void *fdt, const struct fdt_match *match);
int (*vendor_ext_check)(long extid, const struct fdt_match *match);
int (*vendor_ext_provider)(long extid, long funcid,
const struct sbi_trap_regs *regs,
Expand Down
3 changes: 3 additions & 0 deletions platform/generic/platform.c
Expand Up @@ -85,6 +85,9 @@ unsigned long fw_platform_init(unsigned long arg0, unsigned long arg1,

fw_platform_lookup_special(fdt, root_offset);

if (generic_plat && generic_plat->fw_init)
generic_plat->fw_init(fdt, generic_plat_match);

model = fdt_getprop(fdt, root_offset, "model", &len);
if (model)
sbi_strncpy(platform.name, model, sizeof(platform.name) - 1);
Expand Down

0 comments on commit cb7e7c3

Please sign in to comment.