OpenSBI IPI device rating
cover OpenSBI IPI device rating
Introduce IPI device rating which further allows us to remove platform specific IPI init and convert IPI drivers as early drivers.
These patches can also found in sbi_ipi_rating_v1 branch at:
https://github.com/avpatel/opensbi.git
Anup Patel (3):
lib: sbi: Introduce IPI device rating
include: sbi: Remove platform specific IPI init
lib: utils/ipi: Convert IPI drivers as early drivers
include/sbi/sbi_ipi.h | 6 ++++- include/sbi/sbi_platform.h | 17 ------------ include/sbi_utils/ipi/fdt_ipi.h | 26 ------------------- lib/sbi/sbi_init.c | 2 +- lib/sbi/sbi_ipi.c | 33 ++++++++++++++---------- lib/utils/ipi/aclint_mswi.c | 1 + lib/utils/ipi/andes_plicsw.c | 1 + lib/utils/ipi/fdt_ipi.c | 22 ---------------- lib/utils/ipi/fdt_ipi_drivers.carray | 3 --- lib/utils/ipi/fdt_ipi_mswi.c | 2 +- lib/utils/ipi/fdt_ipi_plicsw.c | 2 +- lib/utils/ipi/objects.mk | 7 ++--- lib/utils/irqchip/imsic.c | 1 + platform/fpga/ariane/platform.c | 15 +++++------ platform/generic/openhwgroup/openpiton.c | 13 +++------- platform/generic/platform.c | 2 -- platform/kendryte/k210/platform.c | 13 +++++----- platform/nuclei/ux600/platform.c | 11 ++++---- platform/template/platform.c | 16 +++++------- 19 files changed, 60 insertions(+), 133 deletions(-) delete mode 100644 include/sbi_utils/ipi/fdt_ipi.h delete mode 100644 lib/utils/ipi/fdt_ipi.c delete mode 100644 lib/utils/ipi/fdt_ipi_drivers.carray
Signature · 7 lines
2.43.0 -- opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi
PATCH 1/3 lib: sbi: Introduce IPI device rating
A platform can have multiple IPI devices (such as ACLINT MSWI, AIA IMSIC, etc). Currently, OpenSBI rely on platform calling the sbi_ipi_set_device() function in correct order and prefer the first avaiable IPI device which is fragile.
Instead of the above, introdcue IPI device rating and prefer the highest rated IPI device. This further allows extending the sbi_ipi_raw_clear() to clear all available IPI devices.
--- include/sbi/sbi_ipi.h | 6 +++++- lib/sbi/sbi_init.c | 2 +- lib/sbi/sbi_ipi.c | 28 ++++++++++++++++++++-------- lib/utils/ipi/aclint_mswi.c | 1 + lib/utils/ipi/andes_plicsw.c | 1 + lib/utils/irqchip/imsic.c | 1 + 6 files changed, 29 insertions(+), 10 deletions(-)
include/sbi/sbi_ipi.h +5 -1
@@ -14,6 +14,7 @@/* clang-format off */ +#define SBI_IPI_DEVICE_MAX (4)#define SBI_IPI_EVENT_MAX (8 * __SIZEOF_LONG__)/* clang-format on */
@@ -23,6 +24,9 @@ struct sbi_ipi_device {/** Name of the IPI device */ char name[32 ]; +/** Ratings of the IPI device (higher is better) */ +unsigned long rating; +/** Send IPI to a target HART index */ void (*ipi_send)(u32 hart_index);
@@ -87,7 +91,7 @@ void sbi_ipi_process(void);int sbi_ipi_raw_send (u32 hartindex); -void sbi_ipi_raw_clear (void ); +void sbi_ipi_raw_clear (bool all_devices);const struct sbi_ipi_device *sbi_ipi_get_device (void );
lib/sbi/sbi_init.c +1 -1
@@ -507,7 +507,7 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)if (hstate ==SBI_HSM_STATE_SUSPENDED ) {init_warm_resume (scratch, hartid); }else { -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);init_warm_startup (scratch, hartid); } }
lib/sbi/sbi_ipi.c +20 -8
@@ -32,8 +32,9 @@ _Static_assert("type of sbi_ipi_data.ipi_type has changed, please redefine SBI_IPI_EVENT_MAX" ); -static unsigned long ipi_data_off; +static unsigned long ipi_data_off, ipi_dev_count;static const struct sbi_ipi_device *ipi_dev =NULL ; +static const struct sbi_ipi_device *ipi_dev_array[SBI_IPI_DEVICE_MAX ];static const struct sbi_ipi_event_ops *ipi_ops_array[SBI_IPI_EVENT_MAX ]; static int sbi_ipi_send(struct sbi_scratch *scratch, u32 remote_hartindex,
@@ -248,7 +249,7 @@ void sbi_ipi_process(void)sbi_scratch_offset_ptr (scratch, ipi_data_off);sbi_pmu_ctr_incr_fw (SBI_PMU_FW_IPI_RECVD ); -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (false); ipi_type =atomic_raw_xchg_ulong (&ipi_data->ipi_type,0 ); ipi_event =0 ;
@@ -283,10 +284,19 @@ int sbi_ipi_raw_send(u32 hartindex)return 0 ; } -void sbi_ipi_raw_clear (void ) +void sbi_ipi_raw_clear (bool all_devices) { -if (ipi_dev && ipi_dev->ipi_clear) - ipi_dev->ipi_clear (); +int i; + +if (all_devices) { +for (i =0 ; i < ipi_dev_count; i++) { +if (ipi_dev_array[i]->ipi_clear) + ipi_dev_array[i]->ipi_clear (); + } + }else { +if (ipi_dev && ipi_dev->ipi_clear) + ipi_dev->ipi_clear (); + }/* * Ensure that memory or MMIO writes after this
@@ -307,10 +317,12 @@ const struct sbi_ipi_device *sbi_ipi_get_device(void)void sbi_ipi_set_device (const struct sbi_ipi_device *dev) { -if (!dev || ipi_dev) +if (!dev || ipi_dev_count >=SBI_IPI_DEVICE_MAX )return ; + ipi_dev_array[ipi_dev_count++] = dev; - ipi_dev = dev; +if (!ipi_dev || ipi_dev->rating < dev->rating) + ipi_dev = dev; }int sbi_ipi_init (struct sbi_scratch *scratch,bool cold_boot)
@@ -347,7 +359,7 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) ipi_data->ipi_type =0x00 ;/* Clear any pending IPIs for the current hart */ -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);/* Enable software interrupts */ csr_set (CSR_MIE ,MIP_MSIP );
lib/utils/ipi/aclint_mswi.c +1 -0
@@ -62,6 +62,7 @@ static void mswi_ipi_clear(void)static struct sbi_ipi_device aclint_mswi = { .name ="aclint-mswi" , + .rating =100 , .ipi_send = mswi_ipi_send, .ipi_clear = mswi_ipi_clear };
lib/utils/ipi/andes_plicsw.c +1 -0
@@ -61,6 +61,7 @@ static void plicsw_ipi_clear(void)static struct sbi_ipi_device plicsw_ipi = { .name ="andes_plicsw" , + .rating =200 , .ipi_send = plicsw_ipi_send, .ipi_clear = plicsw_ipi_clear };
lib/utils/irqchip/imsic.c +1 -0
@@ -199,6 +199,7 @@ static void imsic_ipi_send(u32 hart_index)static struct sbi_ipi_device imsic_ipi_device = { .name ="aia-imsic" , + .rating =300 , .ipi_send = imsic_ipi_send };
Signature · 7 lines
2.43.0 -- opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi
Re: [PATCH 1/3] lib: sbi: Introduce IPI device rating
Hi Anup,
Quoted 68 lines · Anup Patel
A platform can have multiple IPI devices (such as ACLINT MSWI, AIA IMSIC, etc). Currently, OpenSBI rely on platform calling the
sbi_ipi_set_device()function in correct order and prefer the first avaiable IPI device which is fragile.Instead of the above, introdcue IPI device rating and prefer the highest rated IPI device. This further allows extending the
sbi_ipi_raw_clear()to clear all available IPI devices.Signed-off-by Anup Patel <[email protected]>--- include/sbi/sbi_ipi.h | 6 +++++- lib/sbi/sbi_init.c | 2 +- lib/sbi/sbi_ipi.c | 28 ++++++++++++++++++++-------- lib/utils/ipi/aclint_mswi.c | 1 + lib/utils/ipi/andes_plicsw.c | 1 + lib/utils/irqchip/imsic.c | 1 + 6 files changed, 29 insertions(+), 10 deletions(-)include/sbi/sbi_ipi.h +5
-1@@ -14,6 +14,7 @@/* clang-format off */ +#define SBI_IPI_DEVICE_MAX (4)#define SBI_IPI_EVENT_MAX (8 * __SIZEOF_LONG__)/* clang-format on */ @@ -23,6 +24,9 @@ struct sbi_ipi_device {/** Name of the IPI device */ char name[32 ]; +/** Ratings of the IPI device (higher is better) */ +unsigned long rating; +/** Send IPI to a target HART index */ void (*ipi_send)(u32 hart_index);@@ -87,7 +91,7 @@ void sbi_ipi_process(void);int sbi_ipi_raw_send (u32 hartindex); -void sbi_ipi_raw_clear (void ); +void sbi_ipi_raw_clear (bool all_devices);const struct sbi_ipi_device *sbi_ipi_get_device (void );lib/sbi/sbi_init.c +1
-1@@ -507,7 +507,7 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)if (hstate ==SBI_HSM_STATE_SUSPENDED ) {init_warm_resume (scratch, hartid); }else { -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);init_warm_startup (scratch, hartid); } }lib/sbi/sbi_ipi.c +0
-0
lib/sbi/sbi_ipi.c _Static_assert( · line 37
Quoted 7 lines
lib/sbi/sbi_ipi.c +2
-1@@ -32,8 +32,9 @@ _Static_assert("type of sbi_ipi_data.ipi_type has changed, please redefine SBI_IPI_EVENT_MAX" ); -static unsigned long ipi_data_off; +static unsigned long ipi_data_off, ipi_dev_count;static const struct sbi_ipi_device *ipi_dev =NULL ; +static const struct sbi_ipi_device *ipi_dev_array[SBI_IPI_DEVICE_MAX ];
Since the only things we do with the array are append to it and iterate over it, can we use a linked list here so there is no arbitrary limit?
Regards,
Samuel
Quoted 95 lines
lib/sbi/sbi_ipi.c +18
-7static const struct sbi_ipi_event_ops *ipi_ops_array[SBI_IPI_EVENT_MAX ]; static int sbi_ipi_send(struct sbi_scratch *scratch, u32 remote_hartindex,@@ -248,7 +249,7 @@ void sbi_ipi_process(void)sbi_scratch_offset_ptr (scratch, ipi_data_off);sbi_pmu_ctr_incr_fw (SBI_PMU_FW_IPI_RECVD ); -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (false); ipi_type =atomic_raw_xchg_ulong (&ipi_data->ipi_type,0 ); ipi_event =0 ;@@ -283,10 +284,19 @@ int sbi_ipi_raw_send(u32 hartindex)return 0 ; } -void sbi_ipi_raw_clear (void ) +void sbi_ipi_raw_clear (bool all_devices) { -if (ipi_dev && ipi_dev->ipi_clear) - ipi_dev->ipi_clear (); +int i; + +if (all_devices) { +for (i =0 ; i < ipi_dev_count; i++) { +if (ipi_dev_array[i]->ipi_clear) + ipi_dev_array[i]->ipi_clear (); + } + }else { +if (ipi_dev && ipi_dev->ipi_clear) + ipi_dev->ipi_clear (); + }/* * Ensure that memory or MMIO writes after this @@ -307,10 +317,12 @@ const struct sbi_ipi_device *sbi_ipi_get_device(void)void sbi_ipi_set_device (const struct sbi_ipi_device *dev) { -if (!dev || ipi_dev) +if (!dev || ipi_dev_count >=SBI_IPI_DEVICE_MAX )return ; + ipi_dev_array[ipi_dev_count++] = dev; - ipi_dev = dev; +if (!ipi_dev || ipi_dev->rating < dev->rating) + ipi_dev = dev; }int sbi_ipi_init (struct sbi_scratch *scratch,bool cold_boot)@@ -347,7 +359,7 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) ipi_data->ipi_type =0x00 ;/* Clear any pending IPIs for the current hart */ -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);/* Enable software interrupts */ csr_set (CSR_MIE ,MIP_MSIP );lib/utils/ipi/aclint_mswi.c +1
-0@@ -62,6 +62,7 @@ static void mswi_ipi_clear(void)static struct sbi_ipi_device aclint_mswi = { .name ="aclint-mswi" , + .rating =100 , .ipi_send = mswi_ipi_send, .ipi_clear = mswi_ipi_clear };lib/utils/ipi/andes_plicsw.c +1
-0@@ -61,6 +61,7 @@ static void plicsw_ipi_clear(void)static struct sbi_ipi_device plicsw_ipi = { .name ="andes_plicsw" , + .rating =200 , .ipi_send = plicsw_ipi_send, .ipi_clear = plicsw_ipi_clear };lib/utils/irqchip/imsic.c +1
-0@@ -199,6 +199,7 @@ static void imsic_ipi_send(u32 hart_index)static struct sbi_ipi_device imsic_ipi_device = { .name ="aia-imsic" , + .rating =300 , .ipi_send = imsic_ipi_send };
Signature · 3 lines
opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi
Re: [PATCH 1/3] lib: sbi: Introduce IPI device rating
Quoted 75 lines · Samuel Holland
Hi Anup,
Quoted 71 lines · Anup Patel
A platform can have multiple IPI devices (such as ACLINT MSWI, AIA IMSIC, etc). Currently, OpenSBI rely on platform calling the
sbi_ipi_set_device()function in correct order and prefer the first avaiable IPI device which is fragile.Instead of the above, introdcue IPI device rating and prefer the highest rated IPI device. This further allows extending the
sbi_ipi_raw_clear()to clear all available IPI devices.Signed-off-by Anup Patel <[email protected]>--- include/sbi/sbi_ipi.h | 6 +++++- lib/sbi/sbi_init.c | 2 +- lib/sbi/sbi_ipi.c | 28 ++++++++++++++++++++-------- lib/utils/ipi/aclint_mswi.c | 1 + lib/utils/ipi/andes_plicsw.c | 1 + lib/utils/irqchip/imsic.c | 1 + 6 files changed, 29 insertions(+), 10 deletions(-)include/sbi/sbi_ipi.h +5
-1@@ -14,6 +14,7 @@/* clang-format off */ +#define SBI_IPI_DEVICE_MAX (4)#define SBI_IPI_EVENT_MAX (8 * __SIZEOF_LONG__)/* clang-format on */ @@ -23,6 +24,9 @@ struct sbi_ipi_device {/** Name of the IPI device */ char name[32 ]; +/** Ratings of the IPI device (higher is better) */ +unsigned long rating; +/** Send IPI to a target HART index */ void (*ipi_send)(u32 hart_index);@@ -87,7 +91,7 @@ void sbi_ipi_process(void);int sbi_ipi_raw_send (u32 hartindex); -void sbi_ipi_raw_clear (void ); +void sbi_ipi_raw_clear (bool all_devices);const struct sbi_ipi_device *sbi_ipi_get_device (void );lib/sbi/sbi_init.c +1
-1@@ -507,7 +507,7 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)if (hstate ==SBI_HSM_STATE_SUSPENDED ) {init_warm_resume (scratch, hartid); }else { -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);init_warm_startup (scratch, hartid); } }lib/sbi/sbi_ipi.c +0
-0@@ -32,8 +32,9 @@ _Static_assert("type of sbi_ipi_data.ipi_type has changed, please redefine SBI_IPI_EVENT_MAX" );
Quoted 7 lines
lib/sbi/sbi_ipi.c _Static_assert( · line 37
Quoted 4 lines
lib/sbi/sbi_ipi.c +2
-1-static unsigned long ipi_data_off; +static unsigned long ipi_data_off, ipi_dev_count;static const struct sbi_ipi_device *ipi_dev =NULL ; +static const struct sbi_ipi_device *ipi_dev_array[SBI_IPI_DEVICE_MAX ];Since the only things we do with the array are append to it and iterate over it, can we use a linked list here so there is no arbitrary limit?
Sure, I will use linked list in v2.
Regards,
Anup
Signature · 3 lines
opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi
Re: [PATCH 1/3] lib: sbi: Introduce IPI device rating
In reply to Anup PatelQuoted 127 lines · Anup Patel
A platform can have multiple IPI devices (such as ACLINT MSWI, AIA IMSIC, etc). Currently, OpenSBI rely on platform calling the
sbi_ipi_set_device()function in correct order and prefer the first avaiable IPI device which is fragile.Instead of the above, introdcue IPI device rating and prefer the highest rated IPI device. This further allows extending the
sbi_ipi_raw_clear()to clear all available IPI devices.Signed-off-by Anup Patel <[email protected]>--- include/sbi/sbi_ipi.h | 6 +++++- lib/sbi/sbi_init.c | 2 +- lib/sbi/sbi_ipi.c | 28 ++++++++++++++++++++-------- lib/utils/ipi/aclint_mswi.c | 1 + lib/utils/ipi/andes_plicsw.c | 1 + lib/utils/irqchip/imsic.c | 1 + 6 files changed, 29 insertions(+), 10 deletions(-)include/sbi/sbi_ipi.h +5
-1@@ -14,6 +14,7 @@/* clang-format off */ +#define SBI_IPI_DEVICE_MAX (4)#define SBI_IPI_EVENT_MAX (8 * __SIZEOF_LONG__)/* clang-format on */ @@ -23,6 +24,9 @@ struct sbi_ipi_device {/** Name of the IPI device */ char name[32 ]; +/** Ratings of the IPI device (higher is better) */ +unsigned long rating; +/** Send IPI to a target HART index */ void (*ipi_send)(u32 hart_index);@@ -87,7 +91,7 @@ void sbi_ipi_process(void);int sbi_ipi_raw_send (u32 hartindex); -void sbi_ipi_raw_clear (void ); +void sbi_ipi_raw_clear (bool all_devices);const struct sbi_ipi_device *sbi_ipi_get_device (void );lib/sbi/sbi_init.c +1
-1@@ -507,7 +507,7 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)if (hstate ==SBI_HSM_STATE_SUSPENDED ) {init_warm_resume (scratch, hartid); }else { -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);init_warm_startup (scratch, hartid); } }lib/sbi/sbi_ipi.c +19
-7@@ -32,8 +32,9 @@ _Static_assert("type of sbi_ipi_data.ipi_type has changed, please redefine SBI_IPI_EVENT_MAX" ); -static unsigned long ipi_data_off; +static unsigned long ipi_data_off, ipi_dev_count;static const struct sbi_ipi_device *ipi_dev =NULL ; +static const struct sbi_ipi_device *ipi_dev_array[SBI_IPI_DEVICE_MAX ];static const struct sbi_ipi_event_ops *ipi_ops_array[SBI_IPI_EVENT_MAX ]; static int sbi_ipi_send(struct sbi_scratch *scratch, u32 remote_hartindex,@@ -248,7 +249,7 @@ void sbi_ipi_process(void)sbi_scratch_offset_ptr (scratch, ipi_data_off);sbi_pmu_ctr_incr_fw (SBI_PMU_FW_IPI_RECVD ); -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (false); ipi_type =atomic_raw_xchg_ulong (&ipi_data->ipi_type,0 ); ipi_event =0 ;@@ -283,10 +284,19 @@ int sbi_ipi_raw_send(u32 hartindex)return 0 ; } -void sbi_ipi_raw_clear (void ) +void sbi_ipi_raw_clear (bool all_devices) { -if (ipi_dev && ipi_dev->ipi_clear) - ipi_dev->ipi_clear (); +int i; + +if (all_devices) { +for (i =0 ; i < ipi_dev_count; i++) { +if (ipi_dev_array[i]->ipi_clear) + ipi_dev_array[i]->ipi_clear (); + } + }else { +if (ipi_dev && ipi_dev->ipi_clear) + ipi_dev->ipi_clear (); + }/* * Ensure that memory or MMIO writes after this @@ -307,10 +317,12 @@ const struct sbi_ipi_device *sbi_ipi_get_device(void)void sbi_ipi_set_device (const struct sbi_ipi_device *dev) { -if (!dev || ipi_dev) +if (!dev || ipi_dev_count >=SBI_IPI_DEVICE_MAX )return ; + ipi_dev_array[ipi_dev_count++] = dev; - ipi_dev = dev; +if (!ipi_dev || ipi_dev->rating < dev->rating) + ipi_dev = dev; }int sbi_ipi_init (struct sbi_scratch *scratch,bool cold_boot)
lib/sbi/sbi_ipi.c int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) · line 362
Quoted 5 lines
lib/sbi/sbi_ipi.c +1
-1@@ -347,7 +359,7 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) ipi_data->ipi_type =0x00 ;/* Clear any pending IPIs for the current hart */ -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);
Can we put it to the cold boot path since the init_warmboot() already cleared the IPI?
Quoted 47 lines
lib/sbi/sbi_ipi.c +0
-0/* Enable software interrupts */ csr_set (CSR_MIE ,MIP_MSIP );lib/utils/ipi/aclint_mswi.c +1
-0@@ -62,6 +62,7 @@ static void mswi_ipi_clear(void)static struct sbi_ipi_device aclint_mswi = { .name ="aclint-mswi" , + .rating =100 , .ipi_send = mswi_ipi_send, .ipi_clear = mswi_ipi_clear };lib/utils/ipi/andes_plicsw.c +1
-0@@ -61,6 +61,7 @@ static void plicsw_ipi_clear(void)static struct sbi_ipi_device plicsw_ipi = { .name ="andes_plicsw" , + .rating =200 , .ipi_send = plicsw_ipi_send, .ipi_clear = plicsw_ipi_clear };lib/utils/irqchip/imsic.c +1
-1@@ -199,6 +199,7 @@ static void imsic_ipi_send(u32 hart_index)static struct sbi_ipi_device imsic_ipi_device = { .name ="aia-imsic" , + .rating =300 , .ipi_send = imsic_ipi_send }; --2.43.0
--
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi
Signature · 3 lines
opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi
Re: [PATCH 1/3] lib: sbi: Introduce IPI device rating
Quoted 131 lines · Nick Hu
Quoted 129 lines · Anup Patel
A platform can have multiple IPI devices (such as ACLINT MSWI, AIA IMSIC, etc). Currently, OpenSBI rely on platform calling the
sbi_ipi_set_device()function in correct order and prefer the first avaiable IPI device which is fragile.Instead of the above, introdcue IPI device rating and prefer the highest rated IPI device. This further allows extending the
sbi_ipi_raw_clear()to clear all available IPI devices.Signed-off-by Anup Patel <[email protected]>--- include/sbi/sbi_ipi.h | 6 +++++- lib/sbi/sbi_init.c | 2 +- lib/sbi/sbi_ipi.c | 28 ++++++++++++++++++++-------- lib/utils/ipi/aclint_mswi.c | 1 + lib/utils/ipi/andes_plicsw.c | 1 + lib/utils/irqchip/imsic.c | 1 + 6 files changed, 29 insertions(+), 10 deletions(-)include/sbi/sbi_ipi.h +5
-1@@ -14,6 +14,7 @@/* clang-format off */ +#define SBI_IPI_DEVICE_MAX (4)#define SBI_IPI_EVENT_MAX (8 * __SIZEOF_LONG__)/* clang-format on */ @@ -23,6 +24,9 @@ struct sbi_ipi_device {/** Name of the IPI device */ char name[32 ]; +/** Ratings of the IPI device (higher is better) */ +unsigned long rating; +/** Send IPI to a target HART index */ void (*ipi_send)(u32 hart_index);@@ -87,7 +91,7 @@ void sbi_ipi_process(void);int sbi_ipi_raw_send (u32 hartindex); -void sbi_ipi_raw_clear (void ); +void sbi_ipi_raw_clear (bool all_devices);const struct sbi_ipi_device *sbi_ipi_get_device (void );lib/sbi/sbi_init.c +1
-1@@ -507,7 +507,7 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)if (hstate ==SBI_HSM_STATE_SUSPENDED ) {init_warm_resume (scratch, hartid); }else { -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);init_warm_startup (scratch, hartid); } }lib/sbi/sbi_ipi.c +19
-7@@ -32,8 +32,9 @@ _Static_assert("type of sbi_ipi_data.ipi_type has changed, please redefine SBI_IPI_EVENT_MAX" ); -static unsigned long ipi_data_off; +static unsigned long ipi_data_off, ipi_dev_count;static const struct sbi_ipi_device *ipi_dev =NULL ; +static const struct sbi_ipi_device *ipi_dev_array[SBI_IPI_DEVICE_MAX ];static const struct sbi_ipi_event_ops *ipi_ops_array[SBI_IPI_EVENT_MAX ]; static int sbi_ipi_send(struct sbi_scratch *scratch, u32 remote_hartindex,@@ -248,7 +249,7 @@ void sbi_ipi_process(void)sbi_scratch_offset_ptr (scratch, ipi_data_off);sbi_pmu_ctr_incr_fw (SBI_PMU_FW_IPI_RECVD ); -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (false); ipi_type =atomic_raw_xchg_ulong (&ipi_data->ipi_type,0 ); ipi_event =0 ;@@ -283,10 +284,19 @@ int sbi_ipi_raw_send(u32 hartindex)return 0 ; } -void sbi_ipi_raw_clear (void ) +void sbi_ipi_raw_clear (bool all_devices) { -if (ipi_dev && ipi_dev->ipi_clear) - ipi_dev->ipi_clear (); +int i; + +if (all_devices) { +for (i =0 ; i < ipi_dev_count; i++) { +if (ipi_dev_array[i]->ipi_clear) + ipi_dev_array[i]->ipi_clear (); + } + }else { +if (ipi_dev && ipi_dev->ipi_clear) + ipi_dev->ipi_clear (); + }/* * Ensure that memory or MMIO writes after this @@ -307,10 +317,12 @@ const struct sbi_ipi_device *sbi_ipi_get_device(void)void sbi_ipi_set_device (const struct sbi_ipi_device *dev) { -if (!dev || ipi_dev) +if (!dev || ipi_dev_count >=SBI_IPI_DEVICE_MAX )return ; + ipi_dev_array[ipi_dev_count++] = dev; - ipi_dev = dev; +if (!ipi_dev || ipi_dev->rating < dev->rating) + ipi_dev = dev; }int sbi_ipi_init (struct sbi_scratch *scratch,bool cold_boot)@@ -347,7 +359,7 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) ipi_data->ipi_type =0x00 ;
Quoted 5 lines
lib/sbi/sbi_ipi.c int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) · line 362
Quoted 3 lines
lib/sbi/sbi_ipi.c +1
-1/* Clear any pending IPIs for the current hart */ -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);Can we put it to the cold boot path since the
init_warmboot()already cleared the IPI?
sbi_ipi_raw_clear() only clears IPI for the current CPU hence must be done in init_warmboot(). This also helps when CPU is powered-off and powered-on.
Regards,
Anup
Quoted 48 lines
Quoted 48 lines
lib/sbi/sbi_ipi.c +0
-0/* Enable software interrupts */ csr_set (CSR_MIE ,MIP_MSIP );lib/utils/ipi/aclint_mswi.c +1
-0@@ -62,6 +62,7 @@ static void mswi_ipi_clear(void)static struct sbi_ipi_device aclint_mswi = { .name ="aclint-mswi" , + .rating =100 , .ipi_send = mswi_ipi_send, .ipi_clear = mswi_ipi_clear };lib/utils/ipi/andes_plicsw.c +1
-0@@ -61,6 +61,7 @@ static void plicsw_ipi_clear(void)static struct sbi_ipi_device plicsw_ipi = { .name ="andes_plicsw" , + .rating =200 , .ipi_send = plicsw_ipi_send, .ipi_clear = plicsw_ipi_clear };lib/utils/irqchip/imsic.c +1
-1@@ -199,6 +199,7 @@ static void imsic_ipi_send(u32 hart_index)static struct sbi_ipi_device imsic_ipi_device = { .name ="aia-imsic" , + .rating =300 , .ipi_send = imsic_ipi_send }; --2.43.0
--
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi
Signature · 3 lines
opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi
Re: [PATCH 1/3] lib: sbi: Introduce IPI device rating
In reply to Nick HuQuoted 131 lines · Nick Hu
Quoted 129 lines · Anup Patel
A platform can have multiple IPI devices (such as ACLINT MSWI, AIA IMSIC, etc). Currently, OpenSBI rely on platform calling the
sbi_ipi_set_device()function in correct order and prefer the first avaiable IPI device which is fragile.Instead of the above, introdcue IPI device rating and prefer the highest rated IPI device. This further allows extending the
sbi_ipi_raw_clear()to clear all available IPI devices.Signed-off-by Anup Patel <[email protected]>--- include/sbi/sbi_ipi.h | 6 +++++- lib/sbi/sbi_init.c | 2 +- lib/sbi/sbi_ipi.c | 28 ++++++++++++++++++++-------- lib/utils/ipi/aclint_mswi.c | 1 + lib/utils/ipi/andes_plicsw.c | 1 + lib/utils/irqchip/imsic.c | 1 + 6 files changed, 29 insertions(+), 10 deletions(-)include/sbi/sbi_ipi.h +5
-1@@ -14,6 +14,7 @@/* clang-format off */ +#define SBI_IPI_DEVICE_MAX (4)#define SBI_IPI_EVENT_MAX (8 * __SIZEOF_LONG__)/* clang-format on */ @@ -23,6 +24,9 @@ struct sbi_ipi_device {/** Name of the IPI device */ char name[32 ]; +/** Ratings of the IPI device (higher is better) */ +unsigned long rating; +/** Send IPI to a target HART index */ void (*ipi_send)(u32 hart_index);@@ -87,7 +91,7 @@ void sbi_ipi_process(void);int sbi_ipi_raw_send (u32 hartindex); -void sbi_ipi_raw_clear (void ); +void sbi_ipi_raw_clear (bool all_devices);const struct sbi_ipi_device *sbi_ipi_get_device (void );lib/sbi/sbi_init.c +1
-1@@ -507,7 +507,7 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)if (hstate ==SBI_HSM_STATE_SUSPENDED ) {init_warm_resume (scratch, hartid); }else { -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);init_warm_startup (scratch, hartid); } }lib/sbi/sbi_ipi.c +19
-7@@ -32,8 +32,9 @@ _Static_assert("type of sbi_ipi_data.ipi_type has changed, please redefine SBI_IPI_EVENT_MAX" ); -static unsigned long ipi_data_off; +static unsigned long ipi_data_off, ipi_dev_count;static const struct sbi_ipi_device *ipi_dev =NULL ; +static const struct sbi_ipi_device *ipi_dev_array[SBI_IPI_DEVICE_MAX ];static const struct sbi_ipi_event_ops *ipi_ops_array[SBI_IPI_EVENT_MAX ]; static int sbi_ipi_send(struct sbi_scratch *scratch, u32 remote_hartindex,@@ -248,7 +249,7 @@ void sbi_ipi_process(void)sbi_scratch_offset_ptr (scratch, ipi_data_off);sbi_pmu_ctr_incr_fw (SBI_PMU_FW_IPI_RECVD ); -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (false); ipi_type =atomic_raw_xchg_ulong (&ipi_data->ipi_type,0 ); ipi_event =0 ;@@ -283,10 +284,19 @@ int sbi_ipi_raw_send(u32 hartindex)return 0 ; } -void sbi_ipi_raw_clear (void ) +void sbi_ipi_raw_clear (bool all_devices) { -if (ipi_dev && ipi_dev->ipi_clear) - ipi_dev->ipi_clear (); +int i; + +if (all_devices) { +for (i =0 ; i < ipi_dev_count; i++) { +if (ipi_dev_array[i]->ipi_clear) + ipi_dev_array[i]->ipi_clear (); + } + }else { +if (ipi_dev && ipi_dev->ipi_clear) + ipi_dev->ipi_clear (); + }/* * Ensure that memory or MMIO writes after this @@ -307,10 +317,12 @@ const struct sbi_ipi_device *sbi_ipi_get_device(void)void sbi_ipi_set_device (const struct sbi_ipi_device *dev) { -if (!dev || ipi_dev) +if (!dev || ipi_dev_count >=SBI_IPI_DEVICE_MAX )return ; + ipi_dev_array[ipi_dev_count++] = dev; - ipi_dev = dev; +if (!ipi_dev || ipi_dev->rating < dev->rating) + ipi_dev = dev; }int sbi_ipi_init (struct sbi_scratch *scratch,bool cold_boot)@@ -347,7 +359,7 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) ipi_data->ipi_type =0x00 ;
Quoted 5 lines
lib/sbi/sbi_ipi.c int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) · line 362
Quoted 3 lines
lib/sbi/sbi_ipi.c +1
-1/* Clear any pending IPIs for the current hart */ -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);Can we put it to the cold boot path since the
init_warmboot()already cleared the IPI?
I think you are pointing at the sbi_ipi_raw_clear() just before init_warmboot() in sbi_init.c.
Let me recall why it was added there. Anyway it's a separate change so should be a separate patch.
Regards,
Anup
Signature · 3 lines
opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi
Re: [PATCH 1/3] lib: sbi: Introduce IPI device rating
Quoted 139 lines · Anup Patel
Quoted 131 lines · Nick Hu
Quoted 129 lines · Anup Patel
A platform can have multiple IPI devices (such as ACLINT MSWI, AIA IMSIC, etc). Currently, OpenSBI rely on platform calling the
sbi_ipi_set_device()function in correct order and prefer the first avaiable IPI device which is fragile.Instead of the above, introdcue IPI device rating and prefer the highest rated IPI device. This further allows extending the
sbi_ipi_raw_clear()to clear all available IPI devices.Signed-off-by Anup Patel <[email protected]>--- include/sbi/sbi_ipi.h | 6 +++++- lib/sbi/sbi_init.c | 2 +- lib/sbi/sbi_ipi.c | 28 ++++++++++++++++++++-------- lib/utils/ipi/aclint_mswi.c | 1 + lib/utils/ipi/andes_plicsw.c | 1 + lib/utils/irqchip/imsic.c | 1 + 6 files changed, 29 insertions(+), 10 deletions(-)include/sbi/sbi_ipi.h +5
-1@@ -14,6 +14,7 @@/* clang-format off */ +#define SBI_IPI_DEVICE_MAX (4)#define SBI_IPI_EVENT_MAX (8 * __SIZEOF_LONG__)/* clang-format on */ @@ -23,6 +24,9 @@ struct sbi_ipi_device {/** Name of the IPI device */ char name[32 ]; +/** Ratings of the IPI device (higher is better) */ +unsigned long rating; +/** Send IPI to a target HART index */ void (*ipi_send)(u32 hart_index);@@ -87,7 +91,7 @@ void sbi_ipi_process(void);int sbi_ipi_raw_send (u32 hartindex); -void sbi_ipi_raw_clear (void ); +void sbi_ipi_raw_clear (bool all_devices);const struct sbi_ipi_device *sbi_ipi_get_device (void );lib/sbi/sbi_init.c +1
-1@@ -507,7 +507,7 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)if (hstate ==SBI_HSM_STATE_SUSPENDED ) {init_warm_resume (scratch, hartid); }else { -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);init_warm_startup (scratch, hartid); } }lib/sbi/sbi_ipi.c +19
-7@@ -32,8 +32,9 @@ _Static_assert("type of sbi_ipi_data.ipi_type has changed, please redefine SBI_IPI_EVENT_MAX" ); -static unsigned long ipi_data_off; +static unsigned long ipi_data_off, ipi_dev_count;static const struct sbi_ipi_device *ipi_dev =NULL ; +static const struct sbi_ipi_device *ipi_dev_array[SBI_IPI_DEVICE_MAX ];static const struct sbi_ipi_event_ops *ipi_ops_array[SBI_IPI_EVENT_MAX ]; static int sbi_ipi_send(struct sbi_scratch *scratch, u32 remote_hartindex,@@ -248,7 +249,7 @@ void sbi_ipi_process(void)sbi_scratch_offset_ptr (scratch, ipi_data_off);sbi_pmu_ctr_incr_fw (SBI_PMU_FW_IPI_RECVD ); -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (false); ipi_type =atomic_raw_xchg_ulong (&ipi_data->ipi_type,0 ); ipi_event =0 ;@@ -283,10 +284,19 @@ int sbi_ipi_raw_send(u32 hartindex)return 0 ; } -void sbi_ipi_raw_clear (void ) +void sbi_ipi_raw_clear (bool all_devices) { -if (ipi_dev && ipi_dev->ipi_clear) - ipi_dev->ipi_clear (); +int i; + +if (all_devices) { +for (i =0 ; i < ipi_dev_count; i++) { +if (ipi_dev_array[i]->ipi_clear) + ipi_dev_array[i]->ipi_clear (); + } + }else { +if (ipi_dev && ipi_dev->ipi_clear) + ipi_dev->ipi_clear (); + }/* * Ensure that memory or MMIO writes after this @@ -307,10 +317,12 @@ const struct sbi_ipi_device *sbi_ipi_get_device(void)void sbi_ipi_set_device (const struct sbi_ipi_device *dev) { -if (!dev || ipi_dev) +if (!dev || ipi_dev_count >=SBI_IPI_DEVICE_MAX )return ; + ipi_dev_array[ipi_dev_count++] = dev; - ipi_dev = dev; +if (!ipi_dev || ipi_dev->rating < dev->rating) + ipi_dev = dev; }int sbi_ipi_init (struct sbi_scratch *scratch,bool cold_boot)@@ -347,7 +359,7 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) ipi_data->ipi_type =0x00 ;Quoted 5 lines
lib/sbi/sbi_ipi.c int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) · line 362
Quoted 3 lines
lib/sbi/sbi_ipi.c +1
-1/* Clear any pending IPIs for the current hart */ -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);Can we put it to the cold boot path since the
init_warmboot()already cleared the IPI?
Quoted 6 lines
I think you are pointing at the
sbi_ipi_raw_clear()just beforeinit_warmboot()insbi_init.c.Let me recall why it was added there. Anyway it's a separate change so should be a separate patch.
I recall now. The sbi_hsm_hart_wait() does WFI so we have to:
1) Clear IPI before entering the wait loop in sbi_hsm_hart_wait() because there should not be any stale IPI from the previous booting stage when HART enters OpenSBI in the warm-boot path. This is why we have sbi_ipi_raw_clear() before init_warm_startup().
2) Clear IPI after coming out of wait loop in sbi_hsm_hart_wait() because some other HART might have started current HART using M-mode IPI which is why we have sbi_ipi_raw_clear() in sbi_ipi_init() in the warm-boot path.
Regards,
Anup
Signature · 3 lines
opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi
Re: [PATCH 1/3] lib: sbi: Introduce IPI device rating
Quoted 155 lines · Anup Patel
Quoted 139 lines · Anup Patel
Quoted 131 lines · Nick Hu
Quoted 129 lines · Anup Patel
A platform can have multiple IPI devices (such as ACLINT MSWI, AIA IMSIC, etc). Currently, OpenSBI rely on platform calling the
sbi_ipi_set_device()function in correct order and prefer the first avaiable IPI device which is fragile.Instead of the above, introdcue IPI device rating and prefer the highest rated IPI device. This further allows extending the
sbi_ipi_raw_clear()to clear all available IPI devices.Signed-off-by Anup Patel <[email protected]>--- include/sbi/sbi_ipi.h | 6 +++++- lib/sbi/sbi_init.c | 2 +- lib/sbi/sbi_ipi.c | 28 ++++++++++++++++++++-------- lib/utils/ipi/aclint_mswi.c | 1 + lib/utils/ipi/andes_plicsw.c | 1 + lib/utils/irqchip/imsic.c | 1 + 6 files changed, 29 insertions(+), 10 deletions(-)include/sbi/sbi_ipi.h +5
-1@@ -14,6 +14,7 @@/* clang-format off */ +#define SBI_IPI_DEVICE_MAX (4)#define SBI_IPI_EVENT_MAX (8 * __SIZEOF_LONG__)/* clang-format on */ @@ -23,6 +24,9 @@ struct sbi_ipi_device {/** Name of the IPI device */ char name[32 ]; +/** Ratings of the IPI device (higher is better) */ +unsigned long rating; +/** Send IPI to a target HART index */ void (*ipi_send)(u32 hart_index);@@ -87,7 +91,7 @@ void sbi_ipi_process(void);int sbi_ipi_raw_send (u32 hartindex); -void sbi_ipi_raw_clear (void ); +void sbi_ipi_raw_clear (bool all_devices);const struct sbi_ipi_device *sbi_ipi_get_device (void );lib/sbi/sbi_init.c +1
-1@@ -507,7 +507,7 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)if (hstate ==SBI_HSM_STATE_SUSPENDED ) {init_warm_resume (scratch, hartid); }else { -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);init_warm_startup (scratch, hartid); } }lib/sbi/sbi_ipi.c +19
-7@@ -32,8 +32,9 @@ _Static_assert("type of sbi_ipi_data.ipi_type has changed, please redefine SBI_IPI_EVENT_MAX" ); -static unsigned long ipi_data_off; +static unsigned long ipi_data_off, ipi_dev_count;static const struct sbi_ipi_device *ipi_dev =NULL ; +static const struct sbi_ipi_device *ipi_dev_array[SBI_IPI_DEVICE_MAX ];static const struct sbi_ipi_event_ops *ipi_ops_array[SBI_IPI_EVENT_MAX ]; static int sbi_ipi_send(struct sbi_scratch *scratch, u32 remote_hartindex,@@ -248,7 +249,7 @@ void sbi_ipi_process(void)sbi_scratch_offset_ptr (scratch, ipi_data_off);sbi_pmu_ctr_incr_fw (SBI_PMU_FW_IPI_RECVD ); -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (false); ipi_type =atomic_raw_xchg_ulong (&ipi_data->ipi_type,0 ); ipi_event =0 ;@@ -283,10 +284,19 @@ int sbi_ipi_raw_send(u32 hartindex)return 0 ; } -void sbi_ipi_raw_clear (void ) +void sbi_ipi_raw_clear (bool all_devices) { -if (ipi_dev && ipi_dev->ipi_clear) - ipi_dev->ipi_clear (); +int i; + +if (all_devices) { +for (i =0 ; i < ipi_dev_count; i++) { +if (ipi_dev_array[i]->ipi_clear) + ipi_dev_array[i]->ipi_clear (); + } + }else { +if (ipi_dev && ipi_dev->ipi_clear) + ipi_dev->ipi_clear (); + }/* * Ensure that memory or MMIO writes after this @@ -307,10 +317,12 @@ const struct sbi_ipi_device *sbi_ipi_get_device(void)void sbi_ipi_set_device (const struct sbi_ipi_device *dev) { -if (!dev || ipi_dev) +if (!dev || ipi_dev_count >=SBI_IPI_DEVICE_MAX )return ; + ipi_dev_array[ipi_dev_count++] = dev; - ipi_dev = dev; +if (!ipi_dev || ipi_dev->rating < dev->rating) + ipi_dev = dev; }int sbi_ipi_init (struct sbi_scratch *scratch,bool cold_boot)@@ -347,7 +359,7 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) ipi_data->ipi_type =0x00 ;Quoted 5 lines
lib/sbi/sbi_ipi.c int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) · line 362
Quoted 3 lines
lib/sbi/sbi_ipi.c +1
-1/* Clear any pending IPIs for the current hart */ -sbi_ipi_raw_clear (); +sbi_ipi_raw_clear (true);Can we put it to the cold boot path since the
init_warmboot()already cleared the IPI?Quoted 6 lines
I think you are pointing at the
sbi_ipi_raw_clear()just beforeinit_warmboot()insbi_init.c.Let me recall why it was added there. Anyway it's a separate change so should be a separate patch.
I recall now. The
sbi_hsm_hart_wait()does WFI so we have to:1) Clear IPI before entering the wait loop in
sbi_hsm_hart_wait()because there should not be any stale IPI from the previous booting stage when HART enters OpenSBI in the warm-boot path. This is why we havesbi_ipi_raw_clear()beforeinit_warm_startup().
Quoted 5 lines
2) Clear IPI after coming out of wait loop in
sbi_hsm_hart_wait()because some other HART might have started current HART using M-mode IPI which is why we havesbi_ipi_raw_clear()insbi_ipi_init()in the warm-boot path.
That makes sense. Thank you for the clarification.
Quoted 2 lines
Regards,
Anup
Signature · 3 lines
opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi
PATCH 2/3 include: sbi: Remove platform specific IPI init
In reply to Anup PatelThe platform specfic IPI init is not need anymore because using IPI device rating multiple IPI devices can be registered in any order as part of the platform specific early init.
--- include/sbi/sbi_platform.h | 17 ----------------- lib/sbi/sbi_ipi.c | 5 ----- platform/fpga/ariane/platform.c | 15 ++++++--------- platform/generic/openhwgroup/openpiton.c | 13 ++++--------- platform/generic/platform.c | 5 ++++- platform/kendryte/k210/platform.c | 13 ++++++------- platform/nuclei/ux600/platform.c | 11 +++++------ platform/template/platform.c | 16 ++++++---------- 8 files changed, 31 insertions(+), 64 deletions(-)
include/sbi/sbi_platform.h +0 -17
@@ -116,9 +116,6 @@ struct sbi_platform_operations {/** Initialize the platform interrupt controller during cold boot */ int (*irqchip_init)(void ); -/** Initialize IPI during cold boot */ -int (*ipi_init)(void ); -/** Get tlb flush limit value **/ u64 (*get_tlbr_flush_limit)(void);
@@ -528,20 +525,6 @@ static inline int sbi_platform_irqchip_init(const struct sbi_platform *plat)return 0 ; } -/** -* Initialize the platform IPI support during cold boot -* -* @param plat pointer to struct sbi_platform -* -* @return 0 on success and negative error code on failure -*/ -static inline int sbi_platform_ipi_init (const struct sbi_platform *plat) -{ -if (plat &&sbi_platform_ops (plat)->ipi_init) -return sbi_platform_ops (plat)->ipi_init (); -return 0 ; -} -/** * Initialize the platform timer during cold boot *
lib/sbi/sbi_ipi.c +0 -5
@@ -342,11 +342,6 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot)if (ret <0 )return ret; ipi_halt_event = ret; - -/* Initialize platform IPI support */ - ret =sbi_platform_ipi_init (sbi_platform_ptr (scratch)); -if (ret) -return ret; }else {if (!ipi_data_off)return SBI_ENOMEM ;
platform/fpga/ariane/platform.c +6 -9
@@ -71,9 +71,15 @@ static struct aclint_mtimer_data mtimer = {*/ static int ariane_early_init (bool cold_boot) { +int rc; +if (!cold_boot)return 0 ; + rc =aclint_mswi_cold_init (&mswi); +if (rc) +return rc; + return uart8250_init(ARIANE_UART_ADDR, ARIANE_UART_FREQ, ARIANE_UART_BAUDRATE,
@@ -107,14 +113,6 @@ static int ariane_irqchip_init(void)return plic_cold_irqchip_init (&plic); } -/* -* Initialize IPI during cold boot. -*/ -static int ariane_ipi_init (void ) -{ -return aclint_mswi_cold_init (&mswi); -} -/* * Initialize ariane timer during cold boot. */
@@ -130,7 +128,6 @@ const struct sbi_platform_operations platform_ops = { .early_init = ariane_early_init, .final_init = ariane_final_init, .irqchip_init = ariane_irqchip_init, - .ipi_init = ariane_ipi_init, .timer_init = ariane_timer_init, };
platform/generic/openhwgroup/openpiton.c +4 -9
@@ -104,6 +104,10 @@ static int openpiton_early_init(bool cold_boot)ACLINT_DEFAULT_MTIMECMP_OFFSET ; } + rc =aclint_mswi_cold_init (&mswi); +if (rc) +return rc; + return uart8250_init(uart.addr, uart.freq, uart.baud, OPENPITON_DEFAULT_UART_REG_SHIFT, OPENPITON_DEFAULT_UART_REG_WIDTH,
@@ -135,14 +139,6 @@ static int openpiton_irqchip_init(void)return plic_cold_irqchip_init (&plic); } -/* -* Initialize IPI during cold boot. -*/ -static int openpiton_ipi_init (void ) -{ -return aclint_mswi_cold_init (&mswi); -} -/* * Initialize openpiton timer during cold boot. */
@@ -155,7 +151,6 @@ static int openhwgroup_openpiton_platform_init(const void *fdt, int nodeoff, con { generic_platform_ops.early_init = openpiton_early_init; generic_platform_ops.timer_init = openpiton_timer_init; - generic_platform_ops.ipi_init = openpiton_ipi_init; generic_platform_ops.irqchip_init = openpiton_irqchip_init; generic_platform_ops.final_init = openpiton_final_init;
platform/generic/platform.c +4 -1
@@ -229,6 +229,10 @@ int generic_early_init(bool cold_boot)return rc;fdt_driver_init_all (fdt, fdt_early_drivers); + + rc =fdt_ipi_init (); +if (rc) +return rc; }return 0 ;
@@ -337,7 +341,6 @@ struct sbi_platform_operations generic_platform_ops = { .extensions_init = generic_extensions_init, .domains_init = generic_domains_init, .irqchip_init = fdt_irqchip_init, - .ipi_init = fdt_ipi_init, .pmu_init = generic_pmu_init, .pmu_xlate_to_mhpmevent = generic_pmu_xlate_to_mhpmevent, .get_tlbr_flush_limit = generic_tlbr_flush_limit,
platform/kendryte/k210/platform.c +6 -7
@@ -112,9 +112,15 @@ static struct sbi_system_reset_device k210_reset = {static int k210_early_init (bool cold_boot) { +int rc; +if (!cold_boot)return 0 ; + rc =aclint_mswi_cold_init (&mswi); +if (rc) +return rc; +sbi_system_reset_add_device (&k210_reset); return sifive_uart_init(K210_UART_BASE_ADDR, k210_get_clk_freq(),
@@ -141,11 +147,6 @@ static int k210_irqchip_init(void)return plic_cold_irqchip_init (&plic); } -static int k210_ipi_init (void ) -{ -return aclint_mswi_cold_init (&mswi); -} -static int k210_timer_init (void ) {return aclint_mtimer_cold_init (&mtimer,NULL );
@@ -158,8 +159,6 @@ const struct sbi_platform_operations platform_ops = { .irqchip_init = k210_irqchip_init, - .ipi_init = k210_ipi_init, - .timer_init = k210_timer_init, };
platform/nuclei/ux600/platform.c +5 -6
@@ -151,10 +151,15 @@ static struct sbi_system_reset_device ux600_reset = {static int ux600_early_init (bool cold_boot) {u32 regval; +int rc;if (!cold_boot)return 0 ; + rc =aclint_mswi_cold_init (&mswi); +if (rc) +return rc; +sbi_system_reset_add_device (&ux600_reset);/* Measure CPU Frequency using Timer */
@@ -195,11 +200,6 @@ static int ux600_irqchip_init(void)return plic_cold_irqchip_init (&plic); } -static int ux600_ipi_init (void ) -{ -return aclint_mswi_cold_init (&mswi); -} -static int ux600_timer_init (void ) {return aclint_mtimer_cold_init (&mtimer,NULL );
@@ -209,7 +209,6 @@ const struct sbi_platform_operations platform_ops = { .early_init = ux600_early_init, .final_init = ux600_final_init, .irqchip_init = ux600_irqchip_init, - .ipi_init = ux600_ipi_init, .timer_init = ux600_timer_init, };
platform/template/platform.c +6 -10
@@ -70,9 +70,15 @@ static struct aclint_mtimer_data mtimer = {*/ static int platform_early_init (bool cold_boot) { +int rc; +if (!cold_boot)return 0 ; + rc =aclint_mswi_cold_init (&mswi); +if (rc) +return rc; +/* Example if the generic UART8250 driver is used */ return uart8250_init (PLATFORM_UART_ADDR ,PLATFORM_UART_INPUT_FREQ ,PLATFORM_UART_BAUDRATE ,0 ,1 ,0 ,0 );
@@ -95,15 +101,6 @@ static int platform_irqchip_init(void)return plic_cold_irqchip_init (&plic); } -/* -* Initialize IPI during cold boot. -*/ -static int platform_ipi_init (void ) -{ -/* Example if the generic ACLINT driver is used */ -return aclint_mswi_cold_init (&mswi); -} -/* * Initialize platform timer during cold boot. */
@@ -120,7 +117,6 @@ const struct sbi_platform_operations platform_ops = { .early_init = platform_early_init, .final_init = platform_final_init, .irqchip_init = platform_irqchip_init, - .ipi_init = platform_ipi_init, .timer_init = platform_timer_init };const struct sbi_platform platform = {
Signature · 7 lines
2.43.0 -- opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi
Re: [PATCH 2/3] include: sbi: Remove platform specific IPI init
Hi Anup,
Quoted 77 lines · Anup Patel
The platform specfic IPI init is not need anymore because using IPI device rating multiple IPI devices can be registered in any order as part of the platform specific early init.
Signed-off-by Anup Patel <[email protected]>--- include/sbi/sbi_platform.h | 17 ----------------- lib/sbi/sbi_ipi.c | 5 ----- platform/fpga/ariane/platform.c | 15 ++++++--------- platform/generic/openhwgroup/openpiton.c | 13 ++++--------- platform/generic/platform.c | 5 ++++- platform/kendryte/k210/platform.c | 13 ++++++------- platform/nuclei/ux600/platform.c | 11 +++++------ platform/template/platform.c | 16 ++++++---------- 8 files changed, 31 insertions(+), 64 deletions(-)include/sbi/sbi_platform.h +0
-17@@ -116,9 +116,6 @@ struct sbi_platform_operations {/** Initialize the platform interrupt controller during cold boot */ int (*irqchip_init)(void ); -/** Initialize IPI during cold boot */ -int (*ipi_init)(void ); -/** Get tlb flush limit value **/ u64 (*get_tlbr_flush_limit)(void);@@ -528,20 +525,6 @@ static inline int sbi_platform_irqchip_init(const struct sbi_platform *plat)return 0 ; } -/** -* Initialize the platform IPI support during cold boot -* -* @param plat pointer to struct sbi_platform -* -* @return 0 on success and negative error code on failure -*/ -static inline int sbi_platform_ipi_init (const struct sbi_platform *plat) -{ -if (plat &&sbi_platform_ops (plat)->ipi_init) -return sbi_platform_ops (plat)->ipi_init (); -return 0 ; -} -/** * Initialize the platform timer during cold boot * lib/sbi/sbi_ipi.c +0
-5@@ -342,11 +342,6 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot)if (ret <0 )return ret; ipi_halt_event = ret; - -/* Initialize platform IPI support */ - ret =sbi_platform_ipi_init (sbi_platform_ptr (scratch)); -if (ret) -return ret; }else {if (!ipi_data_off)return SBI_ENOMEM ;platform/fpga/ariane/platform.c +2
-0@@ -71,9 +71,15 @@ static struct aclint_mtimer_data mtimer = {*/ static int ariane_early_init (bool cold_boot) { +int rc; +
platform/fpga/ariane/platform.c static struct aclint_mtimer_data mtimer = { · line 85
Quoted 10 lines
platform/fpga/ariane/platform.c +4
-0if (!cold_boot)return 0 ; + rc =aclint_mswi_cold_init (&mswi); +if (rc) +return rc; + return uart8250_init(ARIANE_UART_ADDR, ARIANE_UART_FREQ, ARIANE_UART_BAUDRATE,
I would recommend to keep the serial device initialization first in these functions to help with any future debugging.
Regards,
Samuel
Quoted 209 lines
platform/fpga/ariane/platform.c +0
-9@@ -107,14 +113,6 @@ static int ariane_irqchip_init(void)return plic_cold_irqchip_init (&plic); } -/* -* Initialize IPI during cold boot. -*/ -static int ariane_ipi_init (void ) -{ -return aclint_mswi_cold_init (&mswi); -} -/* * Initialize ariane timer during cold boot. */ @@ -130,7 +128,6 @@ const struct sbi_platform_operations platform_ops = { .early_init = ariane_early_init, .final_init = ariane_final_init, .irqchip_init = ariane_irqchip_init, - .ipi_init = ariane_ipi_init, .timer_init = ariane_timer_init, };platform/generic/openhwgroup/openpiton.c +4
-9@@ -104,6 +104,10 @@ static int openpiton_early_init(bool cold_boot)ACLINT_DEFAULT_MTIMECMP_OFFSET ; } + rc =aclint_mswi_cold_init (&mswi); +if (rc) +return rc; + return uart8250_init(uart.addr, uart.freq, uart.baud, OPENPITON_DEFAULT_UART_REG_SHIFT, OPENPITON_DEFAULT_UART_REG_WIDTH,@@ -135,14 +139,6 @@ static int openpiton_irqchip_init(void)return plic_cold_irqchip_init (&plic); } -/* -* Initialize IPI during cold boot. -*/ -static int openpiton_ipi_init (void ) -{ -return aclint_mswi_cold_init (&mswi); -} -/* * Initialize openpiton timer during cold boot. */ @@ -155,7 +151,6 @@ static int openhwgroup_openpiton_platform_init(const void *fdt, int nodeoff, con { generic_platform_ops.early_init = openpiton_early_init; generic_platform_ops.timer_init = openpiton_timer_init; - generic_platform_ops.ipi_init = openpiton_ipi_init; generic_platform_ops.irqchip_init = openpiton_irqchip_init; generic_platform_ops.final_init = openpiton_final_init;platform/generic/platform.c +4
-1@@ -229,6 +229,10 @@ int generic_early_init(bool cold_boot)return rc;fdt_driver_init_all (fdt, fdt_early_drivers); + + rc =fdt_ipi_init (); +if (rc) +return rc; }return 0 ;@@ -337,7 +341,6 @@ struct sbi_platform_operations generic_platform_ops = { .extensions_init = generic_extensions_init, .domains_init = generic_domains_init, .irqchip_init = fdt_irqchip_init, - .ipi_init = fdt_ipi_init, .pmu_init = generic_pmu_init, .pmu_xlate_to_mhpmevent = generic_pmu_xlate_to_mhpmevent, .get_tlbr_flush_limit = generic_tlbr_flush_limit,platform/kendryte/k210/platform.c +6
-7@@ -112,9 +112,15 @@ static struct sbi_system_reset_device k210_reset = {static int k210_early_init (bool cold_boot) { +int rc; +if (!cold_boot)return 0 ; + rc =aclint_mswi_cold_init (&mswi); +if (rc) +return rc; +sbi_system_reset_add_device (&k210_reset); return sifive_uart_init(K210_UART_BASE_ADDR, k210_get_clk_freq(),@@ -141,11 +147,6 @@ static int k210_irqchip_init(void)return plic_cold_irqchip_init (&plic); } -static int k210_ipi_init (void ) -{ -return aclint_mswi_cold_init (&mswi); -} -static int k210_timer_init (void ) {return aclint_mtimer_cold_init (&mtimer,NULL );@@ -158,8 +159,6 @@ const struct sbi_platform_operations platform_ops = { .irqchip_init = k210_irqchip_init, - .ipi_init = k210_ipi_init, - .timer_init = k210_timer_init, };platform/nuclei/ux600/platform.c +5
-6@@ -151,10 +151,15 @@ static struct sbi_system_reset_device ux600_reset = {static int ux600_early_init (bool cold_boot) {u32 regval; +int rc;if (!cold_boot)return 0 ; + rc =aclint_mswi_cold_init (&mswi); +if (rc) +return rc; +sbi_system_reset_add_device (&ux600_reset);/* Measure CPU Frequency using Timer */ @@ -195,11 +200,6 @@ static int ux600_irqchip_init(void)return plic_cold_irqchip_init (&plic); } -static int ux600_ipi_init (void ) -{ -return aclint_mswi_cold_init (&mswi); -} -static int ux600_timer_init (void ) {return aclint_mtimer_cold_init (&mtimer,NULL );@@ -209,7 +209,6 @@ const struct sbi_platform_operations platform_ops = { .early_init = ux600_early_init, .final_init = ux600_final_init, .irqchip_init = ux600_irqchip_init, - .ipi_init = ux600_ipi_init, .timer_init = ux600_timer_init, };platform/template/platform.c +6
-10@@ -70,9 +70,15 @@ static struct aclint_mtimer_data mtimer = {*/ static int platform_early_init (bool cold_boot) { +int rc; +if (!cold_boot)return 0 ; + rc =aclint_mswi_cold_init (&mswi); +if (rc) +return rc; +/* Example if the generic UART8250 driver is used */ return uart8250_init (PLATFORM_UART_ADDR ,PLATFORM_UART_INPUT_FREQ ,PLATFORM_UART_BAUDRATE ,0 ,1 ,0 ,0 );@@ -95,15 +101,6 @@ static int platform_irqchip_init(void)return plic_cold_irqchip_init (&plic); } -/* -* Initialize IPI during cold boot. -*/ -static int platform_ipi_init (void ) -{ -/* Example if the generic ACLINT driver is used */ -return aclint_mswi_cold_init (&mswi); -} -/* * Initialize platform timer during cold boot. */ @@ -120,7 +117,6 @@ const struct sbi_platform_operations platform_ops = { .early_init = platform_early_init, .final_init = platform_final_init, .irqchip_init = platform_irqchip_init, - .ipi_init = platform_ipi_init, .timer_init = platform_timer_init };const struct sbi_platform platform = {
Signature · 3 lines
opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi
Re: [PATCH 2/3] include: sbi: Remove platform specific IPI init
Quoted 84 lines · Samuel Holland
Hi Anup,
Quoted 80 lines · Anup Patel
The platform specfic IPI init is not need anymore because using IPI device rating multiple IPI devices can be registered in any order as part of the platform specific early init.
Signed-off-by Anup Patel <[email protected]>--- include/sbi/sbi_platform.h | 17 ----------------- lib/sbi/sbi_ipi.c | 5 ----- platform/fpga/ariane/platform.c | 15 ++++++--------- platform/generic/openhwgroup/openpiton.c | 13 ++++--------- platform/generic/platform.c | 5 ++++- platform/kendryte/k210/platform.c | 13 ++++++------- platform/nuclei/ux600/platform.c | 11 +++++------ platform/template/platform.c | 16 ++++++---------- 8 files changed, 31 insertions(+), 64 deletions(-)include/sbi/sbi_platform.h +0
-17@@ -116,9 +116,6 @@ struct sbi_platform_operations {/** Initialize the platform interrupt controller during cold boot */ int (*irqchip_init)(void ); -/** Initialize IPI during cold boot */ -int (*ipi_init)(void ); -/** Get tlb flush limit value **/ u64 (*get_tlbr_flush_limit)(void);@@ -528,20 +525,6 @@ static inline int sbi_platform_irqchip_init(const struct sbi_platform *plat)return 0 ; } -/** -* Initialize the platform IPI support during cold boot -* -* @param plat pointer to struct sbi_platform -* -* @return 0 on success and negative error code on failure -*/ -static inline int sbi_platform_ipi_init (const struct sbi_platform *plat) -{ -if (plat &&sbi_platform_ops (plat)->ipi_init) -return sbi_platform_ops (plat)->ipi_init (); -return 0 ; -} -/** * Initialize the platform timer during cold boot * lib/sbi/sbi_ipi.c +0
-5@@ -342,11 +342,6 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot)if (ret <0 )return ret; ipi_halt_event = ret; - -/* Initialize platform IPI support */ - ret =sbi_platform_ipi_init (sbi_platform_ptr (scratch)); -if (ret) -return ret; }else {if (!ipi_data_off)return SBI_ENOMEM ;platform/fpga/ariane/platform.c +2
-0@@ -71,9 +71,15 @@ static struct aclint_mtimer_data mtimer = {*/ static int ariane_early_init (bool cold_boot) { +int rc; +if (!cold_boot)return 0 ;
Quoted 11 lines
platform/fpga/ariane/platform.c static struct aclint_mtimer_data mtimer = { · line 85
Quoted 7 lines
platform/fpga/ariane/platform.c +4
-0+ rc =aclint_mswi_cold_init (&mswi); +if (rc) +return rc; + return uart8250_init(ARIANE_UART_ADDR, ARIANE_UART_FREQ, ARIANE_UART_BAUDRATE,I would recommend to keep the serial device initialization first in these functions to help with any future debugging.
Sure, I will update in v2.
Regards,
Anup
Signature · 3 lines
opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi
PATCH 3/3 lib: utils/ipi: Convert IPI drivers as early drivers
In reply to Anup PatelThe fdt_ipi_init() is already called from generic_early_init() so let's convert IPI drivers as early drivers.
--- include/sbi_utils/ipi/fdt_ipi.h | 26 -------------------------- lib/utils/ipi/fdt_ipi.c | 22 ---------------------- lib/utils/ipi/fdt_ipi_drivers.carray | 3 --- lib/utils/ipi/fdt_ipi_mswi.c | 2 +- lib/utils/ipi/fdt_ipi_plicsw.c | 2 +- lib/utils/ipi/objects.mk | 7 ++----- platform/generic/platform.c | 5 ----- 7 files changed, 4 insertions(+), 63 deletions(-) delete mode 100644 include/sbi_utils/ipi/fdt_ipi.h delete mode 100644 lib/utils/ipi/fdt_ipi.c delete mode 100644 lib/utils/ipi/fdt_ipi_drivers.carray
include/sbi_utils/ipi/fdt_ipi.h deleted +0 -26
@@ -1,26 +0,0 @@ -/* -* SPDX-License-Identifier: BSD-2-Clause -* -* Copyright (c) 2020 Western Digital Corporation or its affiliates. -* -* Authors: -* Anup Patel <[email protected]> -*/ - -#ifndef __FDT_IPI_H__ -#define __FDT_IPI_H__ - -#include <sbi/sbi_types.h> -#include <sbi_utils/fdt/fdt_driver.h> - -#ifdef CONFIG_FDT_IPI - -int fdt_ipi_init (void ); - -#else - -static inline int fdt_ipi_init (void ) {return 0 ; } - -#endif - -#endif
lib/utils/ipi/fdt_ipi.c deleted +0 -22
@@ -1,22 +0,0 @@ -/* -* SPDX-License-Identifier: BSD-2-Clause -* -* Copyright (c) 2020 Western Digital Corporation or its affiliates. -* -* Authors: -* Anup Patel <[email protected]> -*/ - -#include <sbi_utils/ipi/fdt_ipi.h> - -/* List of FDT ipi drivers generated at compile time */ -extern const struct fdt_driver *const fdt_ipi_drivers[]; - -int fdt_ipi_init (void ) -{ -/* -* On some single-hart system there is no need for IPIs, -* so do not return a failure if no device is found. -*/ -return fdt_driver_init_all (fdt_get_address (), fdt_ipi_drivers); -}
lib/utils/ipi/fdt_ipi_drivers.carray deleted +0 -3
@@ -1,3 +0,0 @@ -HEADER: sbi_utils/ipi/fdt_ipi.h -TYPE: const struct fdt_driver -NAME: fdt_ipi_drivers
lib/utils/ipi/fdt_ipi_mswi.c +1 -1
@@ -9,8 +9,8 @@#include <sbi/sbi_error.h> #include <sbi/sbi_heap.h> +#include <sbi_utils/fdt/fdt_driver.h> #include <sbi_utils/fdt/fdt_helper.h> -#include <sbi_utils/ipi/fdt_ipi.h> #include <sbi_utils/ipi/aclint_mswi.h> static int ipi_mswi_cold_init(const void *fdt, int nodeoff,
lib/utils/ipi/fdt_ipi_plicsw.c +1 -1
@@ -11,8 +11,8 @@*/ #include <sbi/riscv_io.h> +#include <sbi_utils/fdt/fdt_driver.h> #include <sbi_utils/fdt/fdt_helper.h> -#include <sbi_utils/ipi/fdt_ipi.h> #include <sbi_utils/ipi/andes_plicsw.h> extern struct plicsw_data plicsw;
lib/utils/ipi/objects.mk +2 -5
@@ -10,11 +10,8 @@ libsbiutils-objs-$(CONFIG_IPI_MSWI) += ipi/aclint_mswi.o libsbiutils-objs-$(CONFIG_IPI_PLICSW) += ipi/andes_plicsw.o -libsbiutils-objs-$(CONFIG_FDT_IPI) += ipi/fdt_ipi.o -libsbiutils-objs-$(CONFIG_FDT_IPI) += ipi/fdt_ipi_drivers.carray.o - -carray-fdt_ipi_drivers-$(CONFIG_FDT_IPI_MSWI) += fdt_ipi_mswi +carray-fdt_early_drivers-$(CONFIG_FDT_IPI_MSWI) += fdt_ipi_mswi libsbiutils-objs-$(CONFIG_FDT_IPI_MSWI) += ipi/fdt_ipi_mswi.o -carray-fdt_ipi_drivers-$(CONFIG_FDT_IPI_PLICSW) += fdt_ipi_plicsw +carray-fdt_early_drivers-$(CONFIG_FDT_IPI_PLICSW) += fdt_ipi_plicsw libsbiutils-objs-$(CONFIG_FDT_IPI_PLICSW) += ipi/fdt_ipi_plicsw.o
platform/generic/platform.c +0 -5
@@ -22,7 +22,6 @@#include <sbi_utils/fdt/fdt_fixup.h> #include <sbi_utils/fdt/fdt_helper.h> #include <sbi_utils/fdt/fdt_pmu.h> -#include <sbi_utils/ipi/fdt_ipi.h> #include <sbi_utils/irqchip/fdt_irqchip.h> #include <sbi_utils/irqchip/imsic.h> #include <sbi_utils/mpxy/fdt_mpxy.h>
@@ -229,10 +228,6 @@ int generic_early_init(bool cold_boot)return rc;fdt_driver_init_all (fdt, fdt_early_drivers); - - rc =fdt_ipi_init (); -if (rc) -return rc; }return 0 ;
Signature · 7 lines
2.43.0 -- opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi
Re: [PATCH 3/3] lib: utils/ipi: Convert IPI drivers as early drivers
Quoted 4 lines · Anup Patel
The
fdt_ipi_init()is already called fromgeneric_early_init()so let's convert IPI drivers as early drivers.Signed-off-by Anup Patel <[email protected]>
Quoted 12 lines
--- include/sbi_utils/ipi/fdt_ipi.h | 26 -------------------------- lib/utils/ipi/fdt_ipi.c | 22 ---------------------- lib/utils/ipi/fdt_ipi_drivers.carray | 3 --- lib/utils/ipi/fdt_ipi_mswi.c | 2 +- lib/utils/ipi/fdt_ipi_plicsw.c | 2 +- lib/utils/ipi/objects.mk | 7 ++----- platform/generic/platform.c | 5 ----- 7 files changed, 4 insertions(+), 63 deletions(-) delete mode 100644 include/sbi_utils/ipi/fdt_ipi.h delete mode 100644 lib/utils/ipi/fdt_ipi.c delete mode 100644 lib/utils/ipi/fdt_ipi_drivers.carray
Signature · 3 lines
opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi