
Hi Saket,
On Thu, Jun 25, 2015 at 3:38 AM, Saket Sinha saket.sinha89@gmail.com wrote:
Hi Simon,
Please find my comments inline -
[snip]
+static unsigned long acpi_fill_mcfg(unsigned long current) +{
pci_dev_t qemu_dev;
struct pci_device_id qemu_id[] = { { 0x8086, 0x29c0 } };
u32 reg;
qemu_dev = pci_find_devices(qemu_id, 0);
if (!qemu_dev)
return current;
reg = pci_read_config_dword(qemu_dev, 0x60, ®);
if ((reg & 0x07) != 0x01) // require enabled + 256MB size
return current;
current += acpi_create_mcfg_mmconfig((struct acpi_mcfg_mmconfig *) current,
reg & 0xf0000000, 0x0, 0x0, 255);
We need actually programming the chipset to enable the ECAM. This needs to be done in the arch/x86/cpu/qemu/qemu.c.
Would be needing your guidance for this. Would need some info about qemu working and ECAM's role.
ECAM is PCIe enhanced configuration access mechanism. QEMU i440FX is a PCI chipset, which does not support ECAM. For QEMU Q35 which supports PCIe, you need check the Q35 chipset. I just checked that, it's on D0:F0:R60h a register called PCIEXBAR. You need hook U-Boot's PCI configuration RW routines to actually use ECAM to verify it is really working.
[snip]
+static 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);
memset((void *) fadt, 0, sizeof(struct acpi_fadt));
memcpy(header->signature, "FACP", 4);
header->length = sizeof(struct acpi_fadt);
header->revision = 3;
memcpy(header->oem_id, OEM_ID, 6);
memcpy(header->oem_table_id, ACPI_TABLE_CREATOR, 8);
memcpy(header->asl_compiler_id, ASLC, 4);
header->asl_compiler_revision = 0;
We should use this field to indicate which compiler we used to compile the ASL. Could be Intel (INTL) or Microsoft (MSFT). We also need put the compiler version into header->asl_compiler_revision. You will need get the compiler version generated by some shell scripts automatically. Note we should only put ASL compiler id/rev when it comes to definition block. For others, we still need to use creator id and revision.
Details of the compiler I am using can be found below -
Intel ACPI Component Architecture ASL+ Optimizing Compiler version 20141107-64 [Dec 17 2014] Copyright (c) 2000 - 2014 Intel Corporation
I am not sure about the id but the revision number 20141107-64 cab be parsed.
The id should be "INTL" for Intel compiler and "MSFT" for Microsoft compiler.
[snip]
Regards, Bin