From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::443; helo=mail-wr1-x443.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (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 B7EE921A09130 for ; Mon, 19 Nov 2018 11:23:39 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id b13so33268896wrx.6 for ; Mon, 19 Nov 2018 11:23:39 -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=HFdJ4188GLEjgYR5t8qmXt892rBwOWsxqsfkbM1G9qE=; b=CDc7B/2YGH/INxHq6TntS1PAZBeMem5yaLawjP4efEp5WuIixYZ5UIHI7XzPcEKXTN Hndq0ucTf2x6950l17ZL7ffWHu7kvIpeAfLL5DDdP4aubnJEfz78t2d2ID0ANGT+veEu 6OlMu9ces62pbl3ZB9jtRo+QcqhQVqaJSWlgs= 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=HFdJ4188GLEjgYR5t8qmXt892rBwOWsxqsfkbM1G9qE=; b=E3hhXBplke25QklKPFpiJx1wAMXV3JFP2oLWwISd4tLmnrq5DDZcgzwEd/vOyQoAF5 CTDOKuycTCiFkeQXpmiT6yGSP+hfOLV1iEYm8tPTk+HyEBYXI6KlFVK4j4PecmHLhHI0 v1Dt84SmnA06/yIS1BgIYtjPUA2ziJELcFHMp0XeIpEh6Wv6vRo5U7+VeFFjubRuoeKl EOzYuqXxEzXk8mkzqEkDIDrOls95qVLUIbDp6VPLyemTVpNZSA0EPefPZFf5WS17wG8W /y1QOPAsBAHmAMCWx+UgDjudpK4qpg6GPCKZA6baCuLr5mL0zgY9HXIh12Vqx/bbM+Pg nI9Q== X-Gm-Message-State: AGRZ1gLJyGLDfFsnyN9Ik7SZAedWbRooDynD5+x8YVhj69LTdpcDFmhi b9IplJhUt2rydf9ttO/qLr3+aA== X-Google-Smtp-Source: AJdET5f9aw1BZJzgl1ORA3qBnvI/u8hxVwNKuMEn7SKWu26Bsvbw5W+DLtOan96BkK+NfRZcEAGl3A== X-Received: by 2002:adf:f1c2:: with SMTP id z2mr20026162wro.218.1542655417815; Mon, 19 Nov 2018 11:23:37 -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 l143-v6sm24046330wmb.23.2018.11.19.11.23.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Nov 2018 11:23:37 -0800 (PST) Date: Mon, 19 Nov 2018 19:23:35 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: "edk2-devel@lists.01.org" , Laszlo Ersek , Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= , Hongbo Zhang , Thomas Panakamattam Abraham , Nariman Poushin Message-ID: <20181119192335.kemazpwhjhdh4fkt@bivouac.eciton.net> References: <20181117004524.31851-1-ard.biesheuvel@linaro.org> <20181117004524.31851-2-ard.biesheuvel@linaro.org> <20181119190555.3hlnyds46waiited@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH 1/2] ArmPlatformPkg/NorFlashDxe: use one GUID plus index to identify flash banks X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 19:23:40 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Nov 19, 2018 at 11:09:32AM -0800, Ard Biesheuvel wrote: > > > @@ -121,11 +124,12 @@ NorFlashCreateInstance ( > > > Instance->Size = NorFlashSize; > > > > > > Instance->BlockIoProtocol.Media = &Instance->Media; > > > - Instance->Media.MediaId = MediaId; > > > + Instance->Media.MediaId = Index; > > > Instance->Media.BlockSize = BlockSize; > > > Instance->Media.LastBlock = (NorFlashSize / BlockSize)-1; > > > > > > - CopyGuid (&Instance->DevicePath.Vendor.Guid, NorFlashGuid); > > > + CopyGuid (&Instance->DevicePath.Vendor.Guid, &gEfiCallerIdGuid); > > > > Just sanity checking: this sets the VendorGuid to the NorFlashDxe > > GUID? (93E34C7E-B50E-11DF-9223-2443DFD72085) > > > > Yes. > > Before: > > Mapping table > BLK1: Alias(s): > VenHw(F9B94AE2-8BA6-409B-9D56-B9B417F53CB3) > BLK0: Alias(s): > VenHw(8047DB4B-7E9C-4C0C-8EBC-DFBBAACACE8F) > > After: > > Mapping table > BLK0: Alias(s): > VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00) > BLK1: Alias(s): > VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,01) OK, I'm happy with that. If Thomas/Nariman don't object: Reviewed-by: Leif Lindholm / Leif > > If not, can you explain it to me slowly? :) > > > > Thomas, Nariman: would this change cause any transient issues for > > anything that has set Boot#### options in any of your configurations? > > And if it would, is that a big deal? > > (Ard has a separate patch that fixes up any default values.) > > > > / > > Leif > > > > > + Instance->DevicePath.Index = Index; > > > > > > Instance->ShadowBuffer = AllocateRuntimePool (BlockSize);; > > > if (Instance->ShadowBuffer == NULL) { > > > @@ -1311,7 +1315,6 @@ NorFlashInitialise ( > > > Index, > > > NorFlashDevices[Index].BlockSize, > > > ContainVariableStorage, > > > - &NorFlashDevices[Index].Guid, > > > &mNorFlashInstances[Index] > > > ); > > > if (EFI_ERROR(Status)) { > > > diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h > > > index 5c07694fbfaa..8886aa43d9f3 100644 > > > --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h > > > +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h > > > @@ -122,10 +122,13 @@ > > > > > > typedef struct _NOR_FLASH_INSTANCE NOR_FLASH_INSTANCE; > > > > > > +#pragma pack(1) > > > typedef struct { > > > VENDOR_DEVICE_PATH Vendor; > > > + UINT8 Index; > > > EFI_DEVICE_PATH_PROTOCOL End; > > > } NOR_FLASH_DEVICE_PATH; > > > +#pragma pack() > > > > > > struct _NOR_FLASH_INSTANCE { > > > UINT32 Signature; > > > -- > > > 2.17.1 > > >