From patchwork Sun Dec 19 15:34:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 12696787 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 54593C433F5 for ; Sun, 19 Dec 2021 15:36:52 +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:References:In-Reply-To: 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: List-Owner; bh=6Ju423ub2oDre0R07hRtEFEvXMIgYRCfVzurdSzKmuI=; b=urLt1eJzx+oSiX Zz5s7txqxrXd618LpG9GvPxSQQ6AYT0oxA3+6/I/+/uTUQvz7tOX99pR9s2QfPe/o7/NlG3T3SX/v eXTEP7KhpvFRCPNiwT6Q6SJ8Jtl2vTXDVSEtjIDxiaxqD2KAFK6kJQlcY6dJGhW058nrpgciaxTzm pv7MUQWsx3kgfTP8DXp3CMRKMlb1hWhDvO3JO/Z5HDSunL3ES+9bzHbZ0/8+g7o6iUH3YsrAqpIqF 58ObMmFPzwOJZGOT5b9rWbdyvC0GBikWpgHIWGHk5gUGQTBuS0/+dx4OS/vHbQTHnGrtndq4uS4it aTDmDMvzwa/h9YlnY5pQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1myyDh-00GFMq-J5; Sun, 19 Dec 2021 15:35:29 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1myyD9-00GF3U-Vi; Sun, 19 Dec 2021 15:34:57 +0000 Received: by mail-wr1-x429.google.com with SMTP id v11so14855671wrw.10; Sun, 19 Dec 2021 07:34:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MeA65dvwLUBRiBlXrb74voXUaCWcwbuJME/G4fyM1WE=; b=LR8rz9Cc7Yg0w1IbXjVOyA50yFgAwND+RfR8wGeEOu8d3iV09J0ES+c4ehcpNvgVHg ePf5xN/1/lKNwsKEy8qsx3+sLsbeKq4XJacBnijh7eet3vQ/hBo1geY55i8aVYdIBOt5 xCDUhGvsjQpgtp7fXhcPKYqPHZLBBW+bGdYIl4Iq/p54BUEx9RAIwSqEg0b43sMsIWP7 zjfQ1e2dI2GFg3ibFnF/dx5VqdlKKwE6YMM5zxYr96dJEWeT4+RMatmYTw2P/YiKDbnd Czjg2akOp/8z9+EulFPAeW48I6MQCoLRXoCXHDxK5RaPlAViFFDbb//xj/bNo14ehrIw 2Aiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MeA65dvwLUBRiBlXrb74voXUaCWcwbuJME/G4fyM1WE=; b=PpmdR39I505XLvxX6JkKC/l1/Y+wsE732vKBU+C5VuyRG05Jf97m018ZuaN9i6Iq7Z qa86l9hF/9ILqmY8LMD2rUwt7Zeh4VAKAJQMFu1TQI9tQCUBqzsW3KK7YrxBbAEGA9N/ IfyPvmPIzQnH5pkOpIWpZcIdZLCjKQCtj2hwLI28sV8UjmwP5guUHFNwGXhusfaDorcz ac47gNiXxvWLgBtAVo+wiR5tuyKuauh21bu+9BlRHfwOdIvfiu8yNiFG1MVGuD0zrALh 8jaj+pLYeWPiICB3xWiR+GFH7d1rOTado30l/qzYT11Na2zE6TKsdqL/JRw3Q+/Dwnae 5x9Q== X-Gm-Message-State: AOAM530AJ2cY6PqvcHSaKOa9hYE4csWg6mXKGI3akqKDD5RDglegEbqt tTrSyaY8Te8O6UFEjsvsG8g= X-Google-Smtp-Source: ABdhPJwANpA9yK16E0dLSdCWIR5awSquoxmfcfjBl6sh0u8qf6+TLJTC2uJRJzY4rmt9V6rmN6dAqQ== X-Received: by 2002:a5d:6c6d:: with SMTP id r13mr9834007wrz.76.1639928094412; Sun, 19 Dec 2021 07:34:54 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c22-721d-8f00-f22f-74ff-fe21-0725.c22.pool.telefonica.de. [2a01:c22:721d:8f00:f22f:74ff:fe21:725]) by smtp.googlemail.com with ESMTPSA id d2sm9262020wrw.26.2021.12.19.07.34.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Dec 2021 07:34:54 -0800 (PST) From: Martin Blumenstingl To: linux-mmc@vger.kernel.org, linux-amlogic@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ulf.hansson@linaro.org, Martin Blumenstingl Subject: [PATCH v2 1/2] mmc: meson-mx-sdhc: Set MANUAL_STOP for multi-block SDIO commands Date: Sun, 19 Dec 2021 16:34:41 +0100 Message-Id: <20211219153442.463863-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211219153442.463863-1-martin.blumenstingl@googlemail.com> References: <20211219153442.463863-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211219_073456_048736_D5107A14 X-CRM114-Status: GOOD ( 15.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The vendor driver implements special handling for multi-block SD_IO_RW_EXTENDED (and SD_IO_RW_DIRECT) commands which have data attached to them. It sets the MANUAL_STOP bit in the MESON_SDHC_MISC register for these commands. In all other cases this bit is cleared. Here we omit SD_IO_RW_DIRECT since that command never has any data attached to it. This fixes SDIO wifi using the brcmfmac driver which reported the following error without this change on a Netxeon S82 board using a Meson8 (S802) SoC: brcmf_fw_alloc_request: using brcm/brcmfmac43362-sdio for chip BCM43362/1 brcmf_sdiod_ramrw: membytes transfer failed brcmf_sdio_download_code_file: error -110 on writing 219557 membytes at 0x00000000 brcmf_sdio_download_firmware: dongle image file download failed And with this change: brcmf_fw_alloc_request: using brcm/brcmfmac43362-sdio for chip BCM43362/1 brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available brcmf_c_preinit_dcmds: Firmware: BCM43362/1 wl0: Apr 22 2013 14:50:00 version 5.90.195.89.6 FWID 01-b30a427d Fixes: e4bf1b0970ef96 ("mmc: host: meson-mx-sdhc: new driver for the Amlogic Meson SDHC host") Signed-off-by: Martin Blumenstingl --- drivers/mmc/host/meson-mx-sdhc-mmc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/mmc/host/meson-mx-sdhc-mmc.c b/drivers/mmc/host/meson-mx-sdhc-mmc.c index 7cd9c0ec2fcf..8fdd0bbbfa21 100644 --- a/drivers/mmc/host/meson-mx-sdhc-mmc.c +++ b/drivers/mmc/host/meson-mx-sdhc-mmc.c @@ -135,6 +135,7 @@ static void meson_mx_sdhc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd) { struct meson_mx_sdhc_host *host = mmc_priv(mmc); + bool manual_stop = false; u32 ictl, send; int pack_len; @@ -172,12 +173,27 @@ static void meson_mx_sdhc_start_cmd(struct mmc_host *mmc, else /* software flush: */ ictl |= MESON_SDHC_ICTL_DATA_XFER_OK; + + /* + * Mimic the logic from the vendor driver where (only) + * SD_IO_RW_EXTENDED commands with more than one block set the + * MESON_SDHC_MISC_MANUAL_STOP bit. This fixes the firmware + * download in the brcmfmac driver for a BCM43362/1 card. + * Without this sdio_memcpy_toio() (with a size of 219557 + * bytes) times out if MESON_SDHC_MISC_MANUAL_STOP is not set. + */ + manual_stop = cmd->data->blocks > 1 && + cmd->opcode == SD_IO_RW_EXTENDED; } else { pack_len = 0; ictl |= MESON_SDHC_ICTL_RESP_OK; } + regmap_update_bits(host->regmap, MESON_SDHC_MISC, + MESON_SDHC_MISC_MANUAL_STOP, + manual_stop ? MESON_SDHC_MISC_MANUAL_STOP : 0); + if (cmd->opcode == MMC_STOP_TRANSMISSION) send |= MESON_SDHC_SEND_DATA_STOP; From patchwork Sun Dec 19 15:34:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 12696788 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 39335C433EF for ; Sun, 19 Dec 2021 15:37:12 +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:References:In-Reply-To: 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: List-Owner; bh=5Ton8UkX6ankH2de3eViLs9X5hqmpJ0vamv8f0hviKc=; b=zvvqlrCFp+tkB5 8b9GXuKXRAGckllFKEe8wVlDTDUoHWjj7c8ZUY0IAXbUoc//b+RF+iwu33jmZoW3Y1goB7jIGxrQB cxLEwHWublSgBI3D2cfW+cEEP1QYNCFuAcOOz7rRPSCrr5zA7hzxSUoyfomv7nOjWGxfZhb1cAG06 niHjdyefwO0hheRdGrffxhc2nrRKLFqjsz71l7r08BOtmrNarBtE8kBGUUnh9XrripD+IELFyRpIQ /En0VYSaDUUPIXstjD/4OBMuIpef4ZkvbGSyi3XZoMiyaFRgS37RuvkZBpTnfo+93eW4jA/zos8mf 2ouTQb/UgxaL3jUAalEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1myyE4-00GFaW-UU; Sun, 19 Dec 2021 15:35:53 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1myyDA-00GF3t-NC; Sun, 19 Dec 2021 15:34:58 +0000 Received: by mail-wr1-x42f.google.com with SMTP id i22so14826799wrb.13; Sun, 19 Dec 2021 07:34:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sFsVzNxUTe0zVj2n7sBsxSG3rvMdpK3tm6ziU6/sth4=; b=BZn8XdhsazbSm+T1KIeZYU/dJkqAURt9mI5DASsIbG2584MXsCyOVn+eR7/eUCVoPg qaJn20CPCUTx/GM7scU6TfocKN+aekA2IlfAk5VYdkNlYFLCqrKrRU7Zfb9oD02u3Dkg dDPrhwUiIDfgUILDUM8xyPol4M2+JAssF785XxRU/ibVvAADQDXoF32gTK+k2qashd4n gCbsKWBVOZBvzYxul8E6AZRFdwfDKBCkO+RysFvGnSJ0jZfXzDBAMEwErjVOEj/Bmrws ChdAONYUBqaDpmtKjUvAo9H6sD2scFhteoDVT8Z+kcDL7jQ9oXSctHh8QUjaUYfk7rAs 1aDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sFsVzNxUTe0zVj2n7sBsxSG3rvMdpK3tm6ziU6/sth4=; b=LAlxTySNQLbTRNT45hRuuvi11L4dYALJlUmXskdqJGgnpxwAGURRlDtsX1mQYGFxLE iMq73ERWMtgKy6NARftv2KY0JvmLE1DVuoxTE7HJ8clShhTsRVEmcevUcvPO2E3jLhjp tDiXY7loqjKWQyICkl9yrCI3rw885kxja3TFpsB0iWlNewt09rSZqpdxKzF5BZ8PE7ju wmsdM1ABbFkua7cOIEztqGW5FWoyj9FSU1Dzk1CNTo32mmEpBSawfJk4FqO5jdZUa0jt I8obq+y6gxCHgVc0Ghu/0YoMqW+AgULTCDpBVsCDz6LtdsALzRrvy3BAVmwXhuL1NarH iF8A== X-Gm-Message-State: AOAM533EfSAO++dGHI3MxSP9ZYt773LIMguDTTX/quey8xt76LtERCMy rTgxD2z0bnbtyaoH39hhBFPxQQ/pQos= X-Google-Smtp-Source: ABdhPJy8sqHQb8viceLhFm/W1Wh3gIVDSOpELbiSB6yK6CD2Q1AsC1doKHe8hShOvALzCDdj8Y8cNg== X-Received: by 2002:a5d:5988:: with SMTP id n8mr9933234wri.309.1639928095133; Sun, 19 Dec 2021 07:34:55 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c22-721d-8f00-f22f-74ff-fe21-0725.c22.pool.telefonica.de. [2a01:c22:721d:8f00:f22f:74ff:fe21:725]) by smtp.googlemail.com with ESMTPSA id d2sm9262020wrw.26.2021.12.19.07.34.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Dec 2021 07:34:54 -0800 (PST) From: Martin Blumenstingl To: linux-mmc@vger.kernel.org, linux-amlogic@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ulf.hansson@linaro.org, Martin Blumenstingl Subject: [PATCH v2 2/2] mmc: meson-mx-sdhc: Drop unused MESON_SDHC_NUM_BUILTIN_CLKS macro Date: Sun, 19 Dec 2021 16:34:42 +0100 Message-Id: <20211219153442.463863-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211219153442.463863-1-martin.blumenstingl@googlemail.com> References: <20211219153442.463863-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211219_073456_784154_FD511BDE X-CRM114-Status: GOOD ( 10.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove MESON_SDHC_NUM_BUILTIN_CLKS because it is not used anywhere in the driver. Signed-off-by: Martin Blumenstingl --- drivers/mmc/host/meson-mx-sdhc-clkc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mmc/host/meson-mx-sdhc-clkc.c b/drivers/mmc/host/meson-mx-sdhc-clkc.c index e1f29b279123..19200b7079a6 100644 --- a/drivers/mmc/host/meson-mx-sdhc-clkc.c +++ b/drivers/mmc/host/meson-mx-sdhc-clkc.c @@ -12,8 +12,6 @@ #include "meson-mx-sdhc.h" -#define MESON_SDHC_NUM_BUILTIN_CLKS 6 - struct meson_mx_sdhc_clkc { struct clk_mux src_sel; struct clk_divider div;