summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSamuel Holland <[email protected]>2024-09-02 21:06:49 -0700
committerAnup Patel <[email protected]>2024-11-05 17:29:13 +0530
commit450082874346bb25109877b7ac6a1754f089f538 (patch)
treea3e4c1726e26303e7d61206ffad8934dfbb04f3f /include
parent1a2e507d2347500e6c994e005fb9725b2a9a8e8f (diff)
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 <[email protected]> Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_timer.h3
-rw-r--r--include/sbi_utils/timer/aclint_mtimer.h2
-rw-r--r--include/sbi_utils/timer/andes_plmt.h1
3 files changed, 3 insertions, 3 deletions
diff --git a/include/sbi/sbi_timer.h b/include/sbi/sbi_timer.h
index ac2c7be5..2e1a7879 100644
--- a/include/sbi/sbi_timer.h
+++ b/include/sbi/sbi_timer.h
@@ -28,6 +28,9 @@ struct sbi_timer_device {
/** Stop timer event for current HART */
void (*timer_event_stop)(void);
+
+ /** Initialize timer device for current HART */
+ int (*warm_init)(void);
};
struct sbi_scratch;
diff --git a/include/sbi_utils/timer/aclint_mtimer.h b/include/sbi_utils/timer/aclint_mtimer.h
index 6ab8799c..a245e13e 100644
--- a/include/sbi_utils/timer/aclint_mtimer.h
+++ b/include/sbi_utils/timer/aclint_mtimer.h
@@ -47,8 +47,6 @@ void aclint_mtimer_sync(struct aclint_mtimer_data *mt);
void aclint_mtimer_set_reference(struct aclint_mtimer_data *mt,
struct aclint_mtimer_data *ref);
-int aclint_mtimer_warm_init(void);
-
int aclint_mtimer_cold_init(struct aclint_mtimer_data *mt,
struct aclint_mtimer_data *reference);
diff --git a/include/sbi_utils/timer/andes_plmt.h b/include/sbi_utils/timer/andes_plmt.h
index 08bce332..119f1b44 100644
--- a/include/sbi_utils/timer/andes_plmt.h
+++ b/include/sbi_utils/timer/andes_plmt.h
@@ -24,6 +24,5 @@ struct plmt_data {
};
int plmt_cold_timer_init(struct plmt_data *plmt);
-int plmt_warm_timer_init(void);
#endif /* __TIMER_ANDES_PLMT_H__ */