mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 15:31:22 +01:00
lib: sbi_timer: Call driver warm_init from SBI core
Currently, the platform's timer device is tracked in two places: the core SBI implementation has `timer_dev`, and the FDT timer layer has `current_driver`. The latter is used for warm initialization of the timer device. However, this warm init is not specific to FDT-based platforms; other platforms call exactly the same functions from the same point in the boot sequence. The code is simplified and made common across platforms by treating warm init and exit as properties of the driver, not the platform. Then the platform's only role is to select and prepare a driver during cold boot. For now, only add a .warm_init hook, since none of the existing drivers need an .exit hook. It could be added in the future if needed. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:

committed by
Anup Patel

parent
1a2e507d23
commit
4500828743
@@ -159,7 +159,7 @@ static int ariane_timer_init(bool cold_boot)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return aclint_mtimer_warm_init();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -190,7 +190,7 @@ static int openpiton_timer_init(bool cold_boot)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return aclint_mtimer_warm_init();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -169,7 +169,7 @@ static int k210_timer_init(bool cold_boot)
|
||||
return rc;
|
||||
}
|
||||
|
||||
return aclint_mtimer_warm_init();
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct sbi_platform_operations platform_ops = {
|
||||
|
@@ -225,7 +225,7 @@ static int ux600_timer_init(bool cold_boot)
|
||||
return rc;
|
||||
}
|
||||
|
||||
return aclint_mtimer_warm_init();
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct sbi_platform_operations platform_ops = {
|
||||
|
@@ -129,7 +129,7 @@ static int platform_timer_init(bool cold_boot)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return aclint_mtimer_warm_init();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user