From patchwork Thu Jun 25 21:30:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saket Sinha X-Patchwork-Id: 488559 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id AFDCC1401B5 for ; Fri, 26 Jun 2015 07:30:13 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=WCyLzSJN; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1E5094B616; Thu, 25 Jun 2015 23:30:10 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bNfrQ4OxdnoN; Thu, 25 Jun 2015 23:30:09 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6D6954A033; Thu, 25 Jun 2015 23:30:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B888C4A033 for ; Thu, 25 Jun 2015 23:30:07 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UYoE2Xm6pVwP for ; Thu, 25 Jun 2015 23:30:07 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ob0-f173.google.com (mail-ob0-f173.google.com [209.85.214.173]) by theia.denx.de (Postfix) with ESMTPS id 507474A01C for ; Thu, 25 Jun 2015 23:30:03 +0200 (CEST) Received: by obbkm3 with SMTP id km3so55565906obb.1 for ; Thu, 25 Jun 2015 14:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=glAR7mZjDjDajoz9p5KIEn2WHC9TytSTGtM30MnMe2g=; b=WCyLzSJNsvvPAYEu/hDVS/tyImw4/yWW5k6k0EW9zW90il3WWtz1p+C55Xp3eijWBs 0RmGTw3AVv40CfHmASbs7mt1VT++5SNAZBJ4ZwGs6jhbGOHHF2Dk2TqE/jRyweYYvjVq ZTM+icqGeuI2ZP/sWfSYrjJ21C5R8el1duNmAWkNAo8hevBUsk7OL1EljvicPsxGIhRH oZ27sygsEDCFV80LRT6k2mx+8zs7joHG3rKi2CZMjuZ32umKlFYJRatx7S1IHlp5qrYq jIUibl9ZUFI3i1wwb9mQ+M29i37aObfx1vtgAhyOIGZZP42FGQ656XoVUD2zB9wwsToa 5VaQ== MIME-Version: 1.0 X-Received: by 10.202.187.138 with SMTP id l132mr39038069oif.31.1435267802248; Thu, 25 Jun 2015 14:30:02 -0700 (PDT) Received: by 10.202.205.130 with HTTP; Thu, 25 Jun 2015 14:30:02 -0700 (PDT) In-Reply-To: References: <1434507931-24798-1-git-send-email-saket.sinha89@gmail.com> Date: Fri, 26 Jun 2015 03:00:02 +0530 Message-ID: From: Saket Sinha To: Bin Meng , Simon Glass Cc: U-Boot Mailing List Subject: Re: [U-Boot] [PATCH v2] Initial support for ACPI Tables for qemu-x86 target. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Hi Bin, >>> + >>> +static int acpi_create_madt_lapic(struct acpi_madt_lapic *lapic, u8 cpu, u8 apic) >>> +{ >>> + lapic->type = 0; /* Local APIC structure */ >>> + lapic->length = sizeof(struct acpi_madt_lapic); >>> + lapic->flags = (1 << 0); /* Processor/LAPIC enabled */ >>> + lapic->processor_id = cpu; >>> + lapic->apic_id = apic; >>> + >>> + return lapic->length; >>> +} >>> + >>> +static unsigned long acpi_create_madt_lapics(unsigned long current) >>> +{ >>> + struct udevice *dev; >>> + >>> + for (uclass_find_first_device(UCLASS_CPU, &dev); >>> + dev; >>> + uclass_find_next_device(&dev)) { >>> + struct cpu_platdata *plat = dev_get_parent_platdata(dev); >>> + >>> + current += acpi_create_madt_lapic((struct acpi_madt_lapic *)current, plat->cpu_id, plat->cpu_id); >> >> The processor id (2nd parameter) is not equal to lapic id. Per the >> ACPI spec, it should match the ProcessorID in the ASL file, format >> below. >> >> Processor (ProcessorName, ProcessorID, PBlockAddress, PblockLength) {ObjectList} >> > > Thanks for bringing this to my notice. > In my boot up logs, I am getting "ACPI: No LAPIC entries present". > This might be the reason for that. > As per our previous discussion, I reported an error in bringing up u-boot for qemu - " Cannot find uclass for id 10: please add the UCLASS_DRIVER() declaration for this UCLASS_... id" You told me that this is because QEMU has not been converted to use dm cpu driver. If this issue is resolved, and thus UCLASS_CPU would be available for qemu, the patch below would fix the lapic error. } return current; } Regards, Saket Sinha diff --git a/arch/x86/cpu/qemu/acpi_table.c b/arch/x86/cpu/qemu/acpi_table.c index cefd5f4..f055646 100644 --- a/arch/x86/cpu/qemu/acpi_table.c +++ b/arch/x86/cpu/qemu/acpi_table.c @@ -98,13 +98,15 @@ static int acpi_create_madt_lapic(struct acpi_madt_lapic *lapic, u8 cpu, u8 apic static unsigned long acpi_create_madt_lapics(unsigned long current) { struct udevice *dev; + int index = 0; for (uclass_find_first_device(UCLASS_CPU, &dev); dev; uclass_find_next_device(&dev)) { struct cpu_platdata *plat = dev_get_parent_platdata(dev); - current += acpi_create_madt_lapic((struct acpi_madt_lapic *)current, plat->cpu_id, plat->cpu_id); + current += acpi_create_madt_lapic((struct acpi_madt_lapic *)current, index, plat->cpu_id); + index++;