[PATCH] acpi: move acpi_get_rsdp_addr() to acpi/acpi_table.h

Function acpi_get_rsdp_addr() is needed on all architectures which write ACPI tables. Move the definition from the x86 include to an architecture independent one.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com --- arch/x86/include/asm/acpi_table.h | 9 --------- drivers/misc/qfw.c | 1 + include/acpi/acpi_table.h | 9 +++++++++ 3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/arch/x86/include/asm/acpi_table.h b/arch/x86/include/asm/acpi_table.h index 226753b65d..57e41654ce 100644 --- a/arch/x86/include/asm/acpi_table.h +++ b/arch/x86/include/asm/acpi_table.h @@ -64,15 +64,6 @@ int acpi_write_dbg2_pci_uart(struct acpi_ctx *ctx, struct udevice *dev, */ int acpi_create_gnvs(struct acpi_global_nvs *gnvs);
-/** - * acpi_get_rsdp_addr() - get ACPI RSDP table address - * - * This routine returns the ACPI RSDP table address in the system memory. - * - * @return: ACPI RSDP table address - */ -ulong acpi_get_rsdp_addr(void); - /** * arch_read_sci_irq_select() - Read the system-control interrupt number * diff --git a/drivers/misc/qfw.c b/drivers/misc/qfw.c index 7c01bf23d5..e3b6b4cd74 100644 --- a/drivers/misc/qfw.c +++ b/drivers/misc/qfw.c @@ -7,6 +7,7 @@ #define LOG_CATEGORY UCLASS_QFW
#include <common.h> +#include <acpi/acpi_table.h> #include <bootdev.h> #include <bootflow.h> #include <bootmeth.h> diff --git a/include/acpi/acpi_table.h b/include/acpi/acpi_table.h index 1f85de091d..a3b67259e6 100644 --- a/include/acpi/acpi_table.h +++ b/include/acpi/acpi_table.h @@ -920,6 +920,15 @@ void acpi_fill_header(struct acpi_table_header *header, char *signature); */ int acpi_fill_csrt(struct acpi_ctx *ctx);
+/** + * acpi_get_rsdp_addr() - get ACPI RSDP table address + * + * This routine returns the ACPI RSDP table address in the system memory. + * + * @return: ACPI RSDP table address + */ +ulong acpi_get_rsdp_addr(void); + /** * write_acpi_tables() - Write out the ACPI tables *

On Thu, Nov 09, 2023 at 09:23:02AM -0800, Heinrich Schuchardt wrote:
Function acpi_get_rsdp_addr() is needed on all architectures which write ACPI tables. Move the definition from the x86 include to an architecture independent one.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
arch/x86/include/asm/acpi_table.h | 9 --------- drivers/misc/qfw.c | 1 + include/acpi/acpi_table.h | 9 +++++++++ 3 files changed, 10 insertions(+), 9 deletions(-)
My question here is, does this work right on non-x86? I know you can have ACPI without UEFI on x86, but elsewhere doesn't the location have to be provided in some manner by UEFI? I know I'm thinking that's the case with SMBIOS (with a few exception).
I'm assuming you're doing something here with qemu and its qfw interface and risc-v.

On 11/9/23 11:24, Tom Rini wrote:
On Thu, Nov 09, 2023 at 09:23:02AM -0800, Heinrich Schuchardt wrote:
Function acpi_get_rsdp_addr() is needed on all architectures which write ACPI tables. Move the definition from the x86 include to an architecture independent one.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
arch/x86/include/asm/acpi_table.h | 9 --------- drivers/misc/qfw.c | 1 + include/acpi/acpi_table.h | 9 +++++++++ 3 files changed, 10 insertions(+), 9 deletions(-)
My question here is, does this work right on non-x86? I know you can have ACPI without UEFI on x86, but elsewhere doesn't the location have to be provided in some manner by UEFI? I know I'm thinking that's the case with SMBIOS (with a few exception).
I'm assuming you're doing something here with qemu and its qfw interface and risc-v.
Hello Tom,
yes, I want to enable ACPI passthrough on QEMU RISC-V. There will be more patches needed. But the current change seemed obvious looking at the code so I did not want to pile up more patches first.
Do you know what the status of ACPI passthrough is on ARM?
Best regards
Heinrich

On Thu, Nov 09, 2023 at 12:28:26PM -0800, Heinrich Schuchardt wrote:
On 11/9/23 11:24, Tom Rini wrote:
On Thu, Nov 09, 2023 at 09:23:02AM -0800, Heinrich Schuchardt wrote:
Function acpi_get_rsdp_addr() is needed on all architectures which write ACPI tables. Move the definition from the x86 include to an architecture independent one.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
arch/x86/include/asm/acpi_table.h | 9 --------- drivers/misc/qfw.c | 1 + include/acpi/acpi_table.h | 9 +++++++++ 3 files changed, 10 insertions(+), 9 deletions(-)
My question here is, does this work right on non-x86? I know you can have ACPI without UEFI on x86, but elsewhere doesn't the location have to be provided in some manner by UEFI? I know I'm thinking that's the case with SMBIOS (with a few exception).
I'm assuming you're doing something here with qemu and its qfw interface and risc-v.
Hello Tom,
yes, I want to enable ACPI passthrough on QEMU RISC-V. There will be more patches needed. But the current change seemed obvious looking at the code so I did not want to pile up more patches first.
Do you know what the status of ACPI passthrough is on ARM?
On U-Boot? No. I know a while back I asked Simon to, and he did some hacking such that on a Raspberry Pi you could do UEFI boot and pass through some ACPI tables and it was somewhat functional (which was I think an issue with the ACPI tables as much as anything else). And I mentioned to some Linaro/EBBR people that it was because in part I don't object to U-Boot being able to do SystemReady ES level support either (and to be clear, I don't mean instead of, or preferred over IR, just that ES mandates ACPI and if we can pass it through .... and yes, there's more to it than that, I know).
And yeah, I see now I had mis-interpreted the "rsdp" portion of the function name.
Reviewed-by: Tom Rini trini@konsulko.com

Hi Tom, Heinrich,
On Thu, 9 Nov 2023 at 13:42, Tom Rini trini@konsulko.com wrote:
On Thu, Nov 09, 2023 at 12:28:26PM -0800, Heinrich Schuchardt wrote:
On 11/9/23 11:24, Tom Rini wrote:
On Thu, Nov 09, 2023 at 09:23:02AM -0800, Heinrich Schuchardt wrote:
Function acpi_get_rsdp_addr() is needed on all architectures which write ACPI tables. Move the definition from the x86 include to an architecture independent one.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
arch/x86/include/asm/acpi_table.h | 9 --------- drivers/misc/qfw.c | 1 + include/acpi/acpi_table.h | 9 +++++++++ 3 files changed, 10 insertions(+), 9 deletions(-)
My question here is, does this work right on non-x86? I know you can have ACPI without UEFI on x86, but elsewhere doesn't the location have to be provided in some manner by UEFI? I know I'm thinking that's the case with SMBIOS (with a few exception).
I'm assuming you're doing something here with qemu and its qfw interface and risc-v.
Hello Tom,
yes, I want to enable ACPI passthrough on QEMU RISC-V. There will be more patches needed. But the current change seemed obvious looking at the code so I did not want to pile up more patches first.
Do you know what the status of ACPI passthrough is on ARM?
On U-Boot? No. I know a while back I asked Simon to, and he did some hacking such that on a Raspberry Pi you could do UEFI boot and pass through some ACPI tables and it was somewhat functional (which was I think an issue with the ACPI tables as much as anything else). And I
Yes it worked OK, at least to a point. See [1]
mentioned to some Linaro/EBBR people that it was because in part I don't object to U-Boot being able to do SystemReady ES level support either (and to be clear, I don't mean instead of, or preferred over IR, just that ES mandates ACPI and if we can pass it through .... and yes, there's more to it than that, I know).
This is what U-Boot does now when booted from coreboot. So it should be fairly easy to arrange.
There is a blockage in Linux re booting with ACPI but without EFI, though. I suppose it doesn't affect U-Boot right now since it can boot with EFI, but it is causing problems with other projects.
And yeah, I see now I had mis-interpreted the "rsdp" portion of the function name.
Reviewed-by: Tom Rini trini@konsulko.com
-- Tom
[1] https://patchwork.ozlabs.org/project/uboot/list/?series=274675&state=*

Hi Tom, Heinrich,
On Thu, 9 Nov 2023 at 13:42, Tom Rini trini@konsulko.com wrote:
On Thu, Nov 09, 2023 at 12:28:26PM -0800, Heinrich Schuchardt wrote:
On 11/9/23 11:24, Tom Rini wrote:
On Thu, Nov 09, 2023 at 09:23:02AM -0800, Heinrich Schuchardt wrote:
Function acpi_get_rsdp_addr() is needed on all architectures which write ACPI tables. Move the definition from the x86 include to an architecture independent one.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
arch/x86/include/asm/acpi_table.h | 9 --------- drivers/misc/qfw.c | 1 + include/acpi/acpi_table.h | 9 +++++++++ 3 files changed, 10 insertions(+), 9 deletions(-)
My question here is, does this work right on non-x86? I know you can have ACPI without UEFI on x86, but elsewhere doesn't the location have to be provided in some manner by UEFI? I know I'm thinking that's the case with SMBIOS (with a few exception).
I'm assuming you're doing something here with qemu and its qfw interface and risc-v.
Hello Tom,
yes, I want to enable ACPI passthrough on QEMU RISC-V. There will be more patches needed. But the current change seemed obvious looking at the code so I did not want to pile up more patches first.
Do you know what the status of ACPI passthrough is on ARM?
On U-Boot? No. I know a while back I asked Simon to, and he did some hacking such that on a Raspberry Pi you could do UEFI boot and pass through some ACPI tables and it was somewhat functional (which was I think an issue with the ACPI tables as much as anything else). And I
Yes it worked OK, at least to a point. See [1]
mentioned to some Linaro/EBBR people that it was because in part I don't object to U-Boot being able to do SystemReady ES level support either (and to be clear, I don't mean instead of, or preferred over IR, just that ES mandates ACPI and if we can pass it through .... and yes, there's more to it than that, I know).
This is what U-Boot does now when booted from coreboot. So it should be fairly easy to arrange.
There is a blockage in Linux re booting with ACPI but without EFI, though. I suppose it doesn't affect U-Boot right now since it can boot with EFI, but it is causing problems with other projects.
And yeah, I see now I had mis-interpreted the "rsdp" portion of the function name.
Reviewed-by: Tom Rini trini@konsulko.com
-- Tom
[1] https://patchwork.ozlabs.org/project/uboot/list/?series=274675&state=*
Applied to u-boot-dm/next, thanks!

On Thu, 9 Nov 2023 at 10:23, Heinrich Schuchardt heinrich.schuchardt@canonical.com wrote:
Function acpi_get_rsdp_addr() is needed on all architectures which write ACPI tables. Move the definition from the x86 include to an architecture independent one.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
arch/x86/include/asm/acpi_table.h | 9 --------- drivers/misc/qfw.c | 1 + include/acpi/acpi_table.h | 9 +++++++++ 3 files changed, 10 insertions(+), 9 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
participants (3)
-
Heinrich Schuchardt
-
Simon Glass
-
Tom Rini