From nobody Mon Feb 9 09:51:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+74258+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+74258+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1618822175; cv=none; d=zohomail.com; s=zohoarc; b=CHDnLRiik+enEzxBW8fkWwPfU3rgGqvJKZQa6VirNuiS1r+nsX+kE4kVXsvIXC8MPhDO4jsFtflpvyd+vEe9YycWAmeoPEf+AC9YFfFNhDLdsp8DtcZIEJh5cGbN96GXJjj96r+cH97sIMUiWmGYZp0hXx+CO4gxi5HHd0rdeas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618822175; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=2SJWBMRhksswn6BRbAgl/kvWZ3LqAJe6f3FfQfsKSEU=; b=WWmugt+RhIGBXT4VzoUNRUqwJVja0MhGaxORJ39IEuQUAp4tNX0BLyD9jUbCypH4Uq4h+jQfB/y9iBNYYMBOECEiWbIUlK6LGml+J7VfxHX9ytvfYxJtZvj4z+gU5ACDdw5iFG7dioW/UT+HL1semmMKtUXOORxhkOxEabDcd8c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+74258+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1618822175397701.6850221754664; Mon, 19 Apr 2021 01:49:35 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 7kVCYY1788612xTHbeATl9q8; Mon, 19 Apr 2021 01:49:35 -0700 X-Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) by mx.groups.io with SMTP id smtpd.web08.6351.1618822174346299656 for ; Mon, 19 Apr 2021 01:49:34 -0700 X-Received: by mail-ed1-f42.google.com with SMTP id e7so39579614edu.10 for ; Mon, 19 Apr 2021 01:49:34 -0700 (PDT) X-Gm-Message-State: ya5R7qoWZXQcfienaLSwWbihx1787277AA= X-Google-Smtp-Source: ABdhPJyWuN+m8/APtfRMGcdk4hPSr4Bh3mYcZ/Rui/BrxC1GXQtTVoRKhfPdZ/NL31tAgQ2T7LKNJw== X-Received: by 2002:aa7:dac5:: with SMTP id x5mr23982384eds.286.1618822172956; Mon, 19 Apr 2021 01:49:32 -0700 (PDT) X-Received: from gilgamesh.semihalf.com (host-193.106.246.138.static.3s.pl. [193.106.246.138]) by smtp.gmail.com with ESMTPSA id z17sm12351102edx.36.2021.04.19.01.49.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 01:49:32 -0700 (PDT) From: "Marcin Wojtas" To: devel@edk2.groups.io Cc: leif@nuviainc.com, ardb+tianocore@kernel.org, mw@semihalf.com, jaz@semihalf.com, kostap@marvell.com, upstream@semihalf.com Subject: [edk2-devel] [edk2-platforms PATCH 5/6] Marvell/Cn913xDb: Update AP807 MMC settings Date: Mon, 19 Apr 2021 10:49:00 +0200 Message-Id: <20210419084901.380576-6-mw@semihalf.com> In-Reply-To: <20210419084901.380576-1-mw@semihalf.com> References: <20210419084901.380576-1-mw@semihalf.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mw@semihalf.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1618822175; bh=5A5cXc7Wo2xNUSU87dQ4ldPcdN5VENOR2/K/FCrq78g=; h=Cc:Date:From:Reply-To:Subject:To; b=AkHciRpsokhFX0m55xLHQZyhSqTTyL/Imu/ZoO35OaBHWpzbRS86QcHviZ6Wyc95ZgM JryfBz3wOAb0ufqyrzgTXqlI6o6lDWslvsvV4NEFjqCwYto4JXXvXTaqydNGT0l0ksjLD jFOVTfLbhdvOl3Br8tnvjubuYF/4zozhrm4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" This patch enables switching to 1.8V power supply on the VCCQ rail of the AP807 MMC interface, which allows to operate at HS400 when booting with ACPI. Since there are issues with this mode in EDK2 Xenon SD/MMC driver apply a workaround, that limits the mode to HS200 by forcing bus width to 4. Signed-off-by: Marcin Wojtas --- Platform/Marvell/Cn913xDb/NonDiscoverableInitLib/NonDiscoverableInitLib.h = | 1 + Platform/Marvell/Cn913xDb/BoardDescriptionLib/Cn9130DbABoardDescLib.c = | 8 +++++-- Platform/Marvell/Cn913xDb/NonDiscoverableInitLib/NonDiscoverableInitLib.c = | 23 ++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Platform/Marvell/Cn913xDb/NonDiscoverableInitLib/NonDiscoverab= leInitLib.h b/Platform/Marvell/Cn913xDb/NonDiscoverableInitLib/NonDiscovera= bleInitLib.h index a641420ef7..00449d4390 100644 --- a/Platform/Marvell/Cn913xDb/NonDiscoverableInitLib/NonDiscoverableInitL= ib.h +++ b/Platform/Marvell/Cn913xDb/NonDiscoverableInitLib/NonDiscoverableInitL= ib.h @@ -13,6 +13,7 @@ #define CN9130_DB_VBUS0_LIMIT_PIN 4 #define CN9130_DB_VBUS1_PIN 1 #define CN9130_DB_VBUS1_LIMIT_PIN 5 +#define CN9130_DB_AP_MMC_VCCQ_PIN 8 #define CN9130_DB_SDMMC_VCC_PIN 14 #define CN9130_DB_SDMMC_VCCQ_PIN 15 #define CN9131_DB_VBUS0_PIN 3 diff --git a/Platform/Marvell/Cn913xDb/BoardDescriptionLib/Cn9130DbABoardDe= scLib.c b/Platform/Marvell/Cn913xDb/BoardDescriptionLib/Cn9130DbABoardDescL= ib.c index 2b46d141cd..2755600f53 100644 --- a/Platform/Marvell/Cn913xDb/BoardDescriptionLib/Cn9130DbABoardDescLib.c +++ b/Platform/Marvell/Cn913xDb/BoardDescriptionLib/Cn9130DbABoardDescLib.c @@ -95,8 +95,12 @@ MV_BOARD_SDMMC_DESC mSdMmcDescTemplate[] =3D { { /* eMMC 0xF06E0000 */ 0, /* SOC will be filled by MvBoardDescDxe */ 0, /* SdMmcDevCount will be filled by MvBoardDescDxe */ - FALSE, /* Xenon1v8Enabled */ - TRUE, /* Xenon8BitBusEnabled */ + TRUE, /* Xenon1v8Enabled */ + /* + * Force 4-bit bus width - work-around for non + * functional HS400 mode. + */ + FALSE, /* Xenon8BitBusEnabled */ FALSE, /* XenonSlowModeEnabled */ 0x40, /* XenonTuningStepDivisor */ EmbeddedSlot /* SlotType */ diff --git a/Platform/Marvell/Cn913xDb/NonDiscoverableInitLib/NonDiscoverab= leInitLib.c b/Platform/Marvell/Cn913xDb/NonDiscoverableInitLib/NonDiscovera= bleInitLib.c index 42dc54a892..965d8efe57 100644 --- a/Platform/Marvell/Cn913xDb/NonDiscoverableInitLib/NonDiscoverableInitL= ib.c +++ b/Platform/Marvell/Cn913xDb/NonDiscoverableInitLib/NonDiscoverableInitL= ib.c @@ -157,6 +157,27 @@ Cp2XhciInit ( MV_GPIO_DRIVER_TYPE_SOC_CONTROLLER); } =20 +STATIC CONST MV_GPIO_PIN mApSdMmcPins[] =3D { + { + MV_GPIO_DRIVER_TYPE_PCA95XX, + CN9130_DB_IO_EXPANDER0, + CN9130_DB_AP_MMC_VCCQ_PIN, + TRUE, + }, +}; + +STATIC +EFI_STATUS +EFIAPI +ApSdMmcInit ( + IN NON_DISCOVERABLE_DEVICE *This + ) +{ + return ConfigurePins (mApSdMmcPins, + ARRAY_SIZE (mApSdMmcPins), + MV_GPIO_DRIVER_TYPE_PCA95XX); +} + STATIC CONST MV_GPIO_PIN mCp0SdMmcPins[] =3D { { MV_GPIO_DRIVER_TYPE_PCA95XX, @@ -206,6 +227,8 @@ NonDiscoverableDeviceInitializerGet ( =20 if (Type =3D=3D NonDiscoverableDeviceTypeSdhci) { switch (Index) { + case 0: + return ApSdMmcInit; case 1: return Cp0SdMmcInit; } --=20 2.29.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#74258): https://edk2.groups.io/g/devel/message/74258 Mute This Topic: https://groups.io/mt/82204169/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-