From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.80]) by mx.groups.io with SMTP id smtpd.web10.6105.1636122128109978261 for ; Fri, 05 Nov 2021 07:22:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=V0nZpn+h; spf=pass (domain: arm.com, ip: 40.107.20.80, mailfrom: khasim.mohammed@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=IW6oro9UBXyT7Ce4RRTthL1mLd8bN4C/I2tptin7A9s=; b=V0nZpn+h7G1uLd1ma16+UJ8leYIAXrYq7HBPAqmWEUgXi56W9GjsMpCnJUZ+yB58/7S0VL6x0T+MX90KTtsawv3YRSgaWWoiUfx6fB+MGE4e6PKM5148vp50dDYjRyFUrOvvwILWyRKka3ZzjnIVY1fLz/rIRVRnM9yh3Rbr4ZE= Received: from DB7PR05CA0026.eurprd05.prod.outlook.com (2603:10a6:10:36::39) by HE1PR0802MB2492.eurprd08.prod.outlook.com (2603:10a6:3:df::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Fri, 5 Nov 2021 14:22:05 +0000 Received: from DB5EUR03FT063.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:36:cafe::5f) by DB7PR05CA0026.outlook.office365.com (2603:10a6:10:36::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Fri, 5 Nov 2021 14:22:05 +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=armh.onmicrosoft.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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT063.mail.protection.outlook.com (10.152.20.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Fri, 5 Nov 2021 14:22:05 +0000 Received: ("Tessian outbound 6ebd41198c5d:v108"); Fri, 05 Nov 2021 14:22:05 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 97968c406bff108b X-CR-MTA-TID: 64aa7808 Received: from 8028b8c83a9c.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C13D884C-9AB8-41EB-9FB2-25DC66E1B4BD.1; Fri, 05 Nov 2021 14:21:57 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8028b8c83a9c.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 05 Nov 2021 14:21:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vgkdda0gdZtmX2CShIZG0H3OCfoUG0LYLrg02ghVVIGSmVSk1WipsjmDERsieddc6T0uZFKBPTm/W9csXbTHrTDSPe+DoV0cOx8T+iFS09vcURT72c5/JJU8f2Ot9nOv9H7cIgp1ysKuLgyWi4sH4AAJBtQ6Deq2h4MRqkyNoGSJxtHRvLtHejbGuJb9Ullk0nTX8T3+382AbyGznrIQuWQJOUf2ZUh8UIqoC8o85L0YEIetD3iVQ5a9D56i/G0YdVdD09sthPqeg9hEwFX5C/IGsfeBoJRfbA361FrIRu7zozgqWqIIrUi5Xrd6NeiNcNpW2Zm3Gl+DHfiRzbWvIQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IW6oro9UBXyT7Ce4RRTthL1mLd8bN4C/I2tptin7A9s=; b=f0p9KXwbiDsaKOaa7Bbql05ZOqlgdZNN1EhC1Ek8k9SE8ht2bjR+gBvN6NDw9JjOmBCS+Wl8TfAOXEvLyE8w9xvbt/bMf/1cxCDjJX1wqjnH6p8r9rgUo24LqfmG65Vs40dV0KftTP3vzwtNGZNoMj+rKYFCe6Yq1BNlRV4nt38rwIfoIyBMK5Hl2NCV8dOwhIs4GScyAONeSH5HQZmCKGa8mMToXYCFB9z1Jf5wqFd+vc7wGG+Xnt47bzbdoqnKpW3tGEaME28I6M1BpsOTCITbb/twBgCDz5DjtOGgp2kvDtHnCp2nugVeNCupKIO2y5GP0FH+0xumDo43KVLz1g== 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=IW6oro9UBXyT7Ce4RRTthL1mLd8bN4C/I2tptin7A9s=; b=V0nZpn+h7G1uLd1ma16+UJ8leYIAXrYq7HBPAqmWEUgXi56W9GjsMpCnJUZ+yB58/7S0VL6x0T+MX90KTtsawv3YRSgaWWoiUfx6fB+MGE4e6PKM5148vp50dDYjRyFUrOvvwILWyRKka3ZzjnIVY1fLz/rIRVRnM9yh3Rbr4ZE= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from PA4PR08MB5902.eurprd08.prod.outlook.com (2603:10a6:102:e0::10) by PA4PR08MB6094.eurprd08.prod.outlook.com (2603:10a6:102:f0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.19; Fri, 5 Nov 2021 14:21:53 +0000 Received: from PA4PR08MB5902.eurprd08.prod.outlook.com ([fe80::d02e:f1e5:1354:622e]) by PA4PR08MB5902.eurprd08.prod.outlook.com ([fe80::d02e:f1e5:1354:622e%9]) with mapi id 15.20.4669.011; Fri, 5 Nov 2021 14:21:53 +0000 From: "Khasim Mohammed" To: devel@edk2.groups.io Cc: nd@arm.com, Khasim Syed Mohammed , Deepak Pandey Subject: [PATCH v5 3/7] Platform/ARM/N1Sdp: Introduce platform DXE driver Date: Fri, 5 Nov 2021 19:51:23 +0530 Message-Id: <20211105142127.21616-3-khasim.mohammed@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211105142127.21616-1-khasim.mohammed@arm.com> References: <20211105142127.21616-1-khasim.mohammed@arm.com> X-ClientProxiedBy: BMXPR01CA0045.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::31) To PA4PR08MB5902.eurprd08.prod.outlook.com (2603:10a6:102:e0::10) MIME-Version: 1.0 Received: from e116623.arm.com (217.140.105.53) by BMXPR01CA0045.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Fri, 5 Nov 2021 14:21:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be9b3e45-fdcb-4a8f-d7dc-08d9a067a4a0 X-MS-TrafficTypeDiagnostic: PA4PR08MB6094:|HE1PR0802MB2492: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7691;OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: sg8g8ICtw4felEuPC8iEPRX+p7efSApnzMaX4yIlF0cbouqK3iMJ/JZsNiwQ9KxGOvrFYe71JVsN/qCLdPktSk4uGAGptnhNwUTweNDYrMRvkkNFW2iq5X5y/DJ5tKcWLXH+zO/E2w3LuN9dVYAgXFfx25bchCwDpnHmJRWh9bvOyW2HezzV6sY/eYrFWVjVmqSXntxuU2N/zNYJlXCSYB7ALEL0ks1eJGvVNd59dqQYEjLbcgOoiOUjU7RZh+8yW3JwJ+xiUv/mzReueiP5HHc+bm1guCR8Lxrxh0etp4vmejMmQI2ocZKn/sSV+O181ESUZLLpURoJtX7ksrqMn9nmoQ3Y3Sb0T37K2uW4kdhsHX/tmWyQp0zh/sFiGqGfOTNzmNKBlVElAxtoWsByT55qkz4+CGX+E7JOeN84ngnkT3HgkkU7QEHo7HgRVVyUvU+Nx3pPJydkKvtuiA3nNiPBTv3aWh+mAzhuFN0o8cx7w3tSdRgeGgerf6Bk0zR74zTrHwdAJ8YZcILzn0/SWxwojHTZGWGxQE3Z1QXAfTrG0A7m4MuZIDVfVgWjjnpErveLDHjbim6oUGX1cFLO1ggfji+KunYBXAJr2hjGDjCzyZBdWE9xNOP5nx7D/xbvZvCC8EO9ElIItdt3yTB8YEtQ1f+DPeeXYoAzogE49CEjK8Es+u+9I3gN6Ev7FW5fZE1iM6vUKwzY8Smc4No09A== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR08MB5902.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(54906003)(6486002)(38350700002)(19627235002)(6666004)(52116002)(5660300002)(7696005)(316002)(6916009)(26005)(8936002)(2906002)(66476007)(1076003)(38100700002)(8676002)(66556008)(2616005)(83380400001)(956004)(508600001)(66946007)(86362001)(4326008)(186003)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6094 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Khasim.Mohammed@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 5301c5da-a32a-4ecf-0076-08d9a0679d2f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a9NSedx1nj3hNeVO9wzD9ZhQcLOdBLI7IBiOCKHBlpuVp6GQJUzW+mS7VIZulhuzdZRv9MfdugYgmeSKXI8OGACeu8WNCqjluDPFfPCf31OZj5IczO/z8lfvSTNnSchF2uNuFObKS6pwUM3XK32Nqj/2vqosII5bp94RGfqNwcwmUXLIjm5ABiLAYNRIxAXyr5zFqmRfAvBQScQKBUbdYug4qtySBbJawNZAuvymTKuun+Fq26lhu9tBwK+M2WXdqHTrI6Vx0RvJFVF1xuhKRR12aqDItdD+5f2jjP0Gl45b0Vlbsb84pylMCJVOqrwZA4uDH33kfr4oXXeGUeAGYRINfc6j2H4B/8yVJHKq7NGtNEhGwWUe9o5wej53NgvUqPXvQeBipUQ4rJYG36t8yfJsCEv9wGrKIzQ4bDOm9j2kxl0CIQjAxLifAf7K3UM9xRYpNAifvahTxHNNrpTk+crcoqEgUNj+CaW1D1hRRn6+j01aNLBRgi7XKlxUQytr9qsXtgjocHMJGCtTOmyBOyFB9fo7t11b9v7N77k3fuR80i3skVdDf0k8WKpRPDcgCk1WSE2vq4/WVC1Z4jx/vaMEaycWYchwY53/8HJhk+/xW8kFPQrOVkibEF1GC0zGOtLp1OTX/49HAj3HV+FiC1yz/LEAM7DDCoDdRadqnwlx8sIyqKMmoteqxtX0fURfpPYQ8d/ZK4Dm5GIM5jAqkA== 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)(36840700001)(46966006)(19627235002)(6916009)(83380400001)(956004)(70206006)(1076003)(336012)(7696005)(508600001)(4326008)(36756003)(70586007)(186003)(5660300002)(26005)(2616005)(6666004)(6486002)(8676002)(47076005)(86362001)(54906003)(2906002)(81166007)(82310400003)(8936002)(356005)(36860700001)(316002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2021 14:22:05.3645 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: be9b3e45-fdcb-4a8f-d7dc-08d9a067a4a0 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: DB5EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2492 Content-Type: text/plain Add an initial platform DXE driver and support for ramdisk devices. Signed-off-by: Deepak Pandey Signed-off-by: Khasim Syed Mohammed --- .../N1Sdp/Drivers/PlatformDxe/PlatformDxe.c | 59 +++++++++++++++++++ .../N1Sdp/Drivers/PlatformDxe/PlatformDxe.inf | 47 +++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 Platform/ARM/N1Sdp/Drivers/PlatformDxe/PlatformDxe.c create mode 100644 Platform/ARM/N1Sdp/Drivers/PlatformDxe/PlatformDxe.inf diff --git a/Platform/ARM/N1Sdp/Drivers/PlatformDxe/PlatformDxe.c b/Platform/ARM/N1Sdp/Drivers/PlatformDxe/PlatformDxe.c new file mode 100644 index 0000000000..3f975fa5ac --- /dev/null +++ b/Platform/ARM/N1Sdp/Drivers/PlatformDxe/PlatformDxe.c @@ -0,0 +1,59 @@ +/** @file + + Copyright (c) 2021, ARM Limited. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include + +/** + Entrypoint of Platform Dxe Driver + + @param ImageHandle[in] The firmware allocated handle for the EFI image. + @param SystemTable[in] A pointer to the EFI System Table. + + @retval EFI_SUCCESS The RAM disk has been registered. + @retval EFI_NOT_FOUND No RAM disk protocol instances were found. + @retval EFI_UNSUPPORTED The ImageType is not supported. + @retval Others Unexpected error happened. + +**/ +EFI_STATUS +EFIAPI +ArmN1SdpEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + EFI_RAM_DISK_PROTOCOL *RamDisk; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + + Status = EFI_UNSUPPORTED; + if (FeaturePcdGet (PcdRamDiskSupported)) { + Status = gBS->LocateProtocol (&gEfiRamDiskProtocolGuid, NULL, + (VOID**) &RamDisk); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Couldn't find the RAM Disk protocol - %r\n", + __FUNCTION__, Status)); + return Status; + } + + Status = RamDisk->Register ( + (UINTN)PcdGet32 (PcdRamDiskBase), + (UINTN)PcdGet32 (PcdRamDiskSize), + &gEfiVirtualCdGuid, + NULL, + &DevicePath + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Failed to register RAM Disk - %r\n", + __FUNCTION__, Status)); + } + } + return Status; +} diff --git a/Platform/ARM/N1Sdp/Drivers/PlatformDxe/PlatformDxe.inf b/Platform/ARM/N1Sdp/Drivers/PlatformDxe/PlatformDxe.inf new file mode 100644 index 0000000000..d74f09b46c --- /dev/null +++ b/Platform/ARM/N1Sdp/Drivers/PlatformDxe/PlatformDxe.inf @@ -0,0 +1,47 @@ +## @file +# Platform DXE driver for N1Sdp +# +# Copyright (c) 2021, ARM Limited. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x0001001B + BASE_NAME = PlatformDxe + FILE_GUID = 116dcefb-aa53-46aa-81cd-49581684db55 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + ENTRY_POINT = ArmN1SdpEntryPoint + +[Sources.common] + PlatformDxe.c + +[Packages] + ArmPkg/ArmPkg.dec + ArmPlatformPkg/ArmPlatformPkg.dec + EmbeddedPkg/EmbeddedPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Platform/ARM/N1Sdp/N1SdpPlatform.dec + +[LibraryClasses] + HobLib + UefiDriverEntryPoint + +[Protocols] + gEfiRamDiskProtocolGuid + +[Guids] + gEfiVirtualCdGuid ## SOMETIMES_CONSUMES ## GUID + +[FeaturePcd] + gArmN1SdpTokenSpaceGuid.PcdRamDiskSupported + +[FixedPcd] + gArmN1SdpTokenSpaceGuid.PcdRamDiskBase + gArmN1SdpTokenSpaceGuid.PcdRamDiskSize + +[Depex] + gEfiRamDiskProtocolGuid -- 2.17.1