diff options
author | Nam Cao <namcao@linutronix.de> | 2024-02-22 09:16:19 +0100 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2024-02-22 18:19:01 +0530 |
commit | 741e941cb13c79c6355a98957d7fe6291f262cb5 (patch) | |
tree | dda9fb477531902f09bd475d1cb1f763eb1b0d2c /platform | |
parent | 3edf0447df9cb5e63f5f584ab97357f3c5aa0fbf (diff) | |
download | opensbi-741e941cb13c79c6355a98957d7fe6291f262cb5.zip opensbi-741e941cb13c79c6355a98957d7fe6291f262cb5.tar.gz opensbi-741e941cb13c79c6355a98957d7fe6291f262cb5.tar.bz2 |
platform: starfive: call starfive_jh7110_inst_init() in pm_reset_init()
The function starfive_jh7110_inst_init() initialize some power
management unit address and clock addresses, needed for the reset
driver. It doesn't do anything else, and also the reset driver doesn't
work without calling this function. Thus, it does not make much sense
that this function is independent from pm_reset_init().
Delete the separate call to starfive_jh7110_inst_init(), and instead
just call this function inside pm_reset_init().
Doing this also fixes another problem: if starfive_jh7110_inst_init()
returns an error code, it gets propagated to final_init() and OpenSBI
hangs. This hang is not necessary, because failures within
starfive_jh7110_inst_init() only mean OpenSBI cannot perform reboot or
shutdown, but the system can still function normally.
Signed-off-by: Nam Cao <namcao@linutronix.de>
Tested-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'platform')
-rw-r--r-- | platform/generic/starfive/jh7110.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/generic/starfive/jh7110.c b/platform/generic/starfive/jh7110.c index 1ac0854..62dcd25 100644 --- a/platform/generic/starfive/jh7110.c +++ b/platform/generic/starfive/jh7110.c @@ -186,6 +186,8 @@ static struct sbi_system_reset_device pm_reset = { .system_reset = pm_system_reset }; +static int starfive_jh7110_inst_init(void *fdt); + static int pm_reset_init(void *fdt, int nodeoff, const struct fdt_match *match) { @@ -211,6 +213,10 @@ static int pm_reset_init(void *fdt, int nodeoff, pmic_inst.adapter = adapter; + rc = starfive_jh7110_inst_init(fdt); + if (rc) + return rc; + sbi_system_reset_add_device(&pm_reset); return 0; @@ -278,7 +284,6 @@ static int starfive_jh7110_final_init(bool cold_boot, if (cold_boot) { fdt_reset_driver_init(fdt, &fdt_reset_pmic); - return starfive_jh7110_inst_init(fdt); } return 0; |