From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::244; helo=mail-it0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6414A210F2001 for ; Fri, 15 Jun 2018 06:05:06 -0700 (PDT) Received: by mail-it0-x244.google.com with SMTP id a195-v6so2545982itd.3 for ; Fri, 15 Jun 2018 06:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1qLAthqCBmieoGzZ4SwXG/EOrpw3VYP4DVRto/7wB88=; b=MRdTnAmaMXK16QfHgeed2w0m39P2IEn5fInhRNYQe9cO1ZzWiwHN2MpBPvo+UWbtmV dnev9jLaOY8cGStoY+D5R/zgRc5UDOiBNYW3+v1WcLYrPxlqsrM5yfggt2X9VKW4Q1rg VVqz1Q2m6UUPtw6dTGveG9QEsGNsrRfUgKsrk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1qLAthqCBmieoGzZ4SwXG/EOrpw3VYP4DVRto/7wB88=; b=Q8moU1u26HnhbdwKbpFJykto1rDobS/sbrNzpH0oh+XOgplMQqhm0uQduE4CWQMelM 66Si2xa3tyL7p+fUMtYnXH6lQw1wTOPOsSGAlAoQg/GF333L3DB70jT9TImqu+mAcY+H +lDr7ivrIA089oKAJ+WTaCEcu2nbe07Lx6vwELKaXTydl2ohNir45dhYw4QYptb4LHON 7obtbqIJpah9pEwFM3r23YJFEY+egNNNv/ypRoMZXpvCOU6t7K2yCtaHPeRXoWeXCVig 3+9Lz8sNN4fC9ZrK8I2dam+OpbVnWbvyxwiXwVF7tuwjZZsclxJ25Rt3qZQIcLbvH40f VsOw== X-Gm-Message-State: APt69E218Pbghtuj2Vi/n6Cx9noWuxayy4Y5KUraRMXed57/rxorjYnE PrZwNCymxCGDxbct6VijITzfaXBsFmz0AtifqkgSvw== X-Google-Smtp-Source: ADUXVKJm7wxI1hEzB8u88UIj3OXm3QWQ2A5j/S44mY56Hq5vL3izShuUQEZ3FWI7CLtUuqdx1W5jZVVyCzdqCxrPG5U= X-Received: by 2002:a02:2422:: with SMTP id f34-v6mr746697jaa.2.1529067905600; Fri, 15 Jun 2018 06:05:05 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:bbc7:0:0:0:0:0 with HTTP; Fri, 15 Jun 2018 06:05:05 -0700 (PDT) In-Reply-To: <1529064002-18779-3-git-send-email-chandni.cherukuri@arm.com> References: <1529064002-18779-1-git-send-email-chandni.cherukuri@arm.com> <1529064002-18779-3-git-send-email-chandni.cherukuri@arm.com> From: Ard Biesheuvel Date: Fri, 15 Jun 2018 15:05:05 +0200 Message-ID: To: Chandni Cherukuri Cc: "edk2-devel@lists.01.org" , Leif Lindholm Subject: Re: [PATCH edk2-platforms v2 2/2] Platform/ARM/Sgi: Pick ACPI tables to install based on platform ID X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 13:05:06 -0000 Content-Type: text/plain; charset="UTF-8" On 15 June 2018 at 14:00, Chandni Cherukuri wrote: > Use the platform ID and config ID values from the platform ID > HOB to choose the right set of ACPI tables to be installed. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Chandni Cherukuri > --- > Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c | 33 +++++++++++++++++--- > Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf | 2 ++ > Platform/ARM/SgiPkg/SgiPlatform.dsc | 1 + > Platform/ARM/SgiPkg/SgiPlatform.fdf | 1 + > 4 files changed, 32 insertions(+), 5 deletions(-) > > diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c > index edaae5b..f077a2c 100644 > --- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c > +++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c > @@ -14,6 +14,8 @@ > > #include > #include > +#include > +#include > > EFI_STATUS > InitVirtioBlockIo ( > @@ -28,20 +30,41 @@ ArmSgiPkgEntryPoint ( > ) > { > EFI_STATUS Status; > + VOID *PlatformIdHob; > + SGI_PLATFORM_DESCRIPTOR *HobData; > + UINT32 ConfigId; > + UINT32 PartNum; > > - Status = LocateAndInstallAcpiFromFv (&gSgi575AcpiTablesiFileGuid); > - if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "%a: Failed to install ACPI tables\n", __FUNCTION__)); > - return Status; > + PlatformIdHob = GetFirstGuidHob (&gArmSgiPlatformIdDescriptorGuid); > + if (PlatformIdHob == NULL) { > + DEBUG ((DEBUG_ERROR, "Platform ID HOB is NULL\n")); > + return EFI_INVALID_PARAMETER; > + } > + > + HobData = (SGI_PLATFORM_DESCRIPTOR *)(GET_GUID_HOB_DATA (PlatformIdHob)); > + > + PartNum = (HobData->PlatformId & SGI_PART_NUM_MASK); > + ConfigId = ((HobData->PlatformId >> SGI_CONFIG_SHIFT) & SGI_CONFIG_MASK); > + > + if ((PartNum == SGI575_PART_NUM) && (ConfigId == SGI575_CONF_NUM)) { > + Status = LocateAndInstallAcpiFromFv (&gSgi575AcpiTablesiFileGuid); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: Failed to install ACPI tables\n", __FUNCTION__)); > + return Status; > + } > + } else { > + DEBUG ((DEBUG_ERROR, "PlatformDxe: Unsupported Platform Id\n")); > + return EFI_UNSUPPORTED; > } > > - Status = EFI_REQUEST_UNLOAD_IMAGE; > if (FeaturePcdGet (PcdVirtioSupported)) { > Status = InitVirtioBlockIo (ImageHandle); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a: Failed to install Virtio Block device\n", > __FUNCTION__)); > } > + } else { > + Status = EFI_REQUEST_UNLOAD_IMAGE; > } > This is an unrelated (and unnecessary) change. > return Status; > diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf > index 51ad22f..b6b8209 100644 > --- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf > +++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf > @@ -30,10 +30,12 @@ > > [LibraryClasses] > AcpiLib > + HobLib > UefiDriverEntryPoint > VirtioMmioDeviceLib > > [Guids] > + gArmSgiPlatformIdDescriptorGuid > gSgi575AcpiTablesiFileGuid > > [FeaturePcd] > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc b/Platform/ARM/SgiPkg/SgiPlatform.dsc > index a56175e..7b8e051 100644 > --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc > +++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc > @@ -199,6 +199,7 @@ > > NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf > } > + Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPei.inf > > # > # DXE > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf b/Platform/ARM/SgiPkg/SgiPlatform.fdf > index 17cdf48..0e5739e 100644 > --- a/Platform/ARM/SgiPkg/SgiPlatform.fdf > +++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf > @@ -220,6 +220,7 @@ READ_LOCK_STATUS = TRUE > INF MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf > INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf > INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf > + INF Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPei.inf > > FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { > SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE { > -- > 2.7.4 >