From patchwork Thu Aug 22 21:15:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13774228 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 81E1BC3DA4A for ; Thu, 22 Aug 2024 21:24:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=yuXlqDSYDpr9/oVTEnUFwGZpPkaiFm6TeUkeevk8Ge4=; b=yeJpfNY7VD0lXj TAHftCadSeRHDYalRnPCwB72Mb34P4VvD43GxfmEW+L24LdVm6H4urfL0lfTRpDIVIwBeTTZoIFLC leA7ed3bN6/pNdzcyD12Xfwje0HBNfdVDOiSurADqys5vznN1Q1mGPuO5iRasX6xMub89cao2Xg2q I1H1TYFDMIVBSWQz/BGPX9CLekESXa/wdKT5Oe+QdItYZ43Q9/SV7VBLeQXtEXHYrgSWiGEIqzmKN xCcPOlfJ7ffUo/V16HbJjwU/DJMoTB9sDrW5BJaNcR8kWzANFqmkNnko8XB/M9t3nCMhwU/3R+WRe op+x1JhQipcplhqb5zEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shFIU-0000000ELhK-3jht; Thu, 22 Aug 2024 21:24:46 +0000 Received: from sender4-pp-f112.zoho.com ([136.143.188.112]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shFIQ-0000000ELg4-3Ng9; Thu, 22 Aug 2024 21:24:44 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1724361874; cv=none; d=zohomail.com; s=zohoarc; b=KsM/Aicte0O3wbRU8ZNhz2ZFlBGDMpKJoZX4khZuNwD3U/jw3hqtiL5dsaqXgsSiYmwjYHRahPcKdZojqK1sbYxPmKw1cMtAEE4a09PHFnkA82WQEc7el7muV53UALF0Tpf0fGMeRKsP0Ag73s50bU8wlbtUitp3Cg9ouGtGCFU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724361874; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=U3Q3VhQHQ/S9J4oJ9vFhburznxZd296yZsat0qO4gXc=; b=UdIyT4Ou7NvPvreAmHMyM2rqqXPugld3M6IdgVBHvykuu6b1s71jLEsPmHj4U+mLXxsUtqmrLwF00aJYISHwoREXIwPbqDVSsHHfyaUxGB5h2Oq3UwEaTS8hEXNwHA7GfSPfPBmcJXjUDsyX8jafJZnQl9YlcWUmUbb/ePHntUI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=detlev.casanova@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1724361874; s=zohomail; d=collabora.com; i=detlev.casanova@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=U3Q3VhQHQ/S9J4oJ9vFhburznxZd296yZsat0qO4gXc=; b=Ey+uSNBzyRG7LwVYhuEFHyc4TMMzy4swFeKVLDMDya2BIPsJ6lXOe/wjNllwp8Nf NoKijpDz4SgS8nTvwDTQ+3jHXDSB/XPVcKJ8V3+RYdX6h5t5xYsEkrBM3YLuYHvy37F ngmt+04DTVWBRUDODPFnNmB5yle91ptvtdwRMEBs= Received: by mx.zohomail.com with SMTPS id 1724361873146805.6918577651234; Thu, 22 Aug 2024 14:24:33 -0700 (PDT) From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Jaehoon Chung , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, kernel@collabora.com, Detlev Casanova Subject: [PATCH v4 0/4] Add dw_mmc support for rk3576 Date: Thu, 22 Aug 2024 17:15:30 -0400 Message-ID: <20240822212418.982927-1-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-ZohoMailClient: External X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240822_142442_931282_0BDDEE62 X-CRM114-Status: GOOD ( 13.50 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The SD card controller on the rk3576 SoC stores the phase settings into the dw_mmc controller, so the code has to be adapted to implement that. Although the feature can be detected through the USRID register value, the decision to use it is based on the compatible. The compatible for rk3576 is added in its own group of compatible to mark that all devices compatible with rk3576 have internal phase settings and don't have the ciu-drive and ciu-sample clocks. Changes since v3: - Remove internal phase auto detection - Set compatible in own block, with own dt_parse function - Add internal_phase variable - Use function to set clock parameters based on internal_phase variable instead of multiple ifs - Use different commit for skipping phases higher than 270 Changes since v2: - Drop rockchip,v2-tuning and use compatible-based detection - Fix coding style Changes since v1: - Renamed use-v2-tuning to v2-tuning - Rewrite v2-tuning description as the hardware feature Detlev. Detlev Casanova (2): dt-bindings: mmc: Add support for rk3576 dw-mshc mmc: dw_mmc-rockchip: Add support for rk3576 SoCs Shawn Lin (2): mmc: dw_mmc-rockchip: Add internal phase support mmc: dw_mmc-rockchip: Skip all phases bigger than 270 degrees .../bindings/mmc/rockchip-dw-mshc.yaml | 2 + drivers/mmc/host/dw_mmc-rockchip.c | 220 ++++++++++++++++-- 2 files changed, 207 insertions(+), 15 deletions(-)