* [PATCH 1/1] efi_loader: architecture specific UEFI setup
@ 2020-02-01 16:54 Heinrich Schuchardt
2020-02-05 0:28 ` Atish Patra
0 siblings, 1 reply; 3+ messages in thread
From: Heinrich Schuchardt @ 2020-02-01 16:54 UTC (permalink / raw)
To: u-boot
RISC-V patches are developed for OpenSBI and Linux to replace random boot
by sequential CPU bring-up.
In this scenario the id of the active hart has to be passed from boot stage
to boot stage. Using a UEFI variable would provide an easy implementation.
This patch provides a weak function that is called at the end of the setup
of the UEFI sub-system. This patch can be used to create architecture
specific UEFI variables or configuration tables.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
include/efi_loader.h | 3 +++
lib/efi_loader/efi_setup.c | 16 ++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/include/efi_loader.h b/include/efi_loader.h
index d4c59b54c4..d87de85e83 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -116,6 +116,9 @@ extern efi_uintn_t efi_memory_map_key;
extern struct efi_runtime_services efi_runtime_services;
extern struct efi_system_table systab;
+/* Architecture specific initialization of the UEFI system */
+efi_status_t efi_setup_arch_specific(void);
+
extern struct efi_simple_text_output_protocol efi_con_out;
extern struct efi_simple_text_input_protocol efi_con_in;
extern struct efi_console_control_protocol efi_console_control;
diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
index de7b616c6d..8469f0f43c 100644
--- a/lib/efi_loader/efi_setup.c
+++ b/lib/efi_loader/efi_setup.c
@@ -22,6 +22,17 @@ void __weak allow_unaligned(void)
{
}
+/**
+ * efi_setup_arch_specific() - architecture specific UEFI setup
+ *
+ * This routine can be used to define architecture specific variables
+ * or configuration tables, e.g. HART id for RISC-V
+ */
+efi_status_t __weak efi_setup_arch_specific(void)
+{
+ return EFI_SUCCESS;
+}
+
/**
* efi_init_platform_lang() - define supported languages
*
@@ -179,6 +190,11 @@ efi_status_t efi_init_obj_list(void)
if (ret != EFI_SUCCESS)
goto out;
+ /* Architecture specific setup */
+ ret = efi_setup_arch_specific();
+ if (ret != EFI_SUCCESS)
+ goto out;
+
out:
efi_obj_list_initialized = ret;
return ret;
--
2.24.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 1/1] efi_loader: architecture specific UEFI setup
2020-02-01 16:54 [PATCH 1/1] efi_loader: architecture specific UEFI setup Heinrich Schuchardt
@ 2020-02-05 0:28 ` Atish Patra
2020-02-05 5:57 ` Heinrich Schuchardt
0 siblings, 1 reply; 3+ messages in thread
From: Atish Patra @ 2020-02-05 0:28 UTC (permalink / raw)
To: u-boot
On Sat, Feb 1, 2020 at 8:55 AM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> RISC-V patches are developed for OpenSBI and Linux to replace random boot
> by sequential CPU bring-up.
>
> In this scenario the id of the active hart has to be passed from boot stage
> to boot stage. Using a UEFI variable would provide an easy implementation.
>
> This patch provides a weak function that is called at the end of the setup
> of the UEFI sub-system. This patch can be used to create architecture
> specific UEFI variables or configuration tables.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> include/efi_loader.h | 3 +++
> lib/efi_loader/efi_setup.c | 16 ++++++++++++++++
> 2 files changed, 19 insertions(+)
>
> diff --git a/include/efi_loader.h b/include/efi_loader.h
> index d4c59b54c4..d87de85e83 100644
> --- a/include/efi_loader.h
> +++ b/include/efi_loader.h
> @@ -116,6 +116,9 @@ extern efi_uintn_t efi_memory_map_key;
> extern struct efi_runtime_services efi_runtime_services;
> extern struct efi_system_table systab;
>
> +/* Architecture specific initialization of the UEFI system */
> +efi_status_t efi_setup_arch_specific(void);
> +
> extern struct efi_simple_text_output_protocol efi_con_out;
> extern struct efi_simple_text_input_protocol efi_con_in;
> extern struct efi_console_control_protocol efi_console_control;
> diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
> index de7b616c6d..8469f0f43c 100644
> --- a/lib/efi_loader/efi_setup.c
> +++ b/lib/efi_loader/efi_setup.c
> @@ -22,6 +22,17 @@ void __weak allow_unaligned(void)
> {
> }
>
> +/**
> + * efi_setup_arch_specific() - architecture specific UEFI setup
> + *
> + * This routine can be used to define architecture specific variables
> + * or configuration tables, e.g. HART id for RISC-V
> + */
> +efi_status_t __weak efi_setup_arch_specific(void)
> +{
> + return EFI_SUCCESS;
> +}
> +
> /**
> * efi_init_platform_lang() - define supported languages
> *
> @@ -179,6 +190,11 @@ efi_status_t efi_init_obj_list(void)
> if (ret != EFI_SUCCESS)
> goto out;
>
> + /* Architecture specific setup */
> + ret = efi_setup_arch_specific();
> + if (ret != EFI_SUCCESS)
> + goto out;
> +
> out:
> efi_obj_list_initialized = ret;
> return ret;
> --
> 2.24.1
>
Thanks for the quick patch. Looks good to me.
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Do you mind if I include this in my RISC-V specific patch and send it along with
EFI stub linux kernel patches so that all of them can be tested together.
--
Regards,
Atish
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] efi_loader: architecture specific UEFI setup
2020-02-05 0:28 ` Atish Patra
@ 2020-02-05 5:57 ` Heinrich Schuchardt
0 siblings, 0 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2020-02-05 5:57 UTC (permalink / raw)
To: u-boot
On 2/5/20 1:28 AM, Atish Patra wrote:
> On Sat, Feb 1, 2020 at 8:55 AM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>>
>> RISC-V patches are developed for OpenSBI and Linux to replace random boot
>> by sequential CPU bring-up.
>>
>> In this scenario the id of the active hart has to be passed from boot stage
>> to boot stage. Using a UEFI variable would provide an easy implementation.
>>
>> This patch provides a weak function that is called at the end of the setup
>> of the UEFI sub-system. This patch can be used to create architecture
>> specific UEFI variables or configuration tables.
>>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>> include/efi_loader.h | 3 +++
>> lib/efi_loader/efi_setup.c | 16 ++++++++++++++++
>> 2 files changed, 19 insertions(+)
>>
>> diff --git a/include/efi_loader.h b/include/efi_loader.h
>> index d4c59b54c4..d87de85e83 100644
>> --- a/include/efi_loader.h
>> +++ b/include/efi_loader.h
>> @@ -116,6 +116,9 @@ extern efi_uintn_t efi_memory_map_key;
>> extern struct efi_runtime_services efi_runtime_services;
>> extern struct efi_system_table systab;
>>
>> +/* Architecture specific initialization of the UEFI system */
>> +efi_status_t efi_setup_arch_specific(void);
>> +
>> extern struct efi_simple_text_output_protocol efi_con_out;
>> extern struct efi_simple_text_input_protocol efi_con_in;
>> extern struct efi_console_control_protocol efi_console_control;
>> diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
>> index de7b616c6d..8469f0f43c 100644
>> --- a/lib/efi_loader/efi_setup.c
>> +++ b/lib/efi_loader/efi_setup.c
>> @@ -22,6 +22,17 @@ void __weak allow_unaligned(void)
>> {
>> }
>>
>> +/**
>> + * efi_setup_arch_specific() - architecture specific UEFI setup
>> + *
>> + * This routine can be used to define architecture specific variables
>> + * or configuration tables, e.g. HART id for RISC-V
>> + */
>> +efi_status_t __weak efi_setup_arch_specific(void)
>> +{
>> + return EFI_SUCCESS;
>> +}
>> +
>> /**
>> * efi_init_platform_lang() - define supported languages
>> *
>> @@ -179,6 +190,11 @@ efi_status_t efi_init_obj_list(void)
>> if (ret != EFI_SUCCESS)
>> goto out;
>>
>> + /* Architecture specific setup */
>> + ret = efi_setup_arch_specific();
>> + if (ret != EFI_SUCCESS)
>> + goto out;
>> +
>> out:
>> efi_obj_list_initialized = ret;
>> return ret;
>> --
>> 2.24.1
>>
>
> Thanks for the quick patch. Looks good to me.
> Reviewed-by: Atish Patra <atish.patra@wdc.com>
>
> Do you mind if I include this in my RISC-V specific patch and send it along with
> EFI stub linux kernel patches so that all of them can be tested together.
>
I will create a pull request today so that Tom can merge this patch
before the RISC-V specific ones.
Best regards
Heinrich
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-02-05 5:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-01 16:54 [PATCH 1/1] efi_loader: architecture specific UEFI setup Heinrich Schuchardt
2020-02-05 0:28 ` Atish Patra
2020-02-05 5:57 ` Heinrich Schuchardt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.