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.53]) by mx.groups.io with SMTP id smtpd.web09.1731.1633890671781425176 for ; Sun, 10 Oct 2021 11:31:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=VBZ3tBy8; spf=pass (domain: arm.com, ip: 40.107.20.53, 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=0lsRbNa/Csk3sqZwpskl186vjzzP4NV6V+ZruPfpak8=; b=VBZ3tBy8Qe1BEl3T5TUvXTRuel6kVgssiomr+rTE4I9QY34fuRqv0xgVd0v7j3u6nqisdP77DUGozwbidIEqj23wb8EjVvKQpixDkA3kKCRa/8RNCDJRRr3Zi7F9g2byAPW1BXs8LnxIXQLzBVxv4ww/z+9cR16JHsTlf3yfblk= Received: from DB3PR08CA0006.eurprd08.prod.outlook.com (2603:10a6:8::19) by DB6PR0801MB1992.eurprd08.prod.outlook.com (2603:10a6:4:76::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Sun, 10 Oct 2021 18:31:08 +0000 Received: from DB5EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:0:cafe::15) by DB3PR08CA0006.outlook.office365.com (2603:10a6:8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.25 via Frontend Transport; Sun, 10 Oct 2021 18:31:08 +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 DB5EUR03FT059.mail.protection.outlook.com (10.152.21.175) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Sun, 10 Oct 2021 18:31:08 +0000 Received: ("Tessian outbound e27daf245730:v103"); Sun, 10 Oct 2021 18:31:08 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2edb2e80537d8cc1 X-CR-MTA-TID: 64aa7808 Received: from bffac5d04ef5.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5A725E87-CEE1-4EAE-BD1A-A1B1F5914569.1; Sun, 10 Oct 2021 18:31:01 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id bffac5d04ef5.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Sun, 10 Oct 2021 18:31:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OTn51PXoRpsy8bfp1ErRX2Cai0Uc5qajVKwwefiPbwTIhCibezNRaqgZJBdaDSuiMovC6Do0YH5mKhqp/U0ifB87Sma502pZ04V+t5wAYmx+VaXaHChLTBkie/9uWWcWWH65XdAUDw4w+mx2deRRQX76Zm5XuUuB85bBScLSZd5YtIrwpeYf8CZ3ssP4ODM8MmeIrNIiHxT342bYp7tFPScqu9UB0Oi5j+FKFcp/Yqcdx/8lXiYYIIZkEmsYCHL9Y0rhBWJKVV1iapleg7J038hUHPvrjbQsQ1EeyMQ2tJzUgclwzcuB2sIWqS7dS3VclUz4TTfk1h+Tjr8coE+O+w== 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=0lsRbNa/Csk3sqZwpskl186vjzzP4NV6V+ZruPfpak8=; b=KzNP6FMH42is/uTjV5azAiDTNpw1E49XEWQ9Cld43lf6tEpviKMzUHLBuQlLonCWYox2xOInAmOnOW29wY1GuqrzgvAyvoI1LTvTeLiYBokaIHN8vSoGqgOo1HF+vqD1XwZVinHZNmZ1cGNhgm0UGWsIM5teUD0cP0c1GDL/tcVHx/1aZh9jjoVC6YN5f2JlhbqKdCBv+g7pa/0ogsfTYI0n3FBdWNTMFnPkdnP2pxv+cetgQ/FCR5bTrvtkmCIqCSlM1jhQBkdDUnVwqd6sVpQb7vu8d5HHeAeQb8kI9Xw6riSVNSxlpvrbw3WSqW5bl91CAAvcVdKJebR6FRYccw== 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=0lsRbNa/Csk3sqZwpskl186vjzzP4NV6V+ZruPfpak8=; b=VBZ3tBy8Qe1BEl3T5TUvXTRuel6kVgssiomr+rTE4I9QY34fuRqv0xgVd0v7j3u6nqisdP77DUGozwbidIEqj23wb8EjVvKQpixDkA3kKCRa/8RNCDJRRr3Zi7F9g2byAPW1BXs8LnxIXQLzBVxv4ww/z+9cR16JHsTlf3yfblk= Authentication-Results-Original: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; Received: from PA4PR08MB5902.eurprd08.prod.outlook.com (2603:10a6:102:e0::10) by PAXPR08MB6542.eurprd08.prod.outlook.com (2603:10a6:102:158::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19; Sun, 10 Oct 2021 18:31:00 +0000 Received: from PA4PR08MB5902.eurprd08.prod.outlook.com ([fe80::e5a7:9474:4463:d258]) by PA4PR08MB5902.eurprd08.prod.outlook.com ([fe80::e5a7:9474:4463:d258%2]) with mapi id 15.20.4587.025; Sun, 10 Oct 2021 18:31:00 +0000 From: "Khasim Mohammed" To: devel@edk2.groups.io Cc: nd@arm.com, Khasim Syed Mohammed , Deepak Pandey Subject: [PATCH v2 3/7] Platform/ARM/N1Sdp: Introduce platform DXE driver Date: Sun, 10 Oct 2021 23:59:52 +0530 Message-Id: <20211010182956.13526-4-khasim.mohammed@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211010182956.13526-1-khasim.mohammed@arm.com> References: <20211010182956.13526-1-khasim.mohammed@arm.com> X-ClientProxiedBy: LO4P123CA0392.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18f::19) To PA4PR08MB5902.eurprd08.prod.outlook.com (2603:10a6:102:e0::10) MIME-Version: 1.0 Received: from e116623.arm.com (217.140.99.251) by LO4P123CA0392.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20 via Frontend Transport; Sun, 10 Oct 2021 18:30:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 585916c9-557e-4e9d-79c2-08d98c1c2074 X-MS-TrafficTypeDiagnostic: PAXPR08MB6542:|DB6PR0801MB1992: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6790;OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: /N07/8pIBpy97cUPC1AVpvM78s7jV2NYkfhfB8Tzib1T4XI0hjQisbiJAhr7ZwPBNAtwlUiSchVMa5vaAB0OAMeY3h4H4zbuw828EUKa0h3JgS1jZgRoIVgAZHDMz18YWPiqz1L20zr5UzyTktTGKnRemyUCkzRlMCqfu4xSGAZNBU+AIYrhzQxC52QlO/rNH9DaPXdXWJFJcmE8Z5nbLT+CJ+IDLHhKH7A26PxWuk3isEQCnlPBo5erW2sw2kyDQzOkkqw39apw3bOKUXwCFea7umqRRW/RIk/LD4nJHb4EjWrWnMEwGvQqgE/PwPuyXqZ/iuWsjLsNrXs8S9rGsuhj76cGn2aGGSzYHb8/UbdWJ3HGhllKaqHsNq82gr9NLLhAf79hp2U4tE5bsdE83xm6/EqoSAsesRBGM/hoFgNzfTbw2UhLrfVJ4O8eXqFLEz66QlAdq+KXrfP/QqoB8Kd51BjvgQCIsjQ4xLZgZ0YDwFJNDBSmKMbwsauc6ywa665Icdi10SqUh3TsNH7DnGwo1v/8JD3Bw10RGIoHhfedj0OIgc+I4pB1s/XvV8GrA+ajTpVmqAMUJbuPQtUXSId7H8fEowcuCJuCwPVysqi1w7fTkgis8KxVhoeUP+fdoy6jgppusgevnxjoyIetD9iS0JXWAh7IrYwXMGgYP2ZknG2oYToEGkaasJz6V3+kriT+s0Vs0wdrvqt0nN4zIg== 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)(1076003)(83380400001)(6666004)(8676002)(8936002)(956004)(2616005)(6486002)(5660300002)(26005)(38100700002)(38350700002)(66946007)(316002)(54906003)(36756003)(7696005)(186003)(52116002)(66556008)(66476007)(19627235002)(86362001)(2906002)(6916009)(508600001)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6542 Original-Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; Return-Path: Khasim.Mohammed@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 81c3faea-9ecc-4755-7bb7-08d98c1c1b96 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rWfZaOI3Ye2CdLANwyzFMEZobRHigoQ2mEO1tC4SlGj5YspWWJysxmeWeholM8yT5Qn98uF9GLrd+ubf/YDvPwhapsQ6mVGQemMFp31j/e+DpDRD8JjnZ5/wuXc4wtTuF4dBcb1i5n1F3OiA7JxhlNTD9f/ZQ815uzO8VdHyARk/uPYOtVT/9ZyqSoGaErkMwnNCiZr2QqwEQn50YXJaBPhvWossy0VaCIEBoJnN1Zhbm3whVtyC5QX+iwV1wIImfQwBhiDnCABS8ae/fslFogaLV2uBEm736rKUYaO99nxSI4EPXBNWvgqfOqGcEY1x+ZZBrVvZpjnrnjThwGHuQAVpDUWF6lyJCPNHEqaHYYoz9oRlh3pbBWrSpxzpYaoVQujWl0yMkY3VsMeO1fTXs4PEboOk4dPig3QugV6xDlExdhTy7BzsWDFh3kKuv+nf0Yu1K7OsKXKmgYNkGvoKcoswSH02lYE07mOXJatxMA0H5BX7dfpyvHwqENNZNhgynZTkw8tK1V6tcdkAHoNC+3E7qetNkt+T6uIm8oj0WC0+S3KBETg+d6IXiHTqVAq07xWy2ujBfhq6wyYDBEXfb7YOvTZlJm2wWkTIv0161u4gKiE6spcA4t9hyORu/rbSWKx6WCg6L4Fn0Q66OPNqp3sJ6NxglBrCPZRf7g0ALK/cVN3H1aiD767XKiwV/R2nCiBW23T0mxiFpAR2F3qCVw== 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)(54906003)(83380400001)(508600001)(82310400003)(19627235002)(70206006)(356005)(6916009)(8936002)(36860700001)(1076003)(47076005)(6486002)(70586007)(5660300002)(6666004)(956004)(26005)(36756003)(7696005)(2616005)(81166007)(86362001)(316002)(4326008)(2906002)(186003)(8676002)(336012);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2021 18:31:08.1038 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 585916c9-557e-4e9d-79c2-08d98c1c2074 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: DB5EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1992 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 | 51 +++++++++++++++++++ .../N1Sdp/Drivers/PlatformDxe/PlatformDxe.inf | 44 ++++++++++++++++ 2 files changed, 95 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..3abe2228ad --- /dev/null +++ b/Platform/ARM/N1Sdp/Drivers/PlatformDxe/PlatformDxe.c @@ -0,0 +1,51 @@ +/** @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 entry point is executed successfully. +**/ +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..925bde4063 --- /dev/null +++ b/Platform/ARM/N1Sdp/Drivers/PlatformDxe/PlatformDxe.inf @@ -0,0 +1,44 @@ +## @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 = 11fc8b5a-377d-47a8-aee9-0093d3d3407f + 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 + +[FeaturePcd] + gArmN1SdpTokenSpaceGuid.PcdRamDiskSupported + +[FixedPcd] + gArmN1SdpTokenSpaceGuid.PcdRamDiskBase + gArmN1SdpTokenSpaceGuid.PcdRamDiskSize + +[Depex] + gEfiRamDiskProtocolGuid -- 2.17.1