mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-06-12 22:31:45 +01:00
platform: generic: Optimize extensions_init() to parse ISA extensions once
Instead of parsing ISA extensions separately for each hart in the generic_extensions_init() function, it is better to parse ISA extensions for all available harts in the cold boot path. Also, this allows us to remove fdt_isa_bitmap from scratch space and directly initialize "extensions" in struct sbi_hart_features for each hart. Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260521082625.1520870-3-anup.patel@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -55,7 +55,6 @@
|
||||
struct sbi_domain_memregion;
|
||||
struct sbi_ecall_return;
|
||||
struct sbi_trap_regs;
|
||||
struct sbi_hart_features;
|
||||
union sbi_ldst_data;
|
||||
|
||||
/** Possible feature flags of a platform */
|
||||
@@ -105,7 +104,7 @@ struct sbi_platform_operations {
|
||||
int (*misa_get_xlen)(void);
|
||||
|
||||
/** Initialize (or populate) HART extensions for the platform */
|
||||
int (*extensions_init)(struct sbi_hart_features *hfeatures);
|
||||
int (*extensions_init)(bool cold_boot);
|
||||
|
||||
/** Initialize (or populate) domains for the platform */
|
||||
int (*domains_init)(void);
|
||||
@@ -486,10 +485,10 @@ static inline int sbi_platform_misa_xlen(const struct sbi_platform *plat)
|
||||
*/
|
||||
static inline int sbi_platform_extensions_init(
|
||||
const struct sbi_platform *plat,
|
||||
struct sbi_hart_features *hfeatures)
|
||||
bool cold_boot)
|
||||
{
|
||||
if (plat && sbi_platform_ops(plat)->extensions_init)
|
||||
return sbi_platform_ops(plat)->extensions_init(hfeatures);
|
||||
return sbi_platform_ops(plat)->extensions_init(cold_boot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,8 +54,7 @@ int fdt_parse_cbom_block_size(const void *fdt, int cpu_offset, unsigned long *c
|
||||
|
||||
int fdt_parse_timebase_frequency(const void *fdt, unsigned long *freq);
|
||||
|
||||
int fdt_parse_isa_extensions(const void *fdt, unsigned int hartid,
|
||||
unsigned long *extensions);
|
||||
int fdt_parse_isa_extensions_all_harts(const void *fdt);
|
||||
|
||||
int fdt_parse_gaisler_uart_node(const void *fdt, int nodeoffset,
|
||||
struct platform_uart_data *uart);
|
||||
|
||||
Reference in New Issue
Block a user