From patchwork Tue Jun 16 07:02:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 11606619 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B0D913B6 for ; Tue, 16 Jun 2020 07:02:45 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B2269207E8 for ; Tue, 16 Jun 2020 07:02:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mvp1vUsS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kBXcv5Ry" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B2269207E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j2G7+E8rglsIMzT21TcaD/++U5REKhz15Hg9CAcNJQE=; b=mvp1vUsS1xrmrK luclMx30fJhizv3JeNj1Sr3aUFhuFl8e8QcikzqPTbUuiKCH24NNSsNVxITU3G+KnDK4WoQgCPYAH rJc+iPNm3+24xCrNVkl03l1me6TXXL0vgum3bcc5VoCs5Tw4QTy4Y4LNpUlkDbvwy7rhcNY+eHpfO ZJHZ44RYsgDPLrlls23sn7xoDVlLAkmNYZ6s9OZ71iZkGiSQ1d4YXBXaeooSIhlQDHWHTOV4CuCYk GqO0kH6PoMIcgEeZlSjsbhI/XblZZYrwionKzwX5Qt5xpQig7WATfTtkvJ/Y6H1z3ugOKEMCD325X lZYByoTkqvK4WoV8J7xw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jl5cF-0008M3-UY; Tue, 16 Jun 2020 07:02:39 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jl5c5-0008CG-Ea for linux-arm-kernel@lists.infradead.org; Tue, 16 Jun 2020 07:02:30 +0000 Received: by mail-wr1-x443.google.com with SMTP id l10so19502559wrr.10 for ; Tue, 16 Jun 2020 00:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UD0BzEH0M8YZp//omQOWTqvshKj+X7/NNaB98DCZXBo=; b=kBXcv5RyDkAUziAF8On2RRAtLdxkf+PQ7mctnBuYI1ulgkFh/EmWKQjx53fhn0ldHk LesW1oDVYJTh6OGiYAqOI3xOXkPU27Z04FpPBJVhWOSs1dGMO40bH7OhT2KvUzLngmZT WEIC3zlK6d5Ht8onBNAN+EaApUSuDyovAyFRZHsp6dAqISO3b+n4ekdEH2wZ/0fuBHo8 ekvuEpK1L5M+cWd2smMn81pC2K1+gAXCOkRSw8wpQoH6hNbVDo/FPlZ0Q0ivpVgrnmJk 2+OXaDk/mfKfWzPLnEY+UhXm/0El39dLT1CnYwnZ9j91NSdklJKxe/nUeJVuQJvdT64U Y0BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UD0BzEH0M8YZp//omQOWTqvshKj+X7/NNaB98DCZXBo=; b=tVwwiwNE5HxvlIDBixfLSgODVUwBRAz2d97+p4Mn8+j/IwffX6qgbz8nkMkS7Uh28b GgonU39zbIkgyYIDZ+9ii9Ut/e2sn9iMxw95mwr3rBZNg6arQtbgZBAg+kSWpHDz3KIo KQ5RkaLHWpy/P281F3Y6LZJOdihEr57d33TPMyJp4bRwGpFAZJLGpy3IjJyFePJhYHjs U+kDVg6LCjbJx7qP48IdLoEqD9VYD0JasFOwujJN7tlpKDugPXit7P7vxLBKE4Y+3eVc sq0EIZUNcUYW0wLQ1mjVrHvcVgZr7zxg86RDRNlnhxHpvefVnpTkxTHij1/dgjgIZW+7 h7GQ== X-Gm-Message-State: AOAM532ARriPlTyaTQiPFqvM6k8rLeFON1axojmWta+/SUqETerd5Fhi 5UrI2JegijPMCHjYNjWpo3c= X-Google-Smtp-Source: ABdhPJxJocaEAJDjXYgrdusUF1X6ahSw5QoOUewPSOXVR9vtcDbBiuhLEL6qn82QSv28cJKE+g2//Q== X-Received: by 2002:adf:fc0c:: with SMTP id i12mr1403233wrr.365.1592290947713; Tue, 16 Jun 2020 00:02:27 -0700 (PDT) Received: from skynet.lan (90.red-88-20-62.staticip.rima-tde.net. [88.20.62.90]) by smtp.gmail.com with ESMTPSA id a81sm2792897wmd.25.2020.06.16.00.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 00:02:27 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: broonie@kernel.org, f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com, p.zabel@pengutronix.de, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 1/4] spi: bcm63xx-spi: add reset support Date: Tue, 16 Jun 2020 09:02:20 +0200 Message-Id: <20200616070223.3401282-2-noltari@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616070223.3401282-1-noltari@gmail.com> References: <20200616070223.3401282-1-noltari@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200616_000229_514892_75533EC1 X-CRM114-Status: GOOD ( 11.88 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:443 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [noltari[at]gmail.com] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org bcm63xx arch resets the SPI controller at early boot. However, bmips arch needs to perform a reset when probing the driver. Signed-off-by: Álvaro Fernández Rojas Reviewed-by: Philipp Zabel Reviewed-by: Florian Fainelli --- v3: use devm_reset_control_get_optional_exclusive v2: use devm_reset_control_get_exclusive drivers/spi/spi-bcm63xx.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index 0f1b10a4ef0c..92e88901189c 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c @@ -18,6 +18,7 @@ #include #include #include +#include /* BCM 6338/6348 SPI core */ #define SPI_6348_RSET_SIZE 64 @@ -493,6 +494,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) struct bcm63xx_spi *bs; int ret; u32 num_cs = BCM63XX_SPI_MAX_CS; + struct reset_control *reset; if (dev->of_node) { const struct of_device_id *match; @@ -529,6 +531,15 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) return PTR_ERR(clk); } + reset = devm_reset_control_get_optional_exclusive(dev, NULL); + if (IS_ERR(reset)) { + ret = PTR_ERR(reset); + if (ret != -EPROBE_DEFER) + dev_err(dev, + "failed to get reset controller: %d\n", ret); + return ret; + } + master = spi_alloc_master(dev, sizeof(*bs)); if (!master) { dev_err(dev, "out of memory\n"); @@ -579,6 +590,12 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) if (ret) goto out_err; + ret = reset_control_reset(reset); + if (ret) { + dev_err(dev, "unable to reset device: %d\n", ret); + goto out_clk_disable; + } + bcm_spi_writeb(bs, SPI_INTR_CLEAR_ALL, SPI_INT_STATUS); /* register and we are done */ From patchwork Tue Jun 16 07:02:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 11606623 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 71D746A2 for ; Tue, 16 Jun 2020 07:03:04 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 50BD82082F for ; Tue, 16 Jun 2020 07:03:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TqZJorju"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sLbReXaG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 50BD82082F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TdTbR1knDwlkiAo3AZjlpFgBNElUo8YM+aTy3Ql14u4=; b=TqZJorju1eZQaT rg4LVsbfX1z0uHHeULWdeUBhr8nX7TG7FjXjSogFyGYVZhkC4gklBe2lljyI6WThtR3mGxeGxNG9g K+/KduFRb+mi/Z1Lqfg7pe0tDJ9dFM2Yt+SWb7UnuWQvFc8QVE2aQdlgiO1uPRLuD2YWFZwGznPz8 6bEkqhUVCBQQGbjt0gGUvCa8H7wlvMHBR4pEK/U+fkUcOLqC5qR87RIGMVStcHm7mNewojico84n7 qw2ET40fWcPXugaUy+ASMEdu3cVuEIDJICGW4+9G8cqHzsZAMHFH+mdRbZ73g1V4MsGYIzd9Vu60y nn08klZ1Juq975j6lPoA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jl5cY-0000CO-Vp; Tue, 16 Jun 2020 07:02:58 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jl5c6-0008CK-8b for linux-arm-kernel@lists.infradead.org; Tue, 16 Jun 2020 07:02:31 +0000 Received: by mail-wr1-x441.google.com with SMTP id q11so19550826wrp.3 for ; Tue, 16 Jun 2020 00:02:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hxEmWLfwHZP4Be2phdSbnhWMdtzjaR50DcbRvIkPnIU=; b=sLbReXaGDklVC/wmWctEFgs5Myd1hGZTKnfLn1uS976ohunN6Cl+0+lu8WOXyp2oDX twQjvyJQxLq8odtcTB3+FZFOHlWVO8VfgszE8GcRALNyJigwekf/QImno1yYn9xvEa0P 0TTJTF8pgre0wCBDac6pg59WDry8+EET0q5XyvalQCL6AyrxYB4KgJRrrLCw7yfZczsQ 0iRGjIB1637r6vtiwulMaHJenCBmMiXR3t2si280FE1yqfEWlI7o7+GQlR6TxZQ8Wgi1 WAL0DcUr6vH+UkHjQWvR39+7847ksKHnX2JqKSzH4+9OvDx4yAdz2CbW6ql/EeXZRknq Ru2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hxEmWLfwHZP4Be2phdSbnhWMdtzjaR50DcbRvIkPnIU=; b=TQKQVPPTSlwVR7xr/zmpYQXFj76HJBbyeLQntm6z1YECFcP/sZHlv86rMkXFwyh3H0 0NgAKCuLc4X70NQGDL/4k09Z7mXcU8q9kifTI87XSw49eS5lbVChDusDcICgMiGwVoI7 KwZGQOza3GXEKpqTOQduZLEV8BKx3W8Ws7uS7C1ULZMuus+u18C5emAX0WTkzq0L6Z+N OYpTAUITaF35OwVB4hjHpXMbdxdyyySJr8wPDz2UTE2ptNzgObr0RUPhajz6GHGLSX0i 5yZ2zC84KGFBo9JbxixsTLypan3pIGkFEh3gNONt7IpUsd3goLODFpVT+dgjRCTccKHS Q8ow== X-Gm-Message-State: AOAM530ylAvCjScHtZDgX7MscPUX1U2C26jkyLEPCPOwkLa0c76Sibom nQNwDoJs10vzqkFuwYIyXj4= X-Google-Smtp-Source: ABdhPJwDoaIXDyUzm7CintArNzHEB1nNJOCinL8DV2eNUbdJR0tdiWp7yguJ9LQxGl5k9phf2M3Kjg== X-Received: by 2002:a5d:4f09:: with SMTP id c9mr1417776wru.3.1592290948741; Tue, 16 Jun 2020 00:02:28 -0700 (PDT) Received: from skynet.lan (90.red-88-20-62.staticip.rima-tde.net. [88.20.62.90]) by smtp.gmail.com with ESMTPSA id a81sm2792897wmd.25.2020.06.16.00.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 00:02:28 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: broonie@kernel.org, f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com, p.zabel@pengutronix.de, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 2/4] spi: bcm63xx-spi: allow building for BMIPS Date: Tue, 16 Jun 2020 09:02:21 +0200 Message-Id: <20200616070223.3401282-3-noltari@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616070223.3401282-1-noltari@gmail.com> References: <20200616070223.3401282-1-noltari@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200616_000230_298638_8DE947D5 X-CRM114-Status: GOOD ( 11.08 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:441 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [noltari[at]gmail.com] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org bcm63xx-spi controller is present on several BMIPS SoCs (BCM6358, BCM6362, BCM6368 and BCM63268). Signed-off-by: Álvaro Fernández Rojas Acked-by: Florian Fainelli --- v3: no changes v2: no changes drivers/spi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 8f1f8fca79e3..a9896e388355 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -149,7 +149,7 @@ config SPI_BCM2835AUX config SPI_BCM63XX tristate "Broadcom BCM63xx SPI controller" - depends on BCM63XX || COMPILE_TEST + depends on BCM63XX || BMIPS_GENERIC || COMPILE_TEST help Enable support for the SPI controller on the Broadcom BCM63xx SoCs. From patchwork Tue Jun 16 07:02:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 11606629 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 34018912 for ; Tue, 16 Jun 2020 07:03:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0CA8E207E8 for ; Tue, 16 Jun 2020 07:03:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KgotSnml"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C+HvmqxT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0CA8E207E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=N1/uZZOc9heGIWQ94HCH4nHktuzdI/2RezJwk0YHquA=; b=KgotSnmlIRtVzZ tdu/ESRYeUjK+hfcs2MKHvMccqvjUKo75YHptrL8zEO/qUIKJivZB9pX/4Zkce8dLS8G7XUcmT3TE mitkmrZgnRJmeFkG24b7gq+8HZS68UwnO47Fb3Dr7XxSAQXgonLc8fxSJdIf0uMYOyLPJRlfh6m9S 8Bs/aNsARStAITH8tIEHLcZwSNFiQ7PBGW0kXbeisVbi6R3qCUmHqMpvXXHZsrKzO7Euakve4jiwr uvhz3qxkjgg0HxmwsVUMppH6sINuLg1TS94IUAuCWRYvyjrxMWvKnJpaaL4Pnv5vaXTo9GoWHcDTT 8VLg3ADS4UyaoZzkbsWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jl5cr-0000UB-BR; Tue, 16 Jun 2020 07:03:17 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jl5c7-0008DE-Rz for linux-arm-kernel@lists.infradead.org; Tue, 16 Jun 2020 07:02:33 +0000 Received: by mail-wr1-x442.google.com with SMTP id t18so19539980wru.6 for ; Tue, 16 Jun 2020 00:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pk+BVPAFs3HZDk7vo9cGngkaw64SHz8Pd/OXNI1lr+0=; b=C+HvmqxTo8kyxFjHP2roUq3Qhu/w2Sn9iKkXF5vp1PkF7GbmPNr5BmB8EkfpDDMxac kdmT6qSYiaWA3K/hNkrgidPcZ6LuiPC0DLbbmToRDyesIED5lrjotym1kkf2ziAPFiXy 5+dJ0nxRD0KsYrzoLPRT9zLqPcuf5o+tsWQDYebZCEEqyxwxoKb6AE7lUI8BoaEkXf2+ lTqUPGHBsmBpSfmbuay1zzlge1jeN5tZt+kEH+cMY8WhyGOVfLxOQs8XfRxP+1pBE7A4 fTv9lg3hdkyU6Jemj9/exNbEWgE9T74u4CqWzTegS1SA0Zo1QwquJNGl0gz0DJV4DCD3 Oq+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pk+BVPAFs3HZDk7vo9cGngkaw64SHz8Pd/OXNI1lr+0=; b=YI0d88HXhoanXuzDf21dIg4DVZCow/qDQQsj2NrG7YLkpj51QMU478pfLeWnPbLybI Hew9lOi+h3aDl0OOyf8xqb681+Syq1TH4YNAN16tFjoRez3Ukk/iC6p4Da671KpSE1kq K/1LULxn8lrVW8aDTL3jakWIAjcVEHm0wGjqBqJ/q3sujCQnq9F9f0+zmwaY2ROCqRO1 3Muo674bIA8yQ8c0p5l6bGeFnF8XoMM51HOk9bCLVAyDKh8Lrf7vrxcpmLQAbNLBgSe2 n2PUVPT9IN8X8JwFHvzxf3WqLCDYM3pA6Add7ivQzUT7ExITM433Ax0W1Tm2HyKYPTlR qxow== X-Gm-Message-State: AOAM530U1ow44sHYt/kdE3/P4FJpKIaImvXV6UwakHp69AfB1+nbbkO4 DuPSRMbfFylY1xiGchRIxy8= X-Google-Smtp-Source: ABdhPJxPpnpfojRlFQlz8MK0ih4ZorQrUXviNO2k8RuX8mrpkbqs+uk/jw5/vvKOelKtPiAuBDPhZQ== X-Received: by 2002:a5d:68cb:: with SMTP id p11mr1354863wrw.379.1592290950376; Tue, 16 Jun 2020 00:02:30 -0700 (PDT) Received: from skynet.lan (90.red-88-20-62.staticip.rima-tde.net. [88.20.62.90]) by smtp.gmail.com with ESMTPSA id a81sm2792897wmd.25.2020.06.16.00.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 00:02:29 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: broonie@kernel.org, f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com, p.zabel@pengutronix.de, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 3/4] spi: bcm63xx-hsspi: add reset support Date: Tue, 16 Jun 2020 09:02:22 +0200 Message-Id: <20200616070223.3401282-4-noltari@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616070223.3401282-1-noltari@gmail.com> References: <20200616070223.3401282-1-noltari@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200616_000231_915918_263458E6 X-CRM114-Status: GOOD ( 12.11 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [noltari[at]gmail.com] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org bcm63xx arch resets the HSSPI controller at early boot. However, bmips arch needs to perform a reset when probing the driver. Signed-off-by: Álvaro Fernández Rojas Reviewed-by: Philipp Zabel --- v3: use devm_reset_control_get_optional_exclusive v2: use devm_reset_control_get_exclusive drivers/spi/spi-bcm63xx-hsspi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c index 6c235306c0e4..45e2b0942e64 100644 --- a/drivers/spi/spi-bcm63xx-hsspi.c +++ b/drivers/spi/spi-bcm63xx-hsspi.c @@ -20,6 +20,7 @@ #include #include #include +#include #define HSSPI_GLOBAL_CTRL_REG 0x0 #define GLOBAL_CTRL_CS_POLARITY_SHIFT 0 @@ -334,6 +335,7 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev) struct clk *clk, *pll_clk = NULL; int irq, ret; u32 reg, rate, num_cs = HSSPI_SPI_MAX_CS; + struct reset_control *reset; irq = platform_get_irq(pdev, 0); if (irq < 0) @@ -348,10 +350,25 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev) if (IS_ERR(clk)) return PTR_ERR(clk); + reset = devm_reset_control_get_optional_exclusive(dev, NULL); + if (IS_ERR(reset)) { + ret = PTR_ERR(reset); + if (ret != -EPROBE_DEFER) + dev_err(dev, + "failed to get reset controller: %d\n", ret); + return ret; + } + ret = clk_prepare_enable(clk); if (ret) return ret; + ret = reset_control_reset(reset); + if (ret) { + dev_err(dev, "unable to reset device: %d\n", ret); + goto out_disable_clk; + } + rate = clk_get_rate(clk); if (!rate) { pll_clk = devm_clk_get(dev, "pll"); From patchwork Tue Jun 16 07:02:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 11606631 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B37F8912 for ; Tue, 16 Jun 2020 07:03:36 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5F498207E8 for ; Tue, 16 Jun 2020 07:03:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="T/tPJD5x"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bD+zdCSQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F498207E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Q8KHZJq3ci9EVy1o+YOr5KldMT0NYdr3b1TrWnvjymQ=; b=T/tPJD5xtwXP4y I++7AKPXW3Lf0N3VyfUTnsoNF8yODZfevJGEeMk8gwOJhwW/5qWpp36iKvUEv0v2k0YjAEtVDQQio qLOZn5HA6A2TuBRrXLM6UppuWEUeCyzhcfQ3WqDJnhtt0ml+8ef8YxyuC++h0jTunvl/vVtpUnezQ 5qQ/No+A4LbbIvTd/0GQjmChLEuIPxdb94mZD/gHdvbfQcLo6fqaFefcPGRhFp/ztqhDFlkZtO0Rc In6AirhgQzmG9xne/J5uiOjXg9+Ev33aZHAGKI7RL9HUWMrSC39sLFwkwC5Hh3C2MWQ9MstlP59kn g82QSGaCu6IZseymq3Rg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jl5d3-0000ft-Cy; Tue, 16 Jun 2020 07:03:29 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jl5c8-0008DK-D9 for linux-arm-kernel@lists.infradead.org; Tue, 16 Jun 2020 07:02:33 +0000 Received: by mail-wr1-x441.google.com with SMTP id x13so19517503wrv.4 for ; Tue, 16 Jun 2020 00:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/D6+64ZUdejGJRJMqoRU2x61DrD8mP7AccKlTwbucWk=; b=bD+zdCSQk7z5kAoShY/7lCz6ss5FR4L8vQ+PeKjYftWneGl8MwS4iSnkV6zsB2zMeJ lXdH4Gaus8NSoD/I/o5/ozLjil4vnSu1jH6d30fdxDgMUDCwth18iC9Q47oqKpISf7jU UMAKjGGSYaL/lMBSVnt8ChLimgmN0Zoew0mWrdTs4tFk+QQmrxWBjyQshkxOPVUdHIJJ sj97C1l0gSCquhlAjn28m7VaTXcCD72NDmZmvfDbMQl014A28RKWjWH4b0vyx5I8bYXt 3jUIm4oF3IQuKb32U9YGOVDM0dG1DIMoaIDcDighByeaLdCb6GaU+eIwIBp69dcHE0J2 iJsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/D6+64ZUdejGJRJMqoRU2x61DrD8mP7AccKlTwbucWk=; b=pjo66rIDKQJzvnbF4JX+q1htl+jTls+8EDvzl2AOVxaZFM5bl1vlSddbua2tWwPqJM pFQRBOrBzQilqNWUHMc3NAiyKzrIWEhOqwgaS2vdbw+Dk0oOdIZ7PrmCYVnw2eGjZX92 3AMm833q7brbKiahZtFeSpwvV13q6Geyc/fgS1pOmiwjjKL7Mq207TEL+zIexvE7ShGs tAFIIy24jrZBAAiLdgF5zA5//HI5Z3CEKHIPgt5aq0u75IegzFB7w+qr0CnKykWJd13C Xldo3cURg1JoGX88E98iUKWwWsn7NeSrWcJzZV+sUyIQjl7T78LAL1RCm6oGuQxGCiR5 UYPw== X-Gm-Message-State: AOAM533zFn66Vgz47gsMKZFchiiGVyikXbrUpZdfyanWvPaeFgtLfjy9 jr1AJTkGxSUsJGag4g7CGjI= X-Google-Smtp-Source: ABdhPJzi/n7XU1cdxDdzEwN8TxfBEhzsT4SjTrAg4SkW/x5lg2I5SoFzXpF/64QNnsy7GYYj3hzgKw== X-Received: by 2002:a5d:4d89:: with SMTP id b9mr1542617wru.210.1592290951143; Tue, 16 Jun 2020 00:02:31 -0700 (PDT) Received: from skynet.lan (90.red-88-20-62.staticip.rima-tde.net. [88.20.62.90]) by smtp.gmail.com with ESMTPSA id a81sm2792897wmd.25.2020.06.16.00.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 00:02:30 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: broonie@kernel.org, f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com, p.zabel@pengutronix.de, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 4/4] spi: bcm63xx-hsspi: allow building for BMIPS Date: Tue, 16 Jun 2020 09:02:23 +0200 Message-Id: <20200616070223.3401282-5-noltari@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616070223.3401282-1-noltari@gmail.com> References: <20200616070223.3401282-1-noltari@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200616_000232_448900_C7962612 X-CRM114-Status: GOOD ( 10.99 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:441 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [noltari[at]gmail.com] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org bcm63xx-hsspi controller is present on several BMIPS SoCs (BCM6318, BCM6328, BCM6362 and BCM63268). Signed-off-by: Álvaro Fernández Rojas Acked-by: Florian Fainelli --- v3: no changes v2: no changes drivers/spi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index a9896e388355..500774fe1351 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -155,7 +155,7 @@ config SPI_BCM63XX config SPI_BCM63XX_HSSPI tristate "Broadcom BCM63XX HS SPI controller driver" - depends on BCM63XX || ARCH_BCM_63XX || COMPILE_TEST + depends on BCM63XX || BMIPS_GENERIC || ARCH_BCM_63XX || COMPILE_TEST help This enables support for the High Speed SPI controller present on newer Broadcom BCM63XX SoCs.