From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (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 942FC22402DE6 for ; Wed, 28 Feb 2018 08:26:29 -0800 (PST) Received: by mail-wm0-x242.google.com with SMTP id z81so6143453wmb.4 for ; Wed, 28 Feb 2018 08:32:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=86slbA8ey1nvO4ZJRqm88D3IyuZbatzcvSHp67VA2hE=; b=dCdO9yXkul+HbB+2ulTUBKnS9q3zfn8/3aeUWLESDdQcxER0Q6PED6yODnSnnwvNHL gQkkxqaitPKpJQ+ck4/MMd2mUXDoGJ9deHwP43rIYG9ba+U+Q6CCOSTTMv8CEz0lYwq4 nkB+rAWRXI9c3ifyVxHTwo4GuQav4PtPpaFBg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=86slbA8ey1nvO4ZJRqm88D3IyuZbatzcvSHp67VA2hE=; b=M/CmJI+XxSX5Op/Rf9rPjHHQANmjyKWmsGrWl/cXWg29LKFhsvU208TvKdpz51HIuo ki5S8nrKGh7+RQA2un2G54AXHUWoydDSEin09Px6CVjKk8L/cUC6EJGc2USakLmViQG/ FJIIjIVR9fkqxAhQ4WXK269u2bRITLMBai7bh+Yp7PE5/Y+oV2l9/btI6e8WFSgRut9y +WkHqP8RD2bk13Adr5ZUL3Tk+oGaWd14O0MlHY0JNAqyEGIRBaXQAHA4CKypP9W7BLCO tdsixqo2NvPyNAkOeAOGKzrFJL+WTfrA3YTSFLrWTM50PhhayW1jUSuqQYogj2oww8ae CnFQ== X-Gm-Message-State: APf1xPDayVgha4Z1ZR+tLZuncciZUjfJQ0EcEZPspYHhVA4jXM3F/77A vSykIPfIVL2oVbbiO0HlusLtbA== X-Google-Smtp-Source: AG47ELurLZL00dIb8BtaEsOTMlmeAulG9UGpfs0oQndvlBXKpMLWKOcm8wP/bAXohWZiCua2eB98+w== X-Received: by 10.28.84.26 with SMTP id i26mr11383776wmb.129.1519835555492; Wed, 28 Feb 2018 08:32:35 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id x127sm800682wmx.19.2018.02.28.08.32.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Feb 2018 08:32:34 -0800 (PST) Date: Wed, 28 Feb 2018 16:32:33 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, graeme.gregory@linaro.org, masahisa.kojima@linaro.org Message-ID: <20180228163233.iil4hsnzojxpzedw@bivouac.eciton.net> References: <20180227092017.23617-1-ard.biesheuvel@linaro.org> <20180227092017.23617-5-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20180227092017.23617-5-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH edk2-platforms 4/5] Silicon/SynQuacer/PlatformDxe: add option to enable ACPI mode X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 16:26:30 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Feb 27, 2018 at 09:20:16AM +0000, Ard Biesheuvel wrote: > Create a HII menu option to choose between device tree and ACPI platform > descriptions. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm > --- > Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c | 32 ++++++++++++++------ > Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf | 1 + > Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni | 8 ++++- > Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr | 10 +++++- > Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h | 8 +++-- > 5 files changed, 46 insertions(+), 13 deletions(-) > > diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c > index 8787aa6288a7..4ae1c5b0ff6f 100644 > --- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c > +++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c > @@ -277,15 +277,29 @@ PlatformDxeEntryPoint ( > mHiiSettingsVal = PcdGet64 (PcdPlatformSettings); > mHiiSettings = (SYNQUACER_PLATFORM_VARSTORE_DATA *)&mHiiSettingsVal; > > - Dtb = NULL; > - Status = DtPlatformLoadDtb (&Dtb, &DtbSize); > - if (!EFI_ERROR (Status)) { > - Status = gBS->InstallConfigurationTable (&gFdtTableGuid, Dtb); > - } > - if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, > - "%a: failed to install FDT configuration table - %r\n", __FUNCTION__, > - Status)); > + if (mHiiSettings->AcpiPref == ACPIPREF_DT) { > + Dtb = NULL; > + Status = DtPlatformLoadDtb (&Dtb, &DtbSize); > + if (!EFI_ERROR (Status)) { > + Status = gBS->InstallConfigurationTable (&gFdtTableGuid, Dtb); > + } > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, > + "%a: failed to install FDT configuration table - %r\n", __FUNCTION__, > + Status)); > + } > + } else { > + // > + // ACPI was selected: install the gEdkiiPlatformHasAcpiGuid GUID as a > + // NULL protocol to unlock dispatch of ACPI related drivers. > + // > + Status = gBS->InstallMultipleProtocolInterfaces (&ImageHandle, > + &gEdkiiPlatformHasAcpiGuid, NULL, NULL); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, > + "%a: failed to install gEdkiiPlatformHasAcpiGuid as a protocol\n", > + __FUNCTION__)); > + } > } > > Handle = NULL; > diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf > index fca66799ebcb..bef7feccd8b8 100644 > --- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf > +++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf > @@ -58,6 +58,7 @@ [LibraryClasses] > > [Guids] > g96BoardsI2c0MasterGuid > + gEdkiiPlatformHasAcpiGuid > gEfiHiiPlatformSetupFormsetGuid > gFdtTableGuid > gNetsecNonDiscoverableDeviceGuid > diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni > index 2eca8bbba8c3..836decc870f0 100644 > --- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni > +++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni > @@ -1,6 +1,6 @@ > /** @file > * > -* Copyright (c) 2017, Linaro, Ltd. All rights reserved. > +* Copyright (c) 2017 - 2018, Linaro, Ltd. All rights reserved. > * > * This program and the accompanying materials are licensed and made available > * under the terms and conditions of the BSD License which accompanies this > @@ -33,3 +33,9 @@ > > #string STR_EMMC_DISABLED #language en-US "Disabled" > #string STR_EMMC_ENABLED #language en-US "Enabled" > + > +#string STR_DT_ACPI_SELECT_PROMPT #language en-US "O/S Hardware Description" > +#string STR_DT_ACPI_SELECT_HELP #language en-US "Select the hardware description that will be exposed to the O/S." > + > +#string STR_DT_ACPI_SELECT_DT #language en-US "Device Tree" > +#string STR_DT_ACPI_SELECT_ACPI #language en-US "ACPI" > diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr > index ea35e902b2d7..8a395eac681b 100644 > --- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr > +++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr > @@ -1,6 +1,6 @@ > /** @file > * > -* Copyright (c) 2017, Linaro, Ltd. All rights reserved. > +* Copyright (c) 2017 - 2018, Linaro, Ltd. All rights reserved. > * > * This program and the accompanying materials are licensed and made available > * under the terms and conditions of the BSD License which accompanies this > @@ -70,6 +70,14 @@ formset > option text = STRING_TOKEN(STR_EMMC_ENABLED), value = EMMC_ENABLED, flags = 0; > endoneof; > > + oneof varid = SynQuacerPlatformSettings.AcpiPref, > + prompt = STRING_TOKEN(STR_DT_ACPI_SELECT_PROMPT), > + help = STRING_TOKEN(STR_DT_ACPI_SELECT_HELP), > + flags = NUMERIC_SIZE_1 | INTERACTIVE | RESET_REQUIRED, > + option text = STRING_TOKEN(STR_DT_ACPI_SELECT_DT), value = ACPIPREF_DT, flags = DEFAULT; > + option text = STRING_TOKEN(STR_DT_ACPI_SELECT_ACPI), value = ACPIPREF_ACPI, flags = 0; > + endoneof; > + > subtitle text = STRING_TOKEN(STR_NULL_STRING); > > endform; > diff --git a/Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h b/Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h > index fbbcbd7d3eec..bb0e476fc3f8 100644 > --- a/Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h > +++ b/Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h > @@ -1,6 +1,6 @@ > /** @file > > - Copyright (c) 2017, Linaro, Ltd. All rights reserved.
> + Copyright (c) 2017 - 2018, Linaro, Ltd. All rights reserved.
> > This program and the accompanying materials are licensed and made available > under the terms and conditions of the BSD License which accompanies this > @@ -22,12 +22,16 @@ > #define PCIE_MAX_SPEED_UNLIMITED 0x0 > #define PCIE_MAX_SPEED_GEN1 0x1 > > +#define ACPIPREF_DT 0x0 > +#define ACPIPREF_ACPI 0x1 > + > typedef struct { > UINT8 EnableEmmc; > UINT8 PcieSlot0MaxSpeed; > UINT8 PcieSlot1MaxSpeed; > UINT8 PcieSlot2MaxSpeed; > - UINT8 Reserved[4]; > + UINT8 AcpiPref; > + UINT8 Reserved[3]; > } SYNQUACER_PLATFORM_VARSTORE_DATA; > > #endif > -- > 2.11.0 >