diff mbox series

[v2,3/3] riscv: obtain SMBIOS entry from FFI.

Message ID 20230702095735.860-3-cuiyunhui@bytedance.com
State New
Headers show
Series [v2,1/3] riscv: obtain ACPI RSDP from FFI. | expand

Commit Message

yunhui cui July 2, 2023, 9:57 a.m. UTC
When we bringup with coreboot on riscv, we need to obtain
the entry address of SMBIOS through the FFI scheme.

Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
---
 arch/riscv/kernel/ffi.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Conor Dooley July 2, 2023, 12:42 p.m. UTC | #1
Hey,

On Sun, Jul 02, 2023 at 05:57:34PM +0800, Yunhui Cui wrote:
> When we bringup with coreboot on riscv, we need to obtain
> the entry address of SMBIOS through the FFI scheme.

What do you need it for?

> 
> Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
> ---
>  arch/riscv/kernel/ffi.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/riscv/kernel/ffi.c b/arch/riscv/kernel/ffi.c
> index c5ac2b5d9148..c44f943a1cb5 100644
> --- a/arch/riscv/kernel/ffi.c
> +++ b/arch/riscv/kernel/ffi.c
> @@ -8,6 +8,7 @@
>  #include <linux/of.h>
>  #include <linux/of_fdt.h>
>  #include <linux/libfdt.h>
> +#include <linux/ffi.h>
>  
>  u64 acpi_rsdp;
>  
> @@ -34,4 +35,7 @@ void __init ffi_acpi_root_pointer(void)
>  void __init ffi_init(void)
>  {
>  	ffi_acpi_root_pointer();
> +#if CONFIG_FDT_FW_INTERFACE
> +	ffi_smbios_root_pointer();
> +#endif

Please stub this function so that we don't need ifdeffery here.

Cheers,
Conor.
yunhui cui July 3, 2023, 7:50 a.m. UTC | #2
Hi Conor,

On Sun, Jul 2, 2023 at 8:42 PM Conor Dooley <conor@kernel.org> wrote:
>
> Hey,
>
> On Sun, Jul 02, 2023 at 05:57:34PM +0800, Yunhui Cui wrote:
> > When we bringup with coreboot on riscv, we need to obtain
> > the entry address of SMBIOS through the FFI scheme.
>
> What do you need it for?
RISC-V will be server-oriented, and the system needs to be managed
based on SMBIOS.



> >
> > @@ -34,4 +35,7 @@ void __init ffi_acpi_root_pointer(void)
> >  void __init ffi_init(void)
> >  {
> >       ffi_acpi_root_pointer();
> > +#if CONFIG_FDT_FW_INTERFACE
> > +     ffi_smbios_root_pointer();
> > +#endif
>
> Please stub this function so that we don't need ifdeffery here.
OK, I will update it on V3.

Thanks,
Yunhui
Conor Dooley July 3, 2023, 8:16 a.m. UTC | #3
On Mon, Jul 03, 2023 at 03:50:57PM +0800, 运辉崔 wrote:
> On Sun, Jul 2, 2023 at 8:42 PM Conor Dooley <conor@kernel.org> wrote:
> >
> > Hey,
> >
> > On Sun, Jul 02, 2023 at 05:57:34PM +0800, Yunhui Cui wrote:
> > > When we bringup with coreboot on riscv, we need to obtain
> > > the entry address of SMBIOS through the FFI scheme.
> >
> > What do you need it for?
> RISC-V will be server-oriented, and the system needs to be managed
> based on SMBIOS.

Really what this commit message is missing is something that explains
why you need the FFI scheme. Say along the lines of:

	Coreboot on RISC-V does not support EFI, and needs to use the
	FDT Firmware Interface (FFI) to pass the entry address of SMBIOS
	to the kernel.

Cheers,
Conor.
diff mbox series

Patch

diff --git a/arch/riscv/kernel/ffi.c b/arch/riscv/kernel/ffi.c
index c5ac2b5d9148..c44f943a1cb5 100644
--- a/arch/riscv/kernel/ffi.c
+++ b/arch/riscv/kernel/ffi.c
@@ -8,6 +8,7 @@ 
 #include <linux/of.h>
 #include <linux/of_fdt.h>
 #include <linux/libfdt.h>
+#include <linux/ffi.h>
 
 u64 acpi_rsdp;
 
@@ -34,4 +35,7 @@  void __init ffi_acpi_root_pointer(void)
 void __init ffi_init(void)
 {
 	ffi_acpi_root_pointer();
+#if CONFIG_FDT_FW_INTERFACE
+	ffi_smbios_root_pointer();
+#endif
 }