summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSamuel Holland <[email protected]>2024-11-04 20:10:08 -0800
committerAnup Patel <[email protected]>2024-11-28 11:40:17 +0530
commit2dd6eaf680556e763a85b0b4ae180391e2671854 (patch)
tree7d9dab33cb4f428f507b8043e3e30e46cbec59bd /include
parente3e5686ef903d037c6b5835a6752481a07faf99f (diff)
lib: sbi_irqchip: Call driver warm_init from SBI core
Currently, each platform keeps track of which irqchip driver is in use and calls its warm init function. Since the generic platform may use multiple irqchip drivers, it has logic to track an array of drivers. 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_irqchip.h3
-rw-r--r--include/sbi_utils/irqchip/imsic.h2
-rw-r--r--include/sbi_utils/irqchip/plic.h2
3 files changed, 3 insertions, 4 deletions
diff --git a/include/sbi/sbi_irqchip.h b/include/sbi/sbi_irqchip.h
index c88b760a..9d26067f 100644
--- a/include/sbi/sbi_irqchip.h
+++ b/include/sbi/sbi_irqchip.h
@@ -19,6 +19,9 @@ struct sbi_scratch;
struct sbi_irqchip_device {
/** Node in the list of irqchip devices */
struct sbi_dlist node;
+
+ /** Initialize per-hart state for the current hart */
+ int (*warm_init)(struct sbi_irqchip_device *dev);
};
/**
diff --git a/include/sbi_utils/irqchip/imsic.h b/include/sbi_utils/irqchip/imsic.h
index bc9292d3..353cefec 100644
--- a/include/sbi_utils/irqchip/imsic.h
+++ b/include/sbi_utils/irqchip/imsic.h
@@ -43,8 +43,6 @@ int imsic_get_target_file(u32 hartindex);
void imsic_local_irqchip_init(void);
-int imsic_warm_irqchip_init(void);
-
int imsic_data_check(struct imsic_data *imsic);
int imsic_cold_irqchip_init(struct imsic_data *imsic);
diff --git a/include/sbi_utils/irqchip/plic.h b/include/sbi_utils/irqchip/plic.h
index 5c638e14..a173871e 100644
--- a/include/sbi_utils/irqchip/plic.h
+++ b/include/sbi_utils/irqchip/plic.h
@@ -42,8 +42,6 @@ void plic_suspend(void);
void plic_resume(void);
-int plic_warm_irqchip_init(void);
-
int plic_cold_irqchip_init(struct plic_data *plic);
#endif