[U-Boot] [UBOOT PATCH v5 2/3] x86: Add ACPI table support to QEMU

Bin Meng bmeng.cn at gmail.com
Fri Aug 21 06:31:47 CEST 2015


Hi Saket,

On Fri, Aug 21, 2015 at 12:24 PM, Saket Sinha <saket.sinha89 at gmail.com> wrote:
> Hi Bin,
>
> Please find my response inline.
>
>
>
> On Tue, Aug 18, 2015 at 12:36 PM, Bin Meng <bmeng.cn at gmail.com> wrote:
>> Hi Saket,
>>
>> On Tue, Aug 18, 2015 at 3:29 AM, Saket Sinha <saket.sinha89 at gmail.com> wrote:
>>> This patch mainly adds ACPI support to QEMU.
>>> Verified by booting Linux kernel on QEMU i440FX and Q35.
>>>
>>> Signed-off-by: Saket Sinha <saket.sinha89 at gmail.com>
>>> ---
>>>
>>>  arch/x86/cpu/qemu/Makefile |   1 +
>>>  arch/x86/cpu/qemu/acpi.c   | 179 +++++++++++++++++++++++++++++++++++++++++++++
>>>  2 files changed, 180 insertions(+)
>>>  create mode 100644 arch/x86/cpu/qemu/acpi.c
>>>
>>> diff --git a/arch/x86/cpu/qemu/Makefile b/arch/x86/cpu/qemu/Makefile
>>> index 9a66b16..8c3884c 100644
>>> --- a/arch/x86/cpu/qemu/Makefile
>>> +++ b/arch/x86/cpu/qemu/Makefile
>>> @@ -8,4 +8,5 @@ ifndef CONFIG_EFI_STUB
>>>  obj-y += car.o dram.o
>>>  endif
>>>  obj-y += qemu.o
>>> +obj-$(CONFIG_GENERATE_ACPI_TABLE) += acpi.o
>>>  obj-$(CONFIG_PCI) += pci.o
>>> diff --git a/arch/x86/cpu/qemu/acpi.c b/arch/x86/cpu/qemu/acpi.c
>>> new file mode 100644
>>> index 0000000..7c981d0
>>> --- /dev/null
>>> +++ b/arch/x86/cpu/qemu/acpi.c
>>> @@ -0,0 +1,179 @@
>>> +/*
>>> + * Copyright (C) 2015, Saket Sinha <saket.sinha89 at gmail.com>
>>> + *
>>> + * SPDX-License-Identifier:   GPL-2.0+
>>> + */
>>> +
>>> +#include <common.h>
>>> +#include <asm/acpi_table.h>
>>> +#include <asm/ioapic.h>
>>> +#include <asm/tables.h>
>>> +
>>> +void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs,
>>> +               void *dsdt)
>>> +{
>>> +       acpi_header_t *header = &(fadt->header);
>>> +       u16 pmbase;
>>> +
>>> +       pci_dev_t bdf = PCI_BDF(0, 0x1f, 0);
>>> +       pci_read_config_word(bdf, 0x40, &pmbase);
>>> +
>>> +     /*
>>> +        * TODO(saket.sinha89 at gmail.com): wrong value
>>> +        * of pmbase by above function. Harcoding it to
>>> +        * correct value. Since no PCI register is
>>> +        * programmed Power Management Interface is
>>> +        * not working
>>> +        */
>>
>> Given you already know the root cause here (PMBASE is not programmed),
>> can you program this register in the QEMU codes to make it work?
>
> Please elaborate on this. Do you want me to hack QEMU code to verify
> that it works ?
>

Based on your TODO comment, you already found the root cause, right?
Then why don't you support that? Yes, please add QEMU code to program
that register.

>> you can check arch/x86/cpu/quark/Kconfig to use common names for these
>> ACPI register blocks, like the one used in quark. (I remember I
>> mentioned this comment before)
>>
>
> This is not clear. I know these registers are defined in
> arch/x86/cpu/quark/Kconfig where configurable values can be assigned
> to it.
> But here I am trying to create fadt table structure which have these
> registers for sure but I am trying to fill those values after reading
> them from the hardware( in our case QEMU)

I mean you can use generic macro names (which is the common names for
all x86 boards), and if x86 boards support ACPI, it needs to use that
macro to program its registers. And in your common codes, you don't
need care which register it is on that specific platform, like
CONFIG_PCIE_ECAM_BASE does.

[snip]

Regards,
Bin


More information about the U-Boot mailing list