From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=chandni.cherukuri@arm.com; receiver=edk2-devel@lists.01.org Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id DDE96211648BB for ; Mon, 12 Nov 2018 03:42:09 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 80DBA80D; Mon, 12 Nov 2018 03:42:09 -0800 (PST) Received: from usa.arm.com (a73437-lin.blr.arm.com [10.162.0.155]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4038F3F5A0; Mon, 12 Nov 2018 03:42:08 -0800 (PST) From: Chandni Cherukuri To: edk2-devel@lists.01.org Date: Mon, 12 Nov 2018 17:11:52 +0530 Message-Id: <1542022916-24462-2-git-send-email-chandni.cherukuri@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542022916-24462-1-git-send-email-chandni.cherukuri@arm.com> References: <1542022916-24462-1-git-send-email-chandni.cherukuri@arm.com> Subject: [PATCH v3 edk2-platforms 1/5] Platform/ARM/Sgi: Adapt to changes in system-id DT node. 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, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 X-List-Received-Date: Mon, 12 Nov 2018 11:42:10 -0000 The 'system-id' node of HW_CONFIG device tree has been updated to have a new property 'config-id' to hold the platform configuration value. Prior to this, configuration ID value was represented by the the upper four bits of the 'platform ID' property value but it now has a seperate property of its own in the 'system-id' node. So adapt to these changes in the 'system-id' node. Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Leif Lindholm Cc: Ard Biesheuvel Signed-off-by: Chandni Cherukuri --- Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c | 24 +++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c b/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c index 081d329..5bdf20c 100644 --- a/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c +++ b/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c @@ -42,6 +42,8 @@ GetSgiPlatformId ( CONST VOID *HwCfgDtBlob; SGI_HW_CONFIG_INFO_PPI *HwConfigInfoPpi; EFI_STATUS Status; + UINT32 PlatformId; + UINT32 ConfigId; Status = PeiServicesLocatePpi (&gHwConfigDtInfoPpiGuid, 0, NULL, (VOID**)&HwConfigInfoPpi); @@ -69,7 +71,27 @@ GetSgiPlatformId ( return 0; } - return fdt32_to_cpu (*Property); + PlatformId = fdt32_to_cpu (*Property); + + // Ensure upper 4-bits of platform-id is set to zero. + ASSERT ((PlatformId >> SGI_CONFIG_SHIFT) == 0); + + Property = fdt_getprop (HwCfgDtBlob, Offset, "config-id", NULL); + if (Property == NULL) { + DEBUG ((DEBUG_ERROR, "Config Id is NULL\n")); + return 0; + } + + ConfigId = fdt32_to_cpu (*Property); + + // Ensure upper 28-bits of config-id is set to zero. + ASSERT ((ConfigId >> SGI_CONFIG_MASK) == 0); + + // Concatenate the value of config ID into the platform ID value with + // config ID occupying the upper 4 bits of platform ID. + PlatformId = PlatformId | (ConfigId << SGI_CONFIG_SHIFT); + + return PlatformId; } /** -- 2.7.4