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::233; helo=mail-wm0-x233.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (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 E698D21A1099A for ; Tue, 12 Dec 2017 10:11:23 -0800 (PST) Received: by mail-wm0-x233.google.com with SMTP id t8so450529wmc.3 for ; Tue, 12 Dec 2017 10:16:02 -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=dNfDLlN+t0CHd8a3KYXGmMgkIuy1U6070FG01pN70kY=; b=eq0Eowcd3HJSMXcEYmCRvtHx2RfCOfCnajkUBpOk9nx/Qng0lhl+RNo5/4sqSBdxkw L2TRwSJyfCizbJMU9LBLvAiGMezyzP+7NH0L/Js5tdDKdqkwuL//oEwWkM6ZyFMwj2/c XVzHrzsFs8iiiBAhJ86swrZ/uYfRAGiIfBYrE= 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=dNfDLlN+t0CHd8a3KYXGmMgkIuy1U6070FG01pN70kY=; b=Wgd7ix+rJg6MZuZtwvw9TUCyRx4LBkzIcU8g2FSD3bhtNiEbhS+s8HIeNEFpMnfK0o 5Q391dhweT+yBikt70IpVxUDy+GXG360N8D1sBHut7MkfK2Ybvm44Pl7ZyJciiOmN3++ X+OtDaen4REI8U7QQYUZtymhOxy784gWRZGHe8yk2gXoUNCiXnVqeG30ss4K0K2rno8v QzcCR/ZWjBatobPkFMLH+5mQ70L9Mj90E3jK/yIqdavWIlimULP5M43Asrr1kKhkYwdb sTuz+5N7I9oe0wsVu00qjoVCbUfWuuXcTEQ+B5Le/h3p/pcacvTQt+BIfJeTibFfJ/UJ UqJA== X-Gm-Message-State: AKGB3mJvMCW500Ui83DAfCKHLtjLeVwc1LvFz+zD6wYOPnM5Si3CD0Fm eUYboNoVNojeISu9nWXp4Nn6iHw25XY= X-Google-Smtp-Source: ACJfBos00NzYendxYt8ljyBmODg+HO5pB5lMmuhLJ9+B6U3YbyaDWJM2cJ2aECiaJyfjTZK9aMP4Iw== X-Received: by 10.28.20.131 with SMTP id 125mr2649788wmu.57.1513102561420; Tue, 12 Dec 2017 10:16:01 -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 x133sm160214wmd.44.2017.12.12.10.16.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2017 10:16:00 -0800 (PST) Date: Tue, 12 Dec 2017 18:15:58 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: "edk2-devel@lists.01.org" , Daniel Thompson , Masami Hiramatsu Message-ID: <20171212181558.dp6hd6nfbwl474cd@bivouac.eciton.net> References: <20171212103807.18836-1-ard.biesheuvel@linaro.org> <20171212103807.18836-6-ard.biesheuvel@linaro.org> <20171212173230.bcm2osdd4iw5auyd@bivouac.eciton.net> <20171212175051.264agxxzdt5vsfof@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH edk2-platforms 5/8] Silicon/SynQuacer: disable PCI RC #0 DT node if disabled X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Dec 2017 18:11:24 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Dec 12, 2017 at 06:09:13PM +0000, Ard Biesheuvel wrote: > On 12 December 2017 at 17:50, Leif Lindholm wrote: > > On Tue, Dec 12, 2017 at 05:35:15PM +0000, Ard Biesheuvel wrote: > >> On 12 December 2017 at 17:32, Leif Lindholm wrote: > >> > Suggested subject tweak: > >> > Silicon/SynQuacer: disable PCI RC #0 DT node if disabled -> > >> > Silicon/SynQuacer: disable PCI RC DT node if RC disabled. > >> > > >> > >> Ack. It's out of date, as you probably suspected > >> > >> > The code below will disable either #0 or #1 node if not enabled by > >> > Pcd. > >> > > >> > On Tue, Dec 12, 2017 at 10:38:04AM +0000, Ard Biesheuvel wrote: > >> >> If PCIe RC #0 is not enabled (due to the fact that the slot is not > >> >> populated), set its DT node 'status' property to 'disabled' so that > >> >> the OS will not attempt to attach to it. > >> >> > >> >> This means we will need to switch from the default DtPlatformDtbLoaderLib > >> >> to a special one for our platform. > >> >> > >> >> Contributed-under: TianoCore Contribution Agreement 1.1 > >> >> Signed-off-by: Ard Biesheuvel > >> >> --- > >> >> Platform/Socionext/DeveloperBox/DeveloperBox.dsc | 8 +- > >> >> Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc | 3 +- > >> >> Silicon/Socionext/SynQuacer/Library/SynQuacerDtbLoaderLib/SynQuacerDtbLoaderLib.c | 94 ++++++++++++++++++++ > >> >> Silicon/Socionext/SynQuacer/Library/SynQuacerDtbLoaderLib/SynQuacerDtbLoaderLib.inf | 42 +++++++++ > >> >> 4 files changed, 141 insertions(+), 6 deletions(-) > >> >> > >> >> diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc > >> >> index 5ec26f9cdd34..80728fedbc20 100644 > >> >> --- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc > >> >> +++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc > >> >> @@ -160,7 +160,8 @@ [LibraryClasses.common.DXE_CORE] > >> >> PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf > >> >> > >> >> [LibraryClasses.common.DXE_DRIVER] > >> >> - DtPlatformDtbLoaderLib|EmbeddedPkg/Library/DxeDtPlatformDtbLoaderLibDefault/DxeDtPlatformDtbLoaderLibDefault.inf > >> >> + DtPlatformDtbLoaderLib|Silicon/Socionext/SynQuacer/Library/SynQuacerDtbLoaderLib/SynQuacerDtbLoaderLib.inf > >> >> + FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf > >> >> SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf > >> >> PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf > >> >> > >> >> @@ -611,10 +612,7 @@ [Components.common] > >> >> # > >> >> # Console preference selection > >> >> # > >> >> - EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.inf { > >> >> - > >> >> - FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf > >> >> - } > >> >> + EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.inf > >> >> > >> >> # > >> >> # DT support > >> >> diff --git a/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc b/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc > >> >> index bc8ddd452d4b..c71425664bdc 100644 > >> >> --- a/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc > >> >> +++ b/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc > >> >> @@ -159,7 +159,8 @@ [LibraryClasses.common.DXE_CORE] > >> >> PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf > >> >> > >> >> [LibraryClasses.common.DXE_DRIVER] > >> >> - DtPlatformDtbLoaderLib|EmbeddedPkg/Library/DxeDtPlatformDtbLoaderLibDefault/DxeDtPlatformDtbLoaderLibDefault.inf > >> >> + DtPlatformDtbLoaderLib|Silicon/Socionext/SynQuacer/Library/SynQuacerDtbLoaderLib/SynQuacerDtbLoaderLib.inf > >> >> + FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf > >> >> SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf > >> >> PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf > >> >> > >> >> diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerDtbLoaderLib/SynQuacerDtbLoaderLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerDtbLoaderLib/SynQuacerDtbLoaderLib.c > >> >> new file mode 100644 > >> >> index 000000000000..a93a6027e64d > >> >> --- /dev/null > >> >> +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerDtbLoaderLib/SynQuacerDtbLoaderLib.c > >> >> @@ -0,0 +1,94 @@ > >> >> +/** @file > >> >> +* > >> >> +* Copyright (c) 2017, 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 distribution. The full text of the license may be found at > >> >> +* http://opensource.org/licenses/bsd-license.php > >> >> +* > >> >> +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > >> >> +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > >> >> +* > >> >> +**/ > >> >> + > >> >> +#include > >> >> + > >> >> +#include > >> >> +#include > >> >> +#include > >> >> +#include > >> >> +#include > >> >> + > >> >> +#define DTB_PADDING 64 > >> > > >> > If there isn't a simplish way of determining this value > >> > arithmetically, can you add a comment explaining why 64 is sufficient? > >> > > >> > >> Something like > >> > >> // add enough space for two instances of 'status = "disabled"' > >> > >> ? > > > > Good enough for me. > > Reviewed-by: Leif Lindholm > > > > Thanks. Does that cover the delta patch I added in my own reply? Yes. Sorry, should have been explicit.