From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx.groups.io with SMTP id smtpd.web12.11227.1619615043973039997 for ; Wed, 28 Apr 2021 06:04:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EVERd96n; spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org) Received: by mail.kernel.org (Postfix) with ESMTPSA id 41DBC610A5 for ; Wed, 28 Apr 2021 13:04:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619615043; bh=OKDEtCCCgBQpmfBLolh2E3A48WT9wn1ywJNvvVVyq5E=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=EVERd96nltChW47wTd5QO4LLIg0e69XPDoaixslk9eIrHDh4pE1k4yweuD2rM3opj AZ2y5NHfpQO42QJifc6ArSyLv24bsJMQzZF8zOCyAUcPeH4pvGE2ZodZr0HWbIdFkW akDWpoSbAL/T8e6Nf1+IJNspMYREfg/S+9dazeE3L9GZIm8Dly/A+sHsMaQel5l50f NVhfC726UpTpNZ3UOnW4hJOI/jpLztiSGUVVSsn/PG4BoB/hcPMlF3A4xGDlG0WeFC Gl5fdgEeKCWgkJnYo9rENOuCU4Akhv/UADXJR56Dp7bLCdJeohPVFB3l2qxtg6xN1M NIl/l9tm9TQ9Q== Received: by mail-oi1-f177.google.com with SMTP id l17so31640667oil.11 for ; Wed, 28 Apr 2021 06:04:03 -0700 (PDT) X-Gm-Message-State: AOAM5303am+HLTynh0vOtqvM9EBD2AhF+Uq9d7K8hAXwJpAlyKj6PAZ0 f1R/tub6XGtwzogrUDQTM4z5drCjMU97Su1oodk= X-Google-Smtp-Source: ABdhPJwycWhMzPMNOXGBSeZiyZxYyN3L3ry4azaYBWtwE4uyuB2/ofxid89aQ3nExTCNrCJp+rZPbxDvj33HN7uMGWM= X-Received: by 2002:aca:4fd6:: with SMTP id d205mr14019482oib.174.1619615042511; Wed, 28 Apr 2021 06:04:02 -0700 (PDT) MIME-Version: 1.0 References: <20210322032439.9312-1-tien.hock.loh@intel.com> <20210322032439.9312-2-tien.hock.loh@intel.com> <09F9E77A-9B6B-4D5F-A7FF-F49EAFA03FEB@apple.com> In-Reply-To: From: "Ard Biesheuvel" Date: Wed, 28 Apr 2021 15:03:51 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH V5 1/1] EmbeddedPkg: DwMmcHcDxe: Add support for Designware SDMMC driver To: "Kinney, Michael D" Cc: Andrew Fish , edk2-devel-groups-io , "Loh, Tien Hock" , "thloh85@gmail.com" , Leif Lindholm , Ard Biesheuvel Content-Type: text/plain; charset="UTF-8" On Tue, 27 Apr 2021 at 21:31, Kinney, Michael D wrote: > > This is an example of another approach. This module uses PCI I/O or IoLib based on the type of device. > > > > https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Bus/Pci/PciSioSerialDxe > > > > No additional protocols or lib classes/instances. Instead, the register access APIs are included in the module and based on the type of device detected, it uses PCI I/O or IoLib: > > > > https://github.com/tianocore/edk2/blob/5b90b8abb4049e2d98040f548ad23b6ab22d5d19/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c#L1327 > > https://github.com/tianocore/edk2/blob/5b90b8abb4049e2d98040f548ad23b6ab22d5d19/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c#L1358 > > > > This technique could for PCI I/O vs MMIO register access. You would need to add more APIs for the use of PCI I/O or DmaLib for DMA access. > Is it really worth the effort to rewrite this code? This patch has been circulating for a while now, and I fail to see the point of refactoring and splitting up this code, given how unlikely it is that DesignWare will ever put a real PCI frontend on this IP. The SD/MMC override protocol was intended for implementations that are almost SDHCI compliant, but have some quirks that need to be worked around.