From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 0DB83780091 for ; Wed, 24 Apr 2024 09:50:53 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=BEojOeBqYw4/F8h5kL+mvRbD26rNjUYkWp6Z3lxQ4y8=; c=relaxed/simple; d=groups.io; h=Received-SPF:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:Authentication-Results-Original:nodisclaimer:MIME-Version:Original-Authentication-Results:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1713952252; v=1; b=WLx15LJ32gl0voghMEK4G15iWwGpi9chNxJEqdj9ivd7jL5MqpJihbt+Ry1i17YJ1yXgi3bp ti9DnY05vKBkpggCJTZfBrcs/OZJhYaJfLeGKS7hf/shbxF0d3ILB/n5qwxA3biW/vl1eMUYa6X B7Eq0MRit6D443QLcQrnOIWObLwtLOqzrR8N3P4mg5XsPEac82BtZl3Uj7lzInv/Iu5RH7Q39Js LfLLDweRsY6s9o+BZFlxVR1dwHUfQNkD36nBp9FvElGoWM1A0D7HBOiSp7ovCb515I1nZ+VoOKQ gzHjT6rZRV4WVUVYpcazOJC7kG9oaC3VeJg3Ww6eNUjiw== X-Received: by 127.0.0.2 with SMTP id m8XrYY7687511xPLNrSg0kN3; Wed, 24 Apr 2024 02:50:52 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.50]) by mx.groups.io with SMTP id smtpd.web10.12584.1713952251492599856 for ; Wed, 24 Apr 2024 02:50:52 -0700 X-Received: from AS9PR06CA0181.eurprd06.prod.outlook.com (2603:10a6:20b:45d::10) by AS1PR08MB7562.eurprd08.prod.outlook.com (2603:10a6:20b:471::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Wed, 24 Apr 2024 09:50:46 +0000 X-Received: from AM3PEPF0000A78D.eurprd04.prod.outlook.com (2603:10a6:20b:45d:cafe::3d) by AS9PR06CA0181.outlook.office365.com (2603:10a6:20b:45d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.34 via Frontend Transport; Wed, 24 Apr 2024 09:50:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM3PEPF0000A78D.mail.protection.outlook.com (10.167.16.116) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7519.19 via Frontend Transport; Wed, 24 Apr 2024 09:50:46 +0000 X-Received: ("Tessian outbound 8c03561b2da6:v313"); Wed, 24 Apr 2024 09:50:45 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7584723737d218a4 X-CR-MTA-TID: 64aa7808 X-Received: from 2bb2e78044b2.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 494AAD05-824C-44D9-AE5B-60A26251472F.1; Wed, 24 Apr 2024 09:50:40 +0000 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2bb2e78044b2.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 24 Apr 2024 09:50:40 +0000 X-Received: from AM0PR08MB4289.eurprd08.prod.outlook.com (2603:10a6:208:148::12) by AS2PR08MB9075.eurprd08.prod.outlook.com (2603:10a6:20b:5ff::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Wed, 24 Apr 2024 09:50:38 +0000 X-Received: from AM0PR08MB4289.eurprd08.prod.outlook.com ([fe80::4a5d:48:bf49:a524]) by AM0PR08MB4289.eurprd08.prod.outlook.com ([fe80::4a5d:48:bf49:a524%7]) with mapi id 15.20.7472.044; Wed, 24 Apr 2024 09:50:37 +0000 From: "levi.yun" To: "devel@edk2.groups.io" , Sahil Kaushal CC: Ard Biesheuvel , =?koi8-r?Q?Leif_Lindholm_=9A?= , Sami Mujawar Subject: Re: [edk2-devel] [PATCH RESEND edk2-platforms][PATCH V2 08/14] Platform/ARM: Add HostRegisterBaseAddress variable Thread-Topic: [edk2-devel] [PATCH RESEND edk2-platforms][PATCH V2 08/14] Platform/ARM: Add HostRegisterBaseAddress variable Thread-Index: AQHalY/SYIG8UuZ4AEqmxQ8+ndiPxbF3LpdJ Date: Wed, 24 Apr 2024 09:50:37 +0000 Message-ID: References: <20240423055638.1271531-1-Sahil.Kaushal@arm.com> <20240423055638.1271531-9-Sahil.Kaushal@arm.com> In-Reply-To: <20240423055638.1271531-9-Sahil.Kaushal@arm.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: AM0PR08MB4289:EE_|AS2PR08MB9075:EE_|AM3PEPF0000A78D:EE_|AS1PR08MB7562:EE_ X-MS-Office365-Filtering-Correlation-Id: 972c952b-caf0-44bd-323b-08dc644403ab x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft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l?= =?koi8-r?Q?20wd/ukZidCd9jimcTYDVbmyIR33dGkAEEQBmAKH0PBBbZxa+sQpv5K3cp+NYu?= =?koi8-r?Q?FjXvljam2l5tpkHxxbdqDCdB/Mzjh7rDQDpzxLkvbI1rjDnh4hMkte59fPZoJt?= =?koi8-r?Q?cKEqiDV3RjbpOpw2BqxtumHHiNTgs1us/8l9LvvEb5PAz3D2KTVq0X6siLnTeo?= =?koi8-r?Q?FJJRH82C9O5nrRK2tPRbVJnYRlcRqAdOxB7snzfiXWDqdG25GOSetuBmclL7Sf?= =?koi8-r?Q?I/4rDr2RKoj3TuhlvmgUi5if8WXgxo79IlxLf5kX5VTONknK+SOQfHPuh6pJDm?= =?koi8-r?Q?Z37OwOB1IioZ4pWPkI0nPADP9GVaiyum5x+5nFeNYXmoe28seY+8i8Ga2EJhYQ?= =?koi8-r?Q?daECc3ngo457mexO94/1gRgtFBL293zCvW+NmF9RaSGhg8OLDLo62Kyia89tWq?= =?koi8-r?Q?4WxNk2yWZrQl1eIs3fsOzP6F+Aypq8oe/ytGwGxq6Ix3rsjWK/wwppN6JfBjPH?= =?koi8-r?Q?yw=3D=3D?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB4289.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(366007)(38070700009);DIR:OUT;SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9075 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM3PEPF0000A78D.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 08cabcc6-54f8-488c-b266-08dc6443febb X-Microsoft-Antispam-Message-Info: =?koi8-r?Q?4OktzVL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beyFoXBL6UupdBaEf1oReXA13/hCcfK9brpRjgovNnSXsKvPpt?= =?koi8-r?Q?vBeWDD0LtVi+mTd6UAhAo3y5SyA07pIfikHAn1GhdM4pvWIdtgL2oxhJYvg+ly?= =?koi8-r?Q?2LWlCF5rIFhAChZvYTa0Np4Y1MJKqiuWOfC5JrxLInt+Egx7q9xxU1ax76nHTd?= =?koi8-r?Q?H0YPxGUFJBV8xYKQp6YjipeeJBtFFuS2b/oIggg+H45fIJbY1XoxzOMhyfXeBv?= =?koi8-r?Q?nV9g//P7vnuQZQQkNr+c4BCB8AgKRGU3PnmvHb8EKRHxMCLzTufQpC1ez4uvhy?= =?koi8-r?Q?1zP1AsjXHC6bGAXR6a1manYoqhSTxobQQWojAcCdTkKkU+gDRt7+h7qQH0WQZC?= =?koi8-r?Q?Z80gVQNkQe6lntdhBypb7u3gdX2iZTG/nhR3sHbzwAG9qGA3TJmetaDhdGgITP?= =?koi8-r?Q?BHg7eO/krp0VRc+cGT7SIgY9XowNNEdjA7ZKKTVFqHL1/KqUXCmsEhqNZNMR7O?= =?koi8-r?Q?cPeFxk/CG9dOTxIesonXhhoyvH+rr9OoZsiUrJYXRq5N?= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2024 09:50:46.0622 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 972c952b-caf0-44bd-323b-08dc644403ab X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM3PEPF0000A78D.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR08MB7562 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Wed, 24 Apr 2024 02:50:52 -0700 Resent-From: yeoreum.yun@arm.com Reply-To: devel@edk2.groups.io,yeoreum.yun@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: YOgcAXapjcGQW4oLBwVHN2p1x7686176AA= Content-Language: en-GB Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=WLx15LJ3; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed-by: levi.yun ________________________________________ From: devel@edk2.groups.io on behalf of Sahil Kausha= l via groups.io Sent: 23 April 2024 06:56 To: devel@edk2.groups.io Cc: Ard Biesheuvel; Leif Lindholm ; Sami Mujawar; Sahil Kaushal Subject: [edk2-devel] [PATCH RESEND edk2-platforms][PATCH V2 08/14] Platfor= m/ARM: Add HostRegisterBaseAddress variable From: sahil This variable holds the QSPI controller's base address. It is defined in ARM.dec as well with the default value of 0x0. In case a platform is not using it, they can just ignore this variable and the default value of 0x0 will be propogated and the variable will not be used. Signed-off-by: sahil --- Platform/ARM/ARM.dec | 3 ++ Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.inf | 3 ++ Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf | 2 ++ Platform/ARM/Drivers/NorFlashDxe/NorFlashCommon.h | 1 + Platform/ARM/Include/Library/NorFlashDeviceLib.h | 1 + Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c | 34 +++++++++++= ++++++--- Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.c | 12 ++++--- 7 files changed, 48 insertions(+), 8 deletions(-) diff --git a/Platform/ARM/ARM.dec b/Platform/ARM/ARM.dec index 86d1fcb4878e..a5e28c372903 100644 --- a/Platform/ARM/ARM.dec +++ b/Platform/ARM/ARM.dec @@ -26,3 +26,6 @@ [PcdsFeatureFlag.common] gPlatformArmTokenSpaceGuid.PcdNorFlashCheckBlockLocked|FALSE|BOOLEAN|0x0= 000001 + +[PcdsFixedAtBuild.common] + gPlatformArmTokenSpaceGuid.PcdNorFlashRegBaseAddress|0x0|UINT32|0x000000= 02 diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.inf b/Platform/AR= M/Drivers/NorFlashDxe/NorFlashDxe.inf index de160025b632..6522968d6c5a 100644 --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.inf +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.inf @@ -65,5 +65,8 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize +[FixedPcd] + gPlatformArmTokenSpaceGuid.PcdNorFlashRegBaseAddress + [Depex] gEfiCpuArchProtocolGuid diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf b/Pl= atform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf index d9e7de07165c..eb86d423f106 100644 --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf @@ -59,5 +59,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize + gPlatformArmTokenSpaceGuid.PcdNorFlashRegBaseAddress + [Depex] TRUE diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashCommon.h b/Platform/A= RM/Drivers/NorFlashDxe/NorFlashCommon.h index 7fcb949843e8..98464e4868b1 100644 --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlashCommon.h +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlashCommon.h @@ -34,6 +34,7 @@ // EFI_STATUS NorFlashCreateInstance ( + IN UINTN HostRegisterBase, IN UINTN NorFlashDeviceBase, IN UINTN NorFlashRegionBase, IN UINTN NorFlashSize, diff --git a/Platform/ARM/Include/Library/NorFlashDeviceLib.h b/Platform/AR= M/Include/Library/NorFlashDeviceLib.h index e5017130a091..29b8b8901525 100644 --- a/Platform/ARM/Include/Library/NorFlashDeviceLib.h +++ b/Platform/ARM/Include/Library/NorFlashDeviceLib.h @@ -29,6 +29,7 @@ struct _NOR_FLASH_INSTANCE { UINT32 Signature; EFI_HANDLE Handle; + UINTN HostRegisterBaseAddress; UINTN DeviceBaseAddress; UINTN RegionBaseAddress; UINTN Size; diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c b/Platform/ARM/= Drivers/NorFlashDxe/NorFlashDxe.c index 1c12572ab663..f5c0dadf84e0 100644 --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c @@ -1,6 +1,6 @@ /** @file NorFlashDxe.c - Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.
+ Copyright (c) 2011 - 2024, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -30,6 +30,7 @@ NOR_FLASH_INSTANCE mNorFlashInstanceTemplate =3D { NOR_FLASH_SIGNATURE, // Signature NULL, // Handle ... NEED TO BE FILLED + 0, // HostRegisterBaseAddress ... NEED TO BE FILLED 0, // DeviceBaseAddress ... NEED TO BE FILLED 0, // RegionBaseAddress ... NEED TO BE FILLED 0, // Size ... NEED TO BE FILLED @@ -99,6 +100,7 @@ NOR_FLASH_INSTANCE mNorFlashInstanceTemplate =3D { EFI_STATUS NorFlashCreateInstance ( + IN UINTN HostRegisterBase, IN UINTN NorFlashDeviceBase, IN UINTN NorFlashRegionBase, IN UINTN NorFlashSize, @@ -118,9 +120,10 @@ NorFlashCreateInstance ( return EFI_OUT_OF_RESOURCES; } - Instance->DeviceBaseAddress =3D NorFlashDeviceBase; - Instance->RegionBaseAddress =3D NorFlashRegionBase; - Instance->Size =3D NorFlashSize; + Instance->HostRegisterBaseAddress =3D HostRegisterBase; + Instance->DeviceBaseAddress =3D NorFlashDeviceBase; + Instance->RegionBaseAddress =3D NorFlashRegionBase; + Instance->Size =3D NorFlashSize; Instance->BlockIoProtocol.Media =3D &Instance->Media; Instance->Media.MediaId =3D Index; @@ -184,6 +187,27 @@ NorFlashInitialise ( UINT32 Index; NOR_FLASH_DESCRIPTION *NorFlashDevices; BOOLEAN ContainVariableStorage; + EFI_PHYSICAL_ADDRESS HostRegisterBaseAddress; + + // Register host register region if available + HostRegisterBaseAddress =3D PcdGet32 (PcdNorFlashRegBaseAddress); + + if (HostRegisterBaseAddress !=3D 0) { + Status =3D gDS->AddMemorySpace ( + EfiGcdMemoryTypeMemoryMappedIo, + HostRegisterBaseAddress, + SIZE_4KB, + EFI_MEMORY_UC | EFI_MEMORY_RUNTIME + ); + ASSERT_EFI_ERROR (Status); + + Status =3D gDS->SetMemorySpaceAttributes ( + HostRegisterBaseAddress, + SIZE_4KB, + EFI_MEMORY_UC | EFI_MEMORY_RUNTIME + ); + ASSERT_EFI_ERROR (Status); + } Status =3D NorFlashPlatformInitialization (); if (EFI_ERROR (Status)) { @@ -215,6 +239,7 @@ NorFlashInitialise ( } Status =3D NorFlashCreateInstance ( + HostRegisterBaseAddress, NorFlashDevices[Index].DeviceBaseAddress, NorFlashDevices[Index].RegionBaseAddress, NorFlashDevices[Index].Size, @@ -368,6 +393,7 @@ NorFlashVirtualNotifyEvent ( UINTN Index; for (Index =3D 0; Index < mNorFlashDeviceCount; Index++) { + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->HostRegis= terBaseAddress); EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->DeviceBas= eAddress); EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->RegionBas= eAddress); diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.c b/Plat= form/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.c index 85198b98e8a8..ef9bed37d140 100644 --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.c +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.c @@ -1,6 +1,6 @@ /** @file NorFlashStandaloneMm.c - Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.
+ Copyright (c) 2011 - 2024, Arm Limited. All rights reserved.
Copyright (c) 2020, Linaro, Ltd. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -24,6 +24,7 @@ NOR_FLASH_INSTANCE mNorFlashInstanceTemplate =3D { NOR_FLASH_SIGNATURE, // Signature NULL, // Handle ... NEED TO BE FILLED + 0, // HostRegisterBaseAddress ... NEED TO BE FILLED 0, // DeviceBaseAddress ... NEED TO BE FILLED 0, // RegionBaseAddress ... NEED TO BE FILLED 0, // Size ... NEED TO BE FILLED @@ -93,6 +94,7 @@ NOR_FLASH_INSTANCE mNorFlashInstanceTemplate =3D { EFI_STATUS NorFlashCreateInstance ( + IN UINTN HostRegisterBase, IN UINTN NorFlashDeviceBase, IN UINTN NorFlashRegionBase, IN UINTN NorFlashSize, @@ -112,9 +114,10 @@ NorFlashCreateInstance ( return EFI_OUT_OF_RESOURCES; } - Instance->DeviceBaseAddress =3D NorFlashDeviceBase; - Instance->RegionBaseAddress =3D NorFlashRegionBase; - Instance->Size =3D NorFlashSize; + Instance->HostRegisterBaseAddress =3D HostRegisterBase; + Instance->DeviceBaseAddress =3D NorFlashDeviceBase; + Instance->RegionBaseAddress =3D NorFlashRegionBase; + Instance->Size =3D NorFlashSize; Instance->BlockIoProtocol.Media =3D &Instance->Media; Instance->Media.MediaId =3D Index; @@ -194,6 +197,7 @@ NorFlashInitialise ( } Status =3D NorFlashCreateInstance ( + PcdGet32 (PcdNorFlashRegBaseAddress), NorFlashDevices[Index].DeviceBaseAddress, NorFlashDevices[Index].RegionBaseAddress, NorFlashDevices[Index].Size, -- 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118158): https://edk2.groups.io/g/devel/message/118158 Mute This Topic: https://groups.io/mt/105690943/7717249 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [yeoreum.yun@arm.com] -=3D-=3D-=3D-=3D-=3D-=3D IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118192): https://edk2.groups.io/g/devel/message/118192 Mute This Topic: https://groups.io/mt/105690943/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-