From nobody Mon Dec 23 13:36:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1515406046802567.302870189891; Mon, 8 Jan 2018 02:07:26 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3E0F8222A54D4; Mon, 8 Jan 2018 02:02:13 -0800 (PST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0076.outbound.protection.outlook.com [104.47.37.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E6717222275A3 for ; Mon, 8 Jan 2018 02:02:11 -0800 (PST) Received: from BN6PR03CA0024.namprd03.prod.outlook.com (10.168.230.162) by CO2PR03MB2358.namprd03.prod.outlook.com (10.166.93.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Mon, 8 Jan 2018 10:07:20 +0000 Received: from BL2FFO11OLC009.protection.gbl (2a01:111:f400:7c09::102) by BN6PR03CA0024.outlook.office365.com (2603:10b6:404:23::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Mon, 8 Jan 2018 10:07:19 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11OLC009.mail.protection.outlook.com (10.173.160.145) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Mon, 8 Jan 2018 10:06:50 +0000 Received: from uefi-OptiPlex-790.ap.freescale.net (uefi-OptiPlex-790.ap.freescale.net [10.232.132.78]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w08A7CjO014903; Mon, 8 Jan 2018 03:07:17 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.37.76; helo=nam02-cy1-obe.outbound.protection.outlook.com; envelope-from=meenakshi.aggarwal@nxp.com; receiver=edk2-devel@lists.01.org Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; From: Meenakshi Aggarwal To: , , , Date: Mon, 8 Jan 2018 21:25:11 +0530 Message-ID: <1515426912-13557-2-git-send-email-meenakshi.aggarwal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515426912-13557-1-git-send-email-meenakshi.aggarwal@nxp.com> References: <1513945005-30002-1-git-send-email-meenakshi.aggarwal@nxp.com> <1515426912-13557-1-git-send-email-meenakshi.aggarwal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131598796104777669; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(346002)(396003)(376002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(97736004)(36756003)(305945005)(51416003)(68736007)(53936002)(77096006)(5660300001)(105606002)(106466001)(966005)(47776003)(59450400001)(498600001)(76176011)(48376002)(356003)(50466002)(15188155005)(16586007)(316002)(104016004)(2201001)(16799955002)(110136005)(54906003)(50226002)(85426001)(8936002)(81156014)(81166006)(8676002)(53376002)(4326008)(6306002)(2950100002)(6666003)(86362001)(575784001)(8656006)(2906002)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2358; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC009; 1:g8W1o0dHQHw+LEabJesihHYei0KaCJKAXqbn1CjjWC4LjkyjJlHQhxzAbmYzJTo0SuLl7XQC+gIYdaxUUyFbbF+pYNhyrGb2OXZCZQPGQJxO4Qw/UnFkevbRQxFuvCeD MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: af143977-191f-469f-5e6c-08d5567f8926 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CO2PR03MB2358; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2358; 3:w70vT8DoCaBy7MDLTCV0blJCtoQ84zJ9iNmUSj0qgQ1jQbg7LG6+kJ2uenXP2VsdcfDWnaIOpPJmOgvbkl0vjo3PxpjF5BaVdfH66x5m5y4OIU3Prz0DIrIqhp2Dbb9CKR3ie9CUWRjjjDDGPXW4cX01JfSVIJYiTFhifh+CoQcnJ9DReR6bqZbLY7wm2p34nl7HYpFa69S/Jlkc5VrInJ6NaEdfMvqKSyCe2Iu7QR0F0ftCGkQ0aJsERrRLP1++MK3nIagu3QvuqB4JHVifTJ4pUPUfROfKmiuTzJKWeOOV/wGRm6jB12kbcSHDRAHBzTfty/6jOb2EbL4WZPTS80FhECu4TEgtV7XRtFjMw1o=; 25:0r8AIdgu8JDT05XtOnsNh/CIw7lN2+qHD1F4xY7nw7kRqxupRw4yAz9ccH+SPOBGO1C1WlESQYJo+h+krMdEKG99fHL2a7ZGFToyKQTPZGo5qQNjxSJeFUGDqBa0pKruRxFWVO7H8LEHs/tIS2aflwGe4snBYImgf/Ayd4t7bJP4lUVick9xPfQOKQDitS+vS8PStFYi+NlHHL8hX0538+QCbRwKsLiQbZ0osEs432wprJFlykHq948B2SLIYQetZLcU500J68WAV5vz3HGKRNR6ZW9wb/xCFBnH5g+e/UmZERE+pPibM99lI2z3V9cdB02/ldwYGlMOg1/3BpmWpg== X-MS-TrafficTypeDiagnostic: CO2PR03MB2358: X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2358; 31:99IExBKwrzUagLxiYgt2Z40PFqqcs2dHQqKmPmdBPHJbnZoQocsuFy+5IzR7vKE3akXRz2OPigU3KuG1a9epSLWeIb69fHwcmgoaH9w2NubGSvXp7x0fzzEwCgeBlC6AT0ZcRA92RI+YQemGgV+//6XuubIkuTJAWcverA7cce/7TAIbSTfeqRyEz9QJ99KA4fwr6YWC7+qYOreOUIbrRxNTJnjkcmkzblBghmYcHT4=; 4:WMK1SZT/l54C2qjDU9ae1t+56FM51RVJsfLeNMG+y9lJkrn5UyslNfYajAnggcsZZy1NT/Mn3gbHUTW//c/QGk3pVmty9k9tIuQR+ltnAr1u0wVDY7cdgXAlbHuBJdzRL267dZl4aJ4QarLhe9Q7oeJNmwyzq26Z+FcGsEaro6k+nVvZJ5sKWKYrVJ5je9avf6YIGxEaMKHwwqXliMesLpio/qWqd2vd9zEcJFlPgCm5WQaeujhbRu4Ge77LRxd93f/uS8YOfhJF1lm+Q26Y0KCk64Bo1IscDC32KS4x1FbB56wlk59HQllRoe34XdvyiLT04Yq8opWQn3zAkuBCcdNwv+/QHqcC+SdXgdW7tDE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(21532816269658); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(10201501046)(6055026)(6096035)(20161123563025)(20161123565025)(20161123556025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123561025)(20161123559100)(201708071742011); SRVR:CO2PR03MB2358; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CO2PR03MB2358; X-Forefront-PRVS: 054642504A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2358; 23:C9/NYXwLpuakKwbAJ9GeUM0XoVQIyYufMl9zx9MBF?= =?us-ascii?Q?45MD9cI0bji0V33GajpsJkAHoBhzz9sloHvJQzHZ2k/5Bac0FuPE+59+NnF7?= =?us-ascii?Q?5l79Hq+TG4jUufB/7QNqrEuDrlPH0dtnjShy0pjMYhKj0jveYo0D65SccWZE?= =?us-ascii?Q?/fnmvWay3bMNUELGwlu6yD97Qmrk2JE9DB1f5vkdGoX1m9WgFfH4mp9HoSpN?= =?us-ascii?Q?tXboF+B+Xjbi+pnmwobOPnhrIf0o4t6OpZqFTlg7l8SXRt5UTA2VTGM2Pgsd?= =?us-ascii?Q?DFh4LC8g/995d39hQD0QM5gQjB6err/WhyI5znLowQ2ffncm2v09L/MeC2aI?= =?us-ascii?Q?/ZGd9lVztB8+RA9RBnScFndD2SooxeZ681Qm3GCMPsbQH+GpB4YPTr7FyME+?= =?us-ascii?Q?VTNZWGZs//kD0MfCznPAaWX2CfFEV+fFsxioAYwpUPGYx0pr8kwsuVBMFC4S?= =?us-ascii?Q?REsRo5Qs2qMy5XicIEdQBRfFar3oBNQwYBV3IX6Jy0rfp8rCK1c9nUySl6TU?= =?us-ascii?Q?OsRb9Sytcx4R+hgT8GGYBkdOpR045xkOkNfXJQGQK98rz0D+igXjKdaZo9l0?= =?us-ascii?Q?XBjoE2gyDM6AeSksdPNWpLIGYE+CbiltZoI+fkABRFZUnpnr07iZgsNWzKaE?= =?us-ascii?Q?pui9NlUWY6OqXT+QqQMe/uHJnhELkVC10MogA+/qmo47DPFmU1OuNZpsw2/r?= =?us-ascii?Q?32wStSflxKNqhGn3qk+6V3fbOX661PMoeDoacP4gmyGaVLEmWYJr4fSwkyt0?= =?us-ascii?Q?n3MXGglsnDT+GNPIzmpTW/0kpZXrpZ5QpnQT2WELitjVw4rolFFpOxd6TRGo?= =?us-ascii?Q?QB3Pb+CT+1uHqdmyyddhlUR8x6lpEWTzNNXu/j8/Mf2KlUqnHpk2qmRVbOhi?= =?us-ascii?Q?Ie1cFVHMRl3vB7voU9tMAOzzdrOgVOeNmkgKUzBVkUQTZbFsKGtlNyCrFqPR?= =?us-ascii?Q?GQvgSITcScaUmtaNOZ0cwONa6BNFeXTAJMJsIBZvMYzPthrlbDijElEnnXEr?= =?us-ascii?Q?RfcivdD5HpRj09UYpBS3ZVQT8MsHN7l/nAKlwJmyT1sHemc6WyPUfBiU+k1L?= =?us-ascii?Q?Sxv+0xIRRXzMn4clnSexLzhN1AU3zYxYjPyVrJb7Nkja3maN0gMyf0RItUYO?= =?us-ascii?Q?zlQwnRcPtCBPnI9wzoh7N3Ez5b8vVhmJHvfOnS6g/LXo51GZgWzddqmtgpSK?= =?us-ascii?Q?nHtgLNlrCSxRAppR/HmvirQ5gl6dcuD0Y12Mm/vUMaZLJSCU4QkLStvz4Way?= =?us-ascii?Q?9HYDiu5zqCVCEbjcpI=3D?= X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2358; 6:zp+j15LlY/p/ClCXkE9vyeol99/r30YWTN5G3msS1BX/2cOZo7cF1Ev3TzgmVGfGRXmxIfjg94AMI2p7W8oOwdq17UHDLwocT0YmNObMrwgOGfOUePXAOfKvBLaMVF7KPChY4c8E1v0cZ9kS36G89KPt5+6KMqHbdcE8ABnO9xFVW6NOvCmcQLYlBHTSS3BNoBL30ck2ag6SivnAG1AgmsfurafwRTCqNZ7igCfQycHSv8EkxWe5rG3RX1c+34TYMsMpLC1OAD/CGAK7JsDr7Nk2sBBv/KOkYLPJio3EUaL9QLcc8nLzDTNRBdZYkI0cQUE31l1Nh3AlIzm3d3vZp6L6JfJy6I/avqaGR9GC2LQ=; 5:9GVUa5pDFi3q4miYvu7TDcSmjHDBCKiU8HxOCY3OacX0anSGJ+l80NzJZcxn1yLXwCYDc3IzBD1TPOE9nzPteuEL8S4r8HWDbLuCz8uIKlOO5vgY3dBpZxJeVIxWmfnuHzpV8ppFQNQ/VTp5USgFdulB9+VSZ/oGAE87CUAWz4c=; 24:B7e++svtNbAiHDWBBrjPZdFuuQRAnchgH2FzQB0SJ04V53dKkPsH/KdIKobRL6K5G3yeX5NJPpj58ms3iIEU7Lx5pc/+Z4yCLMT4sYz4uNQ=; 7:nlfxSXSKiqXPAcwA8Jv4z7RC6kfha726wmR3+MQDl6FixJki1iHxAXpPEkjVHYXljSx76x9K9uLfXIqvaLYcTYt+tvjFx+nSL5guXPjwLrrbnI1CMKqRaLfa1gR83tn06SSbSv+YncqBG8cIBeSnfmIspYMz1xLbRIbHtGe+9Ewf/Nyp2smcR/uP+rqQCEGqEMAEamFuwyvqm4DZTe/B3ImciAT4iDTI4sfeke/7uS1SXIjKauO7NfUOHW09OCyF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2018 10:06:50.3061 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af143977-191f-469f-5e6c-08d5567f8926 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR03MB2358 Subject: [edk2] [PATCH edk2-platforms v2 1/2] SATA : Added SATA controller driver. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch adds support of SATA controller, which Initialize SATA controller, apply platform specific errata and Register itself as NonDiscoverableMmioDevice Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Meenakshi Aggarwal --- Platform/NXP/Drivers/SataInitDxe/SataInit.c | 285 +++++++++++++++++++= ++++ Platform/NXP/Drivers/SataInitDxe/SataInit.h | 36 +++ Platform/NXP/Drivers/SataInitDxe/SataInitDxe.inf | 52 +++++ Platform/NXP/NxpQoriqLs.dec | 14 +- Platform/NXP/NxpQoriqLs.dsc | 13 ++ 5 files changed, 398 insertions(+), 2 deletions(-) create mode 100644 Platform/NXP/Drivers/SataInitDxe/SataInit.c create mode 100644 Platform/NXP/Drivers/SataInitDxe/SataInit.h create mode 100644 Platform/NXP/Drivers/SataInitDxe/SataInitDxe.inf diff --git a/Platform/NXP/Drivers/SataInitDxe/SataInit.c b/Platform/NXP/Dri= vers/SataInitDxe/SataInit.c new file mode 100644 index 0000000..bac390b --- /dev/null +++ b/Platform/NXP/Drivers/SataInitDxe/SataInit.c @@ -0,0 +1,285 @@ +/** @file + This driver module adds SATA controller support. + + Copyright 2017 NXP + + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may be= found + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + + **/ + +#include +#include +#include +#include +#include +#include +#include + +#include "SataInit.h" + +STATIC VOID *mDriverEventRegistration; + +/** + Read AHCI Operation register. + + @param PciIo The PCI IO protocol instance. + @param Offset The operation register offset. + + @return The register content read. +**/ + +UINT32 +EFIAPI +AhciReadReg ( + IN EFI_PCI_IO_PROTOCOL *PciIo, + IN UINT32 Offset + ) +{ + UINT32 Data; + + ASSERT (PciIo !=3D NULL); + + Data =3D 0; + + PciIo->Mem.Read ( + PciIo, + EfiPciIoWidthUint32, + AHCI_BAR_INDEX, + (UINT64) Offset, + 1, + &Data + ); + + return Data; +} + +/** + Write AHCI Operation register. + + @param PciIo The PCI IO protocol instance. + @param Offset The operation register offset. + @param Data The data used to write down. + +**/ +VOID +EFIAPI +AhciWriteReg ( + IN EFI_PCI_IO_PROTOCOL *PciIo, + IN UINT32 Offset, + IN UINT32 Data + ) +{ + ASSERT (PciIo !=3D NULL); + + PciIo->Mem.Write ( + PciIo, + EfiPciIoWidthUint32, + AHCI_BAR_INDEX, + (UINT64) Offset, + 1, + &Data + ); + + return; +} + +STATIC +VOID +PciIoRegistrationEvent ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EFI_STATUS Status; + UINTN HandleCount; + UINTN Address; + UINT32 Count; + UINT32 Data; + UINT8 PciClass; + UINT8 PciSubClass; + EFI_PCI_IO_PROTOCOL *PciIo; + EFI_HANDLE *HandleBuf; + + PciIo =3D NULL; + + Status =3D gBS->LocateHandleBuffer ( + ByProtocol, + &gEfiPciIoProtocolGuid, + NULL, + &HandleCount, + &HandleBuf); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Sata controller is not able to locate gEfiPciIoP= rotocolGuid 0x%x\n", + Status)); + return; + } + + for (Count =3D 0; Count < HandleCount; Count++) { + Status =3D gBS->OpenProtocol ( + HandleBuf[Count], + &gEfiPciIoProtocolGuid, + (VOID **) &PciIo, + NULL, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (EFI_ERROR (Status)) { + continue; + } + + // + // Now further check the PCI header: Base class (offset 0x0B) and + // Sub Class (offset 0x0A). This controller should be an Ide controller + // + Status =3D PciIo->Pci.Read ( + PciIo, + EfiPciIoWidthUint8, + PCI_CLASSCODE_OFFSET + 2, + 1, + &PciClass + ); + if (EFI_ERROR (Status)) { + continue; + } + + Status =3D PciIo->Pci.Read ( + PciIo, + EfiPciIoWidthUint8, + PCI_CLASSCODE_OFFSET + 1, + 1, + &PciSubClass + ); + if (EFI_ERROR (Status)) { + continue; + } + + // + // Examine Ide PCI Configuration table fields + // + if ((PciClass !=3D PCI_CLASS_MASS_STORAGE) || + (PciSubClass !=3D PCI_CLASS_MASS_STORAGE_SATADPA)) { + continue; + } + + Status =3D PciIo->Pci.Read ( + PciIo, + EfiPciIoWidthUint32, + PCI_AHCI_BASE_ADDRESS, + 1, + &Address + ); + if (EFI_ERROR (Status)) { + continue; + } else if (Address =3D=3D (UINTN)Context) { + gBS->CloseEvent (Event); + + // + // configuring Physical Control Layer parameters for Port 0 + // + AhciWriteReg (PciIo, SATA_PPCFG, PORT_PHYSICAL); + + // + // This register controls the configuration of the + // Transport Layer for Port 0 + // Errata Description : The default Rx watermark value may be insuff= icient for some + // hard drives and result in a false CRC or internal errors. + // Workaround: Change PTC[RXWM] field at offset 0xC8 to 0x29. Do not= change + // the other reserved fields of the register. + // + + Data =3D AhciReadReg (PciIo, SATA_PTC); + if (PcdGetBool (PcdSataErratumA009185)) { + Data |=3D PORT_RXWM; + } else { + Data |=3D PORT_TRANSPORT; + } + AhciWriteReg (PciIo, SATA_PTC, Data); + + break; + } + } + + gBS->FreePool (HandleBuf); + + return; +} + +/** + The Entry Point of module. It follows the standard UEFI driver model. + + @param[in] ImageHandle The firmware allocated handle for the EFI image. + @param[in] SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval other Some error occurs when executing this entry poi= nt. + +**/ +EFI_STATUS +EFIAPI +InitializeSataController ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + UINT32 NumSataController; + UINTN ControllerAddr; + + Status =3D EFI_SUCCESS; + NumSataController =3D PcdGet32 (PcdNumSataController); + + // + // Impact : The SATA controller does not detect some hard drives reliabl= y with + // the default SerDes register setting. + // Workaround : write value 0x80104e20 to 0x1eb1300 (serdes 2) + // + if (PcdGetBool (PcdSataErratumA010554)) { + BeMmioWrite32 ((UINTN)SERDES2_SATA_ERRATA, 0x80104e20); + } + + // + // Impact : Device may see false CRC errors causing unreliable SATA oper= ation. + // Workaround : write 0x80000000 to the address 0x20140520 (dcsr). + // + if (PcdGetBool (PcdSataErratumA010635)) { + BeMmioWrite32 ((UINTN)DCSR_SATA_ERRATA, 0x80000000); + } + + while (NumSataController) { + NumSataController--; + ControllerAddr =3D PcdGet32 (PcdSataBaseAddr) + + (NumSataController * PcdGet32 (PcdSataSize)); + + Status =3D RegisterNonDiscoverableMmioDevice ( + NonDiscoverableDeviceTypeAhci, + NonDiscoverableDeviceDmaTypeNonCoherent, + NULL, + NULL, + 1, + ControllerAddr, PcdGet32 (PcdSataSize) + ); + + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Failed to register SATA device (0x%x) with err= or 0x%x \n", + ControllerAddr, Status)); + } else { + // + // Register a protocol registration notification callback on the dri= ver + // binding protocol so we can attempt to connect to it as soon as it= appears. + // + EfiCreateProtocolNotifyEvent ( + &gEfiPciIoProtocolGuid, + TPL_CALLBACK, + PciIoRegistrationEvent, + (VOID *)ControllerAddr, + &mDriverEventRegistration); + } + } + + return Status; +} diff --git a/Platform/NXP/Drivers/SataInitDxe/SataInit.h b/Platform/NXP/Dri= vers/SataInitDxe/SataInit.h new file mode 100644 index 0000000..7fe6273 --- /dev/null +++ b/Platform/NXP/Drivers/SataInitDxe/SataInit.h @@ -0,0 +1,36 @@ +/** @file + Header file for Sata Controller initialization driver. + + Copyright 2017 NXP + + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may be= found + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + + **/ + +#ifndef _SATA_INIT_H_ +#define _SATA_INIT_H_ + + +#define AHCI_BAR_INDEX 0x05 +// +// Offset for AHCI base address in PCI Header +// +#define PCI_AHCI_BASE_ADDRESS 0x24 + +#define SATA_PPCFG 0xA8 +#define SATA_PTC 0xC8 + +#define PORT_PHYSICAL 0xA003FFFE +#define PORT_TRANSPORT 0x08000025 +#define PORT_RXWM 0x08000029 + +#define DCSR_SATA_ERRATA 0x20140520 +#define SERDES2_SATA_ERRATA 0x01eb1300 + +#endif diff --git a/Platform/NXP/Drivers/SataInitDxe/SataInitDxe.inf b/Platform/NX= P/Drivers/SataInitDxe/SataInitDxe.inf new file mode 100644 index 0000000..82535f4 --- /dev/null +++ b/Platform/NXP/Drivers/SataInitDxe/SataInitDxe.inf @@ -0,0 +1,52 @@ +## @file +# Component description file for the Sata Controller initialization driver +# +# Copyright 2017 NXP +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD License +# which accompanies this distribution. The full text of the license may b= e found +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +## + +[Defines] + INF_VERSION =3D 0x0001000A + BASE_NAME =3D SataInit + FILE_GUID =3D 021722D8-522B-4079-852A-FE44C2C13F49 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D InitializeSataController + +[Sources] + SataInit.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + Platform/NXP/NxpQoriqLs.dec + +[LibraryClasses] + BeIoLib + DebugLib + NonDiscoverableDeviceRegistrationLib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiLib + +[FixedPcd] + gNxpQoriqLsTokenSpaceGuid.PcdNumSataController + gNxpQoriqLsTokenSpaceGuid.PcdSataBaseAddr + gNxpQoriqLsTokenSpaceGuid.PcdSataSize + gNxpQoriqLsTokenSpaceGuid.PcdSataErratumA009185 + gNxpQoriqLsTokenSpaceGuid.PcdSataErratumA010554 + gNxpQoriqLsTokenSpaceGuid.PcdSataErratumA010635 + +[Protocols] + gEfiPciIoProtocolGuid + +[Depex] + TRUE diff --git a/Platform/NXP/NxpQoriqLs.dec b/Platform/NXP/NxpQoriqLs.dec index bd4273f..65d659e 100644 --- a/Platform/NXP/NxpQoriqLs.dec +++ b/Platform/NXP/NxpQoriqLs.dec @@ -52,8 +52,8 @@ gNxpQoriqLsTokenSpaceGuid.PcdI2c1BaseAddr|0|UINT64|0x0000010E gNxpQoriqLsTokenSpaceGuid.PcdI2c2BaseAddr|0|UINT64|0x0000010F gNxpQoriqLsTokenSpaceGuid.PcdI2c3BaseAddr|0|UINT64|0x00000110 - gNxpQoriqLsTokenSpaceGuid.PcdSataController1BaseAddress|0x0|UINT32|0x000= 00111 - gNxpQoriqLsTokenSpaceGuid.PcdSataController2BaseAddress|0x0|UINT32|0x000= 00112 + gNxpQoriqLsTokenSpaceGuid.PcdSataBaseAddr|0x0|UINT32|0x00000111 + gNxpQoriqLsTokenSpaceGuid.PcdSataSize|0x0|UINT32|0x00000112 gNxpQoriqLsTokenSpaceGuid.PcdQmanSwpBaseAddr|0x0500000000|UINT64|0x00000= 113 gNxpQoriqLsTokenSpaceGuid.PcdQmanSwpSize|0x0080000000|UINT64|0x00000114 gNxpQoriqLsTokenSpaceGuid.PcdBmanSwpBaseAddr|0x0508000000|UINT64|0x00000= 115 @@ -83,6 +83,8 @@ gNxpQoriqLsTokenSpaceGuid.PcdCcsrBaseAddr|0x01000000|UINT64|0x0000012D gNxpQoriqLsTokenSpaceGuid.PcdCcsrSize|0x0F000000|UINT64|0x0000012E gNxpQoriqLsTokenSpaceGuid.PcdDramMemSize|0x0|UINT64|0x0000012F + gNxpQoriqLsTokenSpaceGuid.PcdDcsrBaseAddr|0x0|UINT64|0x00000130 + gNxpQoriqLsTokenSpaceGuid.PcdDcsrSize|0x0|UINT64|0x00000131 =20 # # DSPI Pcds @@ -156,6 +158,9 @@ gNxpQoriqLsTokenSpaceGuid.PcdErratumA008514|FALSE|BOOLEAN|0x00000275 gNxpQoriqLsTokenSpaceGuid.PcdErratumA008336|FALSE|BOOLEAN|0x00000276 gNxpQoriqLsTokenSpaceGuid.PcdSataErratumA009185|FALSE|BOOLEAN|0x00000277 + gNxpQoriqLsTokenSpaceGuid.PcdSataErratumA010554|FALSE|BOOLEAN|0x00000278 + gNxpQoriqLsTokenSpaceGuid.PcdSataErratumA010635|FALSE|BOOLEAN|0x00000279 + gNxpQoriqLsTokenSpaceGuid.PcdSataErratumA008402|FALSE|BOOLEAN|0x0000027A =20 # # Test PCDs @@ -249,3 +254,8 @@ # gNxpQoriqLsTokenSpaceGuid.PcdSysEepromI2cBus|0|UINT32|0x0000330 gNxpQoriqLsTokenSpaceGuid.PcdSysEepromI2cAddress|0|UINT32|0x0000331 + + # + # SATA Pcds + # + gNxpQoriqLsTokenSpaceGuid.PcdNumSataController|0x0|UINT32|0x00000340 diff --git a/Platform/NXP/NxpQoriqLs.dsc b/Platform/NXP/NxpQoriqLs.dsc index 10eff06..c3c0eb1 100644 --- a/Platform/NXP/NxpQoriqLs.dsc +++ b/Platform/NXP/NxpQoriqLs.dsc @@ -99,6 +99,8 @@ VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf + UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf + NonDiscoverableDeviceRegistrationLib|MdeModulePkg/Library/NonDiscoverabl= eDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.inf =20 [LibraryClasses.common.SEC] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf @@ -144,6 +146,7 @@ SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeS= ecurityManagementLib.inf PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.= inf MemoryInitPeiLib|ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.inf + NonDiscoverableDeviceRegistrationLib|MdeModulePkg/Library/NonDiscoverabl= eDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.inf =20 [LibraryClasses.common.UEFI_APPLICATION] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf @@ -334,6 +337,16 @@ } =20 # + # AHCI Support + # + MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf + MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf + MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf + MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf + MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf + MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDevic= eDxe.inf + + # # Architectural Protocols # ArmPkg/Drivers/CpuDxe/CpuDxe.inf --=20 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Mon Dec 23 13:36:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1515406050623868.2026138048232; Mon, 8 Jan 2018 02:07:30 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A6192222D155C; Mon, 8 Jan 2018 02:02:18 -0800 (PST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0079.outbound.protection.outlook.com [104.47.40.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 74431222275A3 for ; Mon, 8 Jan 2018 02:02:17 -0800 (PST) Received: from BN6PR03CA0009.namprd03.prod.outlook.com (2603:10b6:404:23::19) by SN2PR03MB2368.namprd03.prod.outlook.com (2603:10b6:804:e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Mon, 8 Jan 2018 10:07:26 +0000 Received: from BY2FFO11FD005.protection.gbl (2a01:111:f400:7c0c::190) by BN6PR03CA0009.outlook.office365.com (2603:10b6:404:23::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Mon, 8 Jan 2018 10:07:25 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD005.mail.protection.outlook.com (10.1.14.126) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Mon, 8 Jan 2018 10:06:55 +0000 Received: from uefi-OptiPlex-790.ap.freescale.net (uefi-OptiPlex-790.ap.freescale.net [10.232.132.78]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w08A7CjP014903; Mon, 8 Jan 2018 03:07:22 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.40.79; helo=nam03-co1-obe.outbound.protection.outlook.com; envelope-from=meenakshi.aggarwal@nxp.com; receiver=edk2-devel@lists.01.org Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; From: Meenakshi Aggarwal To: , , , Date: Mon, 8 Jan 2018 21:25:12 +0530 Message-ID: <1515426912-13557-3-git-send-email-meenakshi.aggarwal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515426912-13557-1-git-send-email-meenakshi.aggarwal@nxp.com> References: <1513945005-30002-1-git-send-email-meenakshi.aggarwal@nxp.com> <1515426912-13557-1-git-send-email-meenakshi.aggarwal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131598796156503011; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(346002)(396003)(39380400002)(376002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(2906002)(36756003)(68736007)(77096006)(48376002)(8676002)(50226002)(110136005)(47776003)(81156014)(97736004)(305945005)(54906003)(4326008)(16586007)(316002)(6666003)(59450400001)(81166006)(2950100002)(104016004)(8656006)(5660300001)(76176011)(86362001)(575784001)(50466002)(2201001)(85426001)(105606002)(51416003)(356003)(53936002)(106466001)(498600001)(8936002)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2368; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD005; 1:ihu5B5zhOGOjPiYz95AGI8D/zLScYoYeCJj9aQxz3xam9J2YEnKxK81GUZnRXve9cRZRQDAnvt7UBWwcfArozmFdoEiGA/CDFuFphDZAdIsh+EmDcyCKq06R2Tv1oOd6 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3e4977d0-b0b5-41d9-03e3-08d5567f8c3e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:SN2PR03MB2368; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2368; 3:lQw7sjcsdd/0LnLnp3V4zLBK+SQqYNSWnS7aLC3DtVvUdZN70EsNaybcJ/GURGF5hCb6Y/2b4lTTKHHuUmfpQjwoXlRopepW+4CoLLxyhfutncfbKfrPlC87Kd+O8lKuIDF/SmHzi/KcppVWKNl6dQttwBUhwGaELw+kTMtBwtmHyfR6BkwP70gSF0b/81DRSGlheBolJx+I2sMwg4TTlsc5OTWehDFwLX5kb6JCtG+hdWcyt/35PuJ0Wsw5FYuwukgjlZyMSKVlOEou3mKUHtwINsy9pbI5/0T0q7Dy3ZM36835jQH0lNBkKQ8shMgMVQyiYBTI3Nc71rO3efFjE6VJN1AVXd0Hp9xp6gAatd0=; 25:ElGR3T4/w+rvuWRcJ2tdhAq88WW4N7F2i6LojwXFIMPrI5JoRY9b9hWHp7Z5BcVfW6LuAgeHUK4PDey5dur0hFaX5dng0VxVT760S18WdgbsdRmEcEukIAIoN4DJKGAgAqI4XVT+vSctiKVN/fusjpmdRrKdfrS4TQBZmx1EMlsUy/YLD6gjYcLsMrXYbOuio5E7GUp4QmgsDpnV2GtwJnN4fVGur+pzQ/ZWknPdr1M6xx9XkylJW4Rb2wCsyaH5OhiTRKwbF6LWLVk77K7oLCzZ+1bkqQ+EnkSO+xmnMeGjJQfzflM7MnZB2a2Xh4IfJRwS0gRtWurOgIzRoGuoPg== X-MS-TrafficTypeDiagnostic: SN2PR03MB2368: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2368; 31:yvw1YdHRC4/UA2zII+6rktsFgIW8AAMaYs28+BavLbFZo0QhLmfwgiRiso0Az+Eu1zy72lsVzPrTjOUiI1Bg8cwcmgnoAEjxWYJ5qV9/f/w03tOq4wjX+5Y1LhzJD1D6ef6Knb5WUiXkRvqrn61Wq9bhV4zEkjbsRKeeOd4LSE9+CT5o9pFhAo+A+pfJsixkGxwqK4z4S8LseMLNgxJrBE0tiJZU5WM2AqMXqh7BG20=; 4:aKuk6dbpsxawGQwUTDVYlrq+HzRnqwZdiH5KsIUBOYYl8u5IYuI193Oex27uMdveIxyDz+C5uW62DvygqECU7zaOFxwrz+4mCGpKdY6LjlokqJHWSCnzL/ahMpxKIhzVCB90/2bL5HslmwVb5xN3rq41MlJugWHmsfQR1dlHf64bDSGHmwQjlY4ejLPGoV6831MFl8Kht/LkeJsA5Gv8MDHrWJd+B3GMo/5PcuhOGYhYRNODrijwS7nqhSpwGdEZxyd8/te/inPUvPzdaNFwoLUy0P4VcCDXXltd6Sd/5PudW6kS2DHXsQoI/uecFqqY X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(6055026)(6096035)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123563025)(20161123565025)(20161123556025)(20161123559100)(20161123561025)(201708071742011); SRVR:SN2PR03MB2368; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:SN2PR03MB2368; X-Forefront-PRVS: 054642504A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2368; 23:vVfqXRMS001OStsSbuauMa8VlcvoGbbJYnERL6fwD?= =?us-ascii?Q?tpH7tWNNEXKA13bY9fJbWed/gVmLKrwPAadxGyFqmQQlb1tJZnvfdCitZKOz?= =?us-ascii?Q?oiJ4VHFvPh/BHjofduZlCrCQTp9JtySwXclbJYLoa1yO6AqsSMGnSVVtDN3a?= =?us-ascii?Q?tHwF06Nl1lt276vmozQhBgoyAj+QNk/7VOeeqODpoQSBZtyF/bfjmpHIEqlb?= =?us-ascii?Q?VJVfzrKdx/sLbN/Yli13m4k+OQ5yQAEHwykqs5ss7BrcullP9Ys4ySp+EHdB?= =?us-ascii?Q?kffE4jcHVGqA2b4bAdOdO1XgVslLTKqjdOxAjK4adGTNLDiyKCGJCbE+qRx+?= =?us-ascii?Q?dvd7+6sE6ScTBvYJW74Kv1bgdzexKpgJiXgTTJqasePNtEbR6E0+GATCiF3t?= =?us-ascii?Q?H8WbZmkJC4oDQdd5A0lBk7ll1iEp40dDJ7eqQWvPbEOyyvODEHqevhotzZBu?= =?us-ascii?Q?tMB3XBZgeQG8SeqmRO8mCVPAgj9uMYdf0lHiQg99iAsI5xm8oTN5UEv40Qoi?= =?us-ascii?Q?qrlAG3TFbZhQuxiyqmcC0yfB43Ek90lLtcK4psCfNjGjdJ/0TAd0xtY2eubf?= =?us-ascii?Q?yNaRaCuCrdxH4UJuzkKmBGDhWMuCnoemoGqh9f0/zVnrdj6i2/EZpMucoVbx?= =?us-ascii?Q?MjCr1ZhfdTXJKX7QIGz+DDJRkpyQXtQsCA3XaKgm6dmX4s3ySaPcT3+V0LYC?= =?us-ascii?Q?5UQe9SlZG+s0VbGOmgg8eQG/xysitBMdmyipQtrc9EuqaAvBK8YOUu5x3W/D?= =?us-ascii?Q?iu05xDs5d34Um6ZHvhL+P6lqNp8CfbG7niDFMmaP9AeS9VzhT1GR/Ci2JEd/?= =?us-ascii?Q?ILztmSmWFsIZJ0OIxR5Ow3AhKi9hrmp+1b2EP9VzKrje8hW9KlI/TdnpOSe+?= =?us-ascii?Q?Wb2mFsloKuOQXXMy3TmooZzoCRdCX3dEigyfzP0NEVSkk+Qw12309zpOWvTA?= =?us-ascii?Q?86dFn3yT8TQEW4igABRLG8WLoXRwuj8z1Xrdxz/mYJCPU3K6D04xQ5C1bICQ?= =?us-ascii?Q?U1Rv52i0mXYMPTjnkDMf8S4KseywikESNYrar9zI/Sydouhr8yLCIi3ESk23?= =?us-ascii?Q?pMdEudEQVzruTeMW1t99Q/3kMbvXOf7bEl5w9NKi5ATXVi6vEVS3ESNzuk8x?= =?us-ascii?Q?Pp2sLEpleaNRVyhUUSRQh7J1Vw64e7J?= X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2368; 6:IF0HDf4Lm7scAPbaubvVsuuYcDwHHgSR7OqyA+GjPpAn1Z9UDskq2YP143KCb1SI588o8N4Ty/37dpLf9aU9dnr1EoYlUttCEj9vXvyitWtnoidYY9cl1Bj/aQK8MC/HN1g0tiU0atC6Rti6miENoSlo/+f91sVnKXjxDSeHmL3jITJUn/v7tFHZuRGH3KeDATYsQC3Z50JsGaIxhXCxam1ij5UOMWBZjY+GXYenKdFFDsf1Tu4PpAcSSJafI51ibcOALXuwBxKdfebnsmx76vJFbhQdKslhQCK21NA4fPxZ2I++rhWw+nQUML0LiU/dGoHaj/5rmfVCtLV3s6H5+HAqXGtq4gzlRz9ymVZMVOk=; 5:3dmK7TWVcMnMWujJniEnn8CIpdl77AlLM5MOHwZGyYu15xV+w7rh1DfNHeXm/PkwoPPAUeBOUvTrVQ1Vqgpj1HMz1TjhccJC6t6ICLRfstaMFNRSSkqOoj7sGzRIRgR23WutRjyaGTbSHAWJ7Sdsqi5CmWwOSGHkT6QG5uXxJh0=; 24:kFEM7yLddwcLJWKTHhrrJAFOb30gUr+FuUHPgZFqIITjmR+YzgGaAsATDM6JjLW2EMdp7CTF2GGznsJE+OGimzNhPzT1f4l0/YCFGGlgYjE=; 7:7sk+a8bHHYnq9gdQJiKlorgDjxP+kdQihFbfTQwPY5d8fL/eQlcHJF8k4oGSFb9jjrEvXNAHNc/oQrj1F9zor8eWiaDxjDYsJW8+KLJCQQNBQj9umK1GWy91jkyKcJamFvNnplGQgQ2qfBmtesZs2YTPP0lwjLRpdYr3irIpINjl0nPUD2XdTUBB0g7KQgjWIQZ73oVQI5G50HMuhlDZXeRXun3/Xc7wOVlVBKQ7ho2MuCvUN6osaqmXVEkD85Vs SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2018 10:06:55.4631 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3e4977d0-b0b5-41d9-03e3-08d5567f8c3e X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2368 Subject: [edk2] [PATCH edk2-platforms v2 2/2] LS1046 : Enable support of SATA controller X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Enable support of SATA drives on ls1046 board. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Meenakshi Aggarwal --- Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.dsc | 8 ++++++++ Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.fdf | 12 ++++++++= ++++ .../NXP/LS1046aRdbPkg/Library/PlatformLib/ArmPlatformLib.inf | 2 ++ .../NXP/LS1046aRdbPkg/Library/PlatformLib/NxpQoriqLsMem.c | 8 ++++++++ Silicon/NXP/LS1046A/LS1046A.dsc | 5 +++++ 5 files changed, 35 insertions(+) diff --git a/Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.dsc b/Platform/NXP/LS= 1046aRdbPkg/LS1046aRdbPkg.dsc index 9d2482b..93fc848 100644 --- a/Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.dsc +++ b/Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.dsc @@ -63,6 +63,13 @@ # gNxpQoriqLsTokenSpaceGuid.PcdI2cSlaveAddress|0x51 =20 + # + # Errata Pcds + # + gNxpQoriqLsTokenSpaceGuid.PcdSataErratumA009185|TRUE + gNxpQoriqLsTokenSpaceGuid.PcdSataErratumA010554|TRUE + gNxpQoriqLsTokenSpaceGuid.PcdSataErratumA010635|TRUE + ##########################################################################= ###### # # Components Section - list of all EDK II Modules needed by this Platform @@ -71,3 +78,4 @@ [Components.common] edk2-platforms/Platform/NXP/Drivers/WatchDog/WatchDogDxe.inf edk2-platforms/Platform/NXP/Drivers/I2cDxe/I2cDxe.inf + edk2-platforms/Platform/NXP/Drivers/SataInitDxe/SataInitDxe.inf diff --git a/Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.fdf b/Platform/NXP/LS= 1046aRdbPkg/LS1046aRdbPkg.fdf index 169cef0..23b46ad 100644 --- a/Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.fdf +++ b/Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.fdf @@ -142,6 +142,18 @@ READ_LOCK_STATUS =3D TRUE =20 INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.= inf =20 + # + # AHCI Support + # + INF MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf + INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf + INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf + INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf + INF MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf + INF MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciD= eviceDxe.inf + + INF edk2-platforms/Platform/NXP/Drivers/SataInitDxe/SataInitDxe.inf + # FAT filesystem + GPT/MBR partitioning # INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.i= nf diff --git a/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/ArmPlatformLib.= inf b/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/ArmPlatformLib.inf index 13a0ffb..002294e 100644 --- a/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/ArmPlatformLib.inf +++ b/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/ArmPlatformLib.inf @@ -68,3 +68,5 @@ gNxpQoriqLsTokenSpaceGuid.PcdDram3Size gNxpQoriqLsTokenSpaceGuid.PcdQspiRegionBaseAddr gNxpQoriqLsTokenSpaceGuid.PcdQspiRegionSize + gNxpQoriqLsTokenSpaceGuid.PcdDcsrBaseAddr + gNxpQoriqLsTokenSpaceGuid.PcdDcsrSize diff --git a/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/NxpQoriqLsMem.c= b/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/NxpQoriqLsMem.c index 7022528..4b04ff5 100644 --- a/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/NxpQoriqLsMem.c +++ b/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/NxpQoriqLsMem.c @@ -49,6 +49,8 @@ #define DRAM3_SIZE FixedPcdGet64 (PcdDram3Size) #define QSPI_REGION_BASE_ADDR FixedPcdGet64 (PcdQspiRegionBaseAddr) #define QSPI_REGION_SIZE FixedPcdGet64 (PcdQspiRegionSize) +#define DCSR_BASE_ADDR FixedPcdGet64 (PcdDcsrBaseAddr) +#define DCSR_SIZE FixedPcdGet64 (PcdDcsrSize) =20 =20 /** @@ -169,6 +171,12 @@ ArmPlatformGetVirtualMemoryMap ( VirtualMemoryTable[Index].Length =3D QSPI_REGION_SIZE; VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_U= NCACHED_UNBUFFERED; =20 + // DCSR Space + VirtualMemoryTable[++Index].PhysicalBase =3D DCSR_BASE_ADDR; + VirtualMemoryTable[Index].VirtualBase =3D DCSR_BASE_ADDR; + VirtualMemoryTable[Index].Length =3D DCSR_SIZE; + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; + // End of Table VirtualMemoryTable[++Index].PhysicalBase =3D 0; VirtualMemoryTable[Index].VirtualBase =3D 0; diff --git a/Silicon/NXP/LS1046A/LS1046A.dsc b/Silicon/NXP/LS1046A/LS1046A.= dsc index 4e7230a..33c57ad 100644 --- a/Silicon/NXP/LS1046A/LS1046A.dsc +++ b/Silicon/NXP/LS1046A/LS1046A.dsc @@ -74,5 +74,10 @@ gNxpQoriqLsTokenSpaceGuid.PcdI2c2BaseAddr|0x021A0000 gNxpQoriqLsTokenSpaceGuid.PcdI2c3BaseAddr|0x021B0000 gNxpQoriqLsTokenSpaceGuid.PcdNumI2cController|4 + gNxpQoriqLsTokenSpaceGuid.PcdDcsrBaseAddr|0x20000000 + gNxpQoriqLsTokenSpaceGuid.PcdDcsrSize|0x04000000 + gNxpQoriqLsTokenSpaceGuid.PcdSataBaseAddr|0x3200000 + gNxpQoriqLsTokenSpaceGuid.PcdSataSize|0x10000 + gNxpQoriqLsTokenSpaceGuid.PcdNumSataController|0x1 =20 ## --=20 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel