From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR02-AM5-obe.outbound.protection.outlook.com (EUR02-AM5-obe.outbound.protection.outlook.com [40.107.0.60]) by mx.groups.io with SMTP id smtpd.web11.20709.1621265572919506849 for ; Mon, 17 May 2021 08:32:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=fabc+1KX; spf=pass (domain: arm.com, ip: 40.107.0.60, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D/q8VvuokTGNK3TyMSBxPXIcKKiBiXf+VPINHx+Lbi8=; b=fabc+1KXP8yDFQxcKIO9K9Y2W5SRFGVlUVX9evWQ+/XjWPnExyDsXZznS4gSKar9I6+TB3h4caKOjcN0jnzvgg256jB7ZNVnyhqvDquNtMB7AO+/uIPLVZWhy6YgPM4NShkgBFOKf2Pwu/6pT6F/bOyE+ltjOOxPyag6Bo9itEw= Received: from DB6P193CA0010.EURP193.PROD.OUTLOOK.COM (2603:10a6:6:29::20) by VI1PR08MB3392.eurprd08.prod.outlook.com (2603:10a6:803:7b::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Mon, 17 May 2021 15:32:50 +0000 Received: from DB5EUR03FT023.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:29:cafe::43) by DB6P193CA0010.outlook.office365.com (2603:10a6:6:29::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25 via Frontend Transport; Mon, 17 May 2021 15:32:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT023.mail.protection.outlook.com (10.152.20.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25 via Frontend Transport; Mon, 17 May 2021 15:32:50 +0000 Received: ("Tessian outbound 2cd7db0b285f:v92"); Mon, 17 May 2021 15:32:50 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7d29d8c10e30f5c0 X-CR-MTA-TID: 64aa7808 Received: from a78680a15a49.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 85463CAB-D01B-4ADD-90A7-EFE11B6E83BE.1; Mon, 17 May 2021 15:32:44 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a78680a15a49.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 17 May 2021 15:32:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ePrBsKexkS6dZDEKkJxnQkASX5yQU+RgTTX+7U2LDTj+4OYscGL1SMN/6vxljd0nAJ2Q/NRTGcnTbMI553pljQ/9o1Qo3FBNgic/wAcJxgwBbmikq6DlgKDezxtFTVtPfVDqfJU+l9lP6Q0yIMvABGjr5oAnonvktDnLq2lTHA0ZE9gjFZm5XcDHFnfpeku6+KaSJmXXqohcSQFCAthVfTvaGq5PJQWqxEsDe66X1TyaJjrXq8RdzbAyv+voSN/orZtx9K8Nln3nwDhAb9SN+tsXTa74Tk5mxr5SUVXEk74jZsKhbX8ObbGknA/Jctju7YHYaB1sEeR/HOxA56Mw6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D/q8VvuokTGNK3TyMSBxPXIcKKiBiXf+VPINHx+Lbi8=; b=lv5jZ8hQhvTjQt8yhfhflnIxj9JEyDvxHcyEdVDUymKfCf4+4eGSfEyTSZo+a3VjAheJZpLvDWsQREqyXAbOe0zads9N+oiZPHPumXvdjGZCBGqkRfChz+moCq+/xBWtQ0NPRsiSUl4bVm2zrq92uaw4rKO5KVLzP2VchbXuvy90o5x+s0BpqGng8f1cGhRw0evbzjOkdA2nt08WlcgjRb42Jd5GqPpHZ2ukT38FmD/7y90vmzjeFhcj2D0lOOGfeT0J/qxf318XW7AdG2685kazavOfcL4Vs+99AntM3fOz3PFIiqTjmSwxn4B7Ff++Z+7a7NzFEWMwBn6YnFzVsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D/q8VvuokTGNK3TyMSBxPXIcKKiBiXf+VPINHx+Lbi8=; b=fabc+1KXP8yDFQxcKIO9K9Y2W5SRFGVlUVX9evWQ+/XjWPnExyDsXZznS4gSKar9I6+TB3h4caKOjcN0jnzvgg256jB7ZNVnyhqvDquNtMB7AO+/uIPLVZWhy6YgPM4NShkgBFOKf2Pwu/6pT6F/bOyE+ltjOOxPyag6Bo9itEw= Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AM6PR08MB3032.eurprd08.prod.outlook.com (2603:10a6:209:43::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Mon, 17 May 2021 15:32:43 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::80cb:878d:c8f1:2688]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::80cb:878d:c8f1:2688%7]) with mapi id 15.20.4129.031; Mon, 17 May 2021 15:32:42 +0000 Subject: Re: [edk2-platforms][PATCH V2 02/11] Platform/Sgi: Add GetProductId API for SGI/RD Platforms To: Pranav Madhu , devel@edk2.groups.io Cc: Ard Biesheuvel , nd@arm.com References: <20210516092917.21124-1-pranav.madhu@arm.com> <20210516092917.21124-3-pranav.madhu@arm.com> From: "Sami Mujawar" Message-ID: <42a86d72-ad32-7103-658b-f4e4f9f2e092@arm.com> Date: Mon, 17 May 2021 16:32:41 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 In-Reply-To: <20210516092917.21124-3-pranav.madhu@arm.com> X-Originating-IP: [217.140.106.52] X-ClientProxiedBy: LO4P123CA0332.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18c::13) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.1.196.43] (217.140.106.52) by LO4P123CA0332.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 17 May 2021 15:32:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 21bbbb6e-2e4c-4068-dde9-08d9194907ce X-MS-TrafficTypeDiagnostic: AM6PR08MB3032:|VI1PR08MB3392: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 58EvHvK8Bz+rDRkhJpQhg9vY0dG+blpcDm4wYQuzUtWLK5BZhX++SVcmGxrIbohyD+yG2j1OXGo58OgmA9I4MIc/ByRetiPNKjdddMPahehPICTtmapyzRYQ+ErikI8A1lWVbMF+QXGz5F/rneBrB4vMGS/Vkn/N8Iu8gT4c/mIsoQOcKKC38yIPRhEZl/oFfmgiBVC9OXq+1mlrJMoy99e8E2kWe11ZytiUU85vRPFDxab/aluMtg+SBbGNk9/5hVnGQ2TULNsMF40ZJEaT3pudUFPJC6zjg/W73b18mIy2cCHwANYRbskkzSkbdu7TNeVY8VCAW0JCOHdGH5JIqH3dwxBLrTKVjbzHymDB4cFaMV/b9xmuxJoH0NasxTeyFYp9xzieBPNP+EBkUBYjCMcT2B8UAF7fvYDxds9nfl5bsl/d0RlD7WElz6TcABpZ0Xwenn5PRFBqhc+YioQfJKwvNH93DqkAmIbLJ6R/tnUDdfX0nfmxFivL0gMC4LIvPPCi6f3QCbipWqEtqohvbLlmpHY+0E/PjtTtPwNf1lMm3DQ0kGCP+bG7jEtbHFVq7klJgsRIWBtV4SdGVPTo+Lj/sxdcMsE87qw8miwPJi57Jv5q2Ge4SR69XGyyWCw+VsLS0QtygYt6+wHXKASdK3B2CO4an3zUTQm8FXd/Y+Znd3AkU9yaRJSY8Rq3xzpDilV+NUwXVdCrhFEHUaNnBpWm3bTy43A98s0JPqLHDBo= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(396003)(39850400004)(376002)(366004)(136003)(44832011)(86362001)(31686004)(52116002)(83380400001)(6486002)(2906002)(53546011)(8676002)(36756003)(16576012)(66476007)(316002)(16526019)(8936002)(66556008)(5660300002)(26005)(478600001)(186003)(38100700002)(66946007)(956004)(4326008)(2616005)(31696002)(38350700002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?dW1raHpLVWxhUlBHN05WbnBSMXNSME9UWlphOVZEUEtGR3FSeHBjUUhQcllO?= =?utf-8?B?QjFjUmM3QlpiSzlUTnVlNml1YW84NTFoTndXSm0yWE9MR1NaUTdvNWhLZ1Uz?= =?utf-8?B?NlBWMzZ0MG1YalN5cG1wTHZzaTNRWkRpM0l1cEU4Zkt2MzVSTVRqaWYzRUdm?= =?utf-8?B?VU1UbTRLQjYycjRpeVBpdi9wc0t1K0RwNXpaT0JjaFFsQWhSOXpZTC9Qc2cy?= =?utf-8?B?b2hyM0lOMVN5RXZSQUlqd3BlZmYrdVBGWW45aEovSTBBRjY0RWdUM05RTTly?= =?utf-8?B?WVlDbXFmbi9ZOWY5Uk8raFlXNXBpU1dQSFRzdk5KY0dkNlRFcTZ6MkNFUnVn?= =?utf-8?B?UlZPL3QxR0pmTVRnY2Z0SGtCSW11WDhUUmwwMGdMOFpYb3c0SEpjcGd6WG5V?= =?utf-8?B?eG1CdGZlNTRwa1lwOG1XV3FtVFlWM1dnQzI3Rm9Sd2RQUDZTb0hEOEsrUFkw?= =?utf-8?B?VnJGcTJoUFlDaHBSM0toRG5kS2hMcE16N295a1ZFNTNpVFNqaU9oeEZiRGhy?= =?utf-8?B?WTNwUWQxMHE4cWQrc3h0b1poU2JKdStXL01CZy91ZytJV3ZBcHE2MkdPSXdr?= =?utf-8?B?UUNEUmFoNm9FMUJsUmRaS1c0b0E1NyszSDVKZ0ZZTGlsNjZWYUxpbHViQjd2?= =?utf-8?B?UXQ2T2lLMU83TS9TMlg0L0lRZEtFNWhNVWFvc0ltL0FjRUhxbGY4SDNKUk1s?= =?utf-8?B?L242TXlzNmplZndPZHBsSjBzejl2NGhKdFVLeFBxYXhPSU5BZnNQL2I0Vkly?= =?utf-8?B?VHkzd2M0ejVadHVQdHZIV0J3aTdBU1g3SCt3UHd6V3NqWk8rejZDNTRjQjdK?= =?utf-8?B?My9lejdiR2VTRVlXNS9PdDZJOXZJeWE1K09qY0RlMlhwWXd1d09TWHpYRmJa?= =?utf-8?B?cG5MUTVaRXZvSFNpT1lIWnNCdnZmNDRKOCtaUlY0WmVURFJTVmVMbi9YS3NM?= =?utf-8?B?Rk41VXZ5Y3BHRXRhL0poZXhDOWNTTWkwNUlNcUpvenhqNC96Q2F0M2JOaURr?= =?utf-8?B?bFd3VDBDNXFSZ2xqUmI5SkpES3VtdE5WMXo0Z0ZDK2M4Wnpwc2haNndITGFZ?= =?utf-8?B?ZmRtZGlFTHI2N1l4YVBDNTZjQzJBR3BLejJGWWcyV1dYL3ZVcTZsaGM4VE5U?= =?utf-8?B?cm8xd1JLQ1JZOGY3TUM4U29oM2FyV2tIKzFLL2RtaVlvYmI3QkpwQXY3ZHdw?= =?utf-8?B?OTJ6TzI0dm1nTXZFRkszdlU4S3lnVDQ5WWJabWp1RXFXU1ZBS0xOaGJrVU13?= =?utf-8?B?azZ1cVNJM01KVlU3dTFEUDlwMlNRczBOY0hPOTd6SjkrSk1YWXN0dXdlaXZr?= =?utf-8?B?YkZTUGZUQUFHUFhRdFgwMzZmK0ZjUXdLNC96NjRkMVlzRjZtYmpONHAxK0t5?= =?utf-8?B?OFl0K0tURDJEYUxJQ05keUtZSWVyazlteWkxS3BySTIyWHBqWUtZemVHMHZY?= =?utf-8?B?SE8zQXhXWjZUaWhibHF4U2UwcnBZcFN0b1cxekhicWdXZXczR1Q2Nk45RnN4?= =?utf-8?B?WHc0Tk1QYlQyRm9ONmtRcDNYMXA5cml5dUY3OTN6cWg5WXBFbzZMVkswZnNP?= =?utf-8?B?OG5IR29YVk5WM1Bob2lnaWxXNFRZaGdHcW1SWUVRNnV2K3h3Vi8wellETFpw?= =?utf-8?B?THNyaHpsUkRZWlJVRmJDU3hiejdmdzMyWmw5VzBTNi9RUzNlcm9rbTE3MDFC?= =?utf-8?B?bE5YeGhzOU9rWnBweStjR21LeWJWOWpmUzFsdFhOaUlwcU0vclR5bVlZUjl5?= =?utf-8?Q?W1RRx7VS5MPyWwVEvNNsSiyetJrS5nakQVxNIlx?= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3032 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT023.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 9a7e0333-7696-4f4a-7c90-08d9194902cf X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nFDWCE59BEJWo9ouUIJ1uiYv/+CQi7qUrv5XuJfOkioIs2wRFsA3ud2iHcTo/WRbthDwprPiGJkL0MYpS1FXzIXfw+TuX/MO3J390SEVFk2Xj+tWVtagqSFbFJ1v4hCCQJPnggOJ8KSh8DR1a59gpk5DBpodinUw5prcl8KsFW1dpE9qaEkeeNFTaI9S1aP38TeEixYPoEFGVU1txghQtqp8kRmwSt+pOSK3Ck6JY+MWSRGkm6lxXZE6CMiDf3ZcaNF46MbSws9mmA9SN4QqjWamEjB9EyoHj0SOEM9MquPR3lnPr280ENA2bL3shkvThpzhZMX6VoEiWKtTRqxbenZ1ohTwlkmbk16z8hmIxFoOEn8BxM77nKFFyHchWeBlLxU6zjWwZIexNtMhVQiuZbhbJiHjK4re8c96R8QIM6D5CLUTcByrIarhzqpdVkDnYmu+cw2rXzOloaY8WuDxD8UDzzlYLX2r2p2Dc2clpCvtnezjhWTR3NIfAB0LpqlpAqV+KM7ycuohDzpqFWTRZoPF5Po+eq1JRedY95kpoNRpPk9/Thj+WGWRiPYq+cixbouuqMOMqmLZXjHrgQyPnBeWmWNpEfZ5kPFoypi02iuXDq5E/DAJ//aewv9llDQbDLWrgqJaAGVNYkQr1bdtv7miVncHcL+b65BBxH2H63pxnFRnKGKLfDFnH7W+7cDT X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(396003)(136003)(346002)(376002)(39850400004)(46966006)(36840700001)(2906002)(70586007)(70206006)(356005)(81166007)(2616005)(336012)(36756003)(53546011)(16526019)(478600001)(5660300002)(36860700001)(6486002)(316002)(16576012)(82740400003)(31696002)(83380400001)(31686004)(82310400003)(47076005)(86362001)(956004)(26005)(44832011)(8676002)(8936002)(4326008)(186003)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2021 15:32:50.3860 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 21bbbb6e-2e4c-4068-dde9-08d9194907ce 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: DB5EUR03FT023.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3392 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Hi Pranav, Please find my feedback inline marked [SAMI]. With those addressed. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 16/05/2021 10:29 AM, Pranav Madhu wrote: > Add GetProductId API for SGI/RD Platform. The API returns a product id > in integer format based on the platform description data. The product id > is required for other drivers such as SMBIOS. > > Signed-off-by: Pranav Madhu > --- > Platform/ARM/SgiPkg/Include/SgiPlatform.h | 21 +++++ > Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c | 86 +++++++++++++++++++- > 2 files changed, 106 insertions(+), 1 deletion(-) > > diff --git a/Platform/ARM/SgiPkg/Include/SgiPlatform.h b/Platform/ARM/SgiPkg/Include/SgiPlatform.h > index 1c5366878712..142fa29bb9fa 100644 > --- a/Platform/ARM/SgiPkg/Include/SgiPlatform.h > +++ b/Platform/ARM/SgiPkg/Include/SgiPlatform.h > @@ -68,4 +68,25 @@ typedef struct { > UINTN MultiChipMode; > } SGI_PLATFORM_DESCRIPTOR; > > +// Arm SGI/RD Product IDs > +enum ARM_RD_PRODUCT_ID { > + UnknownId = 0, > + Sgi575, > + RdN1Edge, > + RdN1EdgeX2, > + RdE1Edge, > + RdV1, > + RdV1Mc, > + RdN2 > +}; [SAMI] > + > +// Arm ProductId look-up table > +typedef struct { > + UINTN ProductId; > + UINTN PlatformId; > + UINTN ConfigId; > + UINTN MultiChipMode; > +} SGI_PRODUCT_ID_LOOKUP; > + > +UINT8 SgiGetProductId ( VOID ); [SAMI] Please add doxygen header for this function. Also there should not be spaces before and after VOID. [/SAMI] > #endif // __SGI_PLATFORM_H__ > diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c > index 9731d7cccede..57b1658ab0af 100644 > --- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c > +++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c > @@ -1,6 +1,6 @@ > /** @file > * > -* Copyright (c) 2018, ARM Limited. All rights reserved. > +* Copyright (c) 2018-2021, ARM Limited. All rights reserved. > * > * SPDX-License-Identifier: BSD-2-Clause-Patent > * > @@ -8,9 +8,12 @@ > > #include > #include > +#include > #include > #include > > +#include "SgiPlatform.h" > + > UINT64 NtFwConfigDtBlob; > STATIC SGI_NT_FW_CONFIG_INFO_PPI mNtFwConfigDtInfoPpi; > > @@ -21,6 +24,51 @@ STATIC ARM_CORE_INFO mCoreInfoTable[] = { > }, > }; > > +STATIC SGI_PRODUCT_ID_LOOKUP SgiProductIdLookup[] = { [SAMI] Can this be made STATIC CONST? [/SAMI] > + { > + Sgi575, > + SGI575_PART_NUM, > + SGI575_CONF_NUM, > + 0 > + }, > + { > + RdN1Edge, > + RD_N1E1_EDGE_PART_NUM, > + RD_N1_EDGE_CONF_ID, > + 0 > + }, > + { > + RdN1EdgeX2, > + RD_N1E1_EDGE_PART_NUM, > + RD_N1_EDGE_CONF_ID, > + 1 > + }, > + { > + RdE1Edge, > + RD_N1E1_EDGE_PART_NUM, > + RD_E1_EDGE_CONF_ID, > + 0 > + }, > + { > + RdV1, > + RD_V1_PART_NUM, > + RD_V1_CONF_ID, > + 0 > + }, > + { > + RdV1Mc, > + RD_V1_PART_NUM, > + RD_V1_MC_CONF_ID, > + 1 > + }, > + { > + RdN2, > + RD_N2_PART_NUM, > + RD_N2_CONF_ID, > + 0 > + } > +}; > + > EFI_BOOT_MODE > ArmPlatformGetBootMode ( > VOID > @@ -75,3 +123,39 @@ ArmPlatformGetPlatformPpiList ( > *PpiListSize = sizeof (gPlatformPpiTable); > *PpiList = gPlatformPpiTable; > } > + > +/** > + Derermine the product ID. > + > + Determine the product ID by using the data in the Platform ID Descriptor HOB > + to lookup for a matching product ID. > + > + @retval Zero Failed identify platform. > + @retval Others ARM_RD_PRODUCT_ID of the identified platform. > +**/ > +UINT8 > +SgiGetProductId ( > + VOID [SAMI] Allign VOID at 2 spaces from the start of the line. [/SAMI] > + ) > +{ > + VOID *SystemIdHob; > + UINT8 Idx; > + SGI_PLATFORM_DESCRIPTOR *HobData; > + > + SystemIdHob = GetFirstGuidHob (&gArmSgiPlatformIdDescriptorGuid); > + if (SystemIdHob == NULL) { > + return UnknownId; > + } > + > + HobData = (SGI_PLATFORM_DESCRIPTOR *)GET_GUID_HOB_DATA (SystemIdHob); > + > + for (Idx = 0; Idx < ARRAY_SIZE (SgiProductIdLookup); Idx++) { > + if ((HobData->PlatformId == SgiProductIdLookup[Idx].PlatformId) && > + (HobData->ConfigId == SgiProductIdLookup[Idx].ConfigId) && > + (HobData->MultiChipMode == SgiProductIdLookup[Idx].MultiChipMode)) { > + return SgiProductIdLookup[Idx].ProductId; > + } > + } > + > + return UnknownId; > +}