From patchwork Mon Jun 15 09:09:40 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: 11604429 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 B5265618 for ; Mon, 15 Jun 2020 09:22:48 +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 9207820663 for ; Mon, 15 Jun 2020 09:22:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AhHU0Bow"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WAITJgDq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9207820663 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=6JoOeo7YFb5vFArMb9enC9fbbybd0pEaO9/ASXE9pno=; b=AhHU0Bow63z2kL 8tJp9RU90Hg/Uokm7s617QAjSRanVBskKc+DD4RGWq/i68KHtdfjRuDV92F6WdG6j8/E0L1ni1vjy 50fEnxvzMxJBWukGdG9kGBwl1GembHCL6bBgWAmyEKd7Z/g4oe+gqmXzoMYQFo7Cw90nsOBPfUDc/ KvRFk0Dt0/lfOZ580RDj2FBeCa+YDw3DSgOC0hcjLNo66Kf+t3ImK5urF6LxHYxPsLn/klxYSkG47 ziLoRIzlTCNiEF528RZta81cozi6miT2qlMcgeNJ9+n3zvokkp/gUPnEXk4wXEUzG3ojMG+XqwvBA S9l7oHUIErHhy7FYB31Q==; 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 1jklKD-00083z-G1; Mon, 15 Jun 2020 09:22:41 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkl7k-0006oj-JV for linux-arm-kernel@lists.infradead.org; Mon, 15 Jun 2020 09:10:01 +0000 Received: by mail-wr1-x444.google.com with SMTP id l11so16271260wru.0 for ; Mon, 15 Jun 2020 02:09:47 -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=EGL86Qz5KZIGBnwhew12v7obohA0kfmvJqpoIN9EEW0=; b=WAITJgDqa0Mr7UmDLieRkhFeaNDM9RdGqzkQpg98dTByQbQxHhO5GDAqLi80x9KJ+M 8p2rXz3Tm6hca7m3KvCaRveud0ZdI99dv0dnTZp+M7ym4okpqcxFSiO3zTWK7AZ100d3 AEFlhuZoPoFYezAz+mJ3CYt0owAKCVldxHlEaSQBmg1digtZeRrtKWCq9WL3G1yvfXCg 2F7O8gbgGni7yMjVBLPJBtHD7TALfGZ1inkLi/eNWIHJPLzis2nmHdHLgtn1K0bRW957 xq7ED0NOs286aiZbPXtXGQfneohcyCj7ndbYxmTyWS7ebZuZBuigwCI8gHlsm1x4ZH4c onMw== 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=EGL86Qz5KZIGBnwhew12v7obohA0kfmvJqpoIN9EEW0=; b=QM0QaiQdH7bbVheh2xuu3AGpbALBOyauSH4ANR9cvzDZ8pg2SidflX3ETDefJZ8DjW lwMQuOfdbfc3IXXyjIhVh4U0bZtZ/jT23O/kqPrDD2T61LapardkU3D/EmDwX23YWJdQ VqmdjRXhMeoDFsO3El+cGPQnTw0pYcw4iLLnRqJhvELplvrAIl43pNvthkTo7HGK6R5c LXildiMhaU+7otj0dV8TyEbtFMHnauY+qcJWnhvr+Caz+dpXptauxUqU5smjzDhnWp/o MKmSLWtQ5BzTgqbBABd413IJWeUpsXgJvo8a38B4nGCw9sJPISb5usHQVjmpxvdFlnQL q6Cw== X-Gm-Message-State: AOAM531QANEDZ0vw7L+V1GW0NiqErDPyA80e8AYQnBhJ7XcSrKcMBHbE 4JBey4DV1mun2xL5bs7Eg90= X-Google-Smtp-Source: ABdhPJwAVPLr37ywS95nBZNXVIXRJAnp7bp4NU7qrBz3bY36OnVE2Cz4rNmTo3yebYctmdTHnl5eyQ== X-Received: by 2002:adf:ee47:: with SMTP id w7mr27142264wro.171.1592212186603; Mon, 15 Jun 2020 02:09:46 -0700 (PDT) Received: from skynet.lan (168.red-88-20-188.staticip.rima-tde.net. [88.20.188.168]) by smtp.gmail.com with ESMTPSA id z7sm23109370wrt.6.2020.06.15.02.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 02:09:46 -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 v2 1/4] spi: bcm63xx-spi: add reset support Date: Mon, 15 Jun 2020 11:09:40 +0200 Message-Id: <20200615090943.2936839-2-noltari@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200615090943.2936839-1-noltari@gmail.com> References: <20200615080309.2897694-1-noltari@gmail.com> <20200615090943.2936839-1-noltari@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200615_020948_687522_3AD5F08E X-CRM114-Status: GOOD ( 12.57 ) 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:444 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 --- 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..8ab04affaf7b 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_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 Mon Jun 15 09:09:41 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: 11604433 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 6309A60D for ; Mon, 15 Jun 2020 09:23:23 +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 402C220663 for ; Mon, 15 Jun 2020 09:23:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GxgSO1LC"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cSmicChq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 402C220663 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=EgOGQ6RpDCo5wYE6ZEvQ0D/QEuxrbifR6HKOp0fI5uY=; b=GxgSO1LCnDyPAB sentu35D2N175r+tNTBI0CkDgO3fp/TH7wkX6LIj58rPqJNkIj4t4OcusR4usYd3hAzx2kQc+K48z 2NoR5AghlXcw313he9gSE67vSTTPh8K6LmL5W8kxJvI6Tgo8QSsP7HsUNUKQMKjm6+xgOxLw2nY8X t7JJe4vN1b+bQJPFTuvrPI5/87Nf9rrMqfL8BMkWAb6XVY4G5hipMsLDaiSmP4etbLkuwv527qFxQ 0cLnYd+XReMQ15G/0f7UbWxvKEktUbmTCYpRMQBDwGBN1G5FOUVMARq/wAuiosw9jENT/sgdxWi21 IYoA0cdaQ6TWLspIn43A==; 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 1jklKn-00007a-EL; Mon, 15 Jun 2020 09:23:17 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkl7k-0006pV-Qu for linux-arm-kernel@lists.infradead.org; Mon, 15 Jun 2020 09:10:01 +0000 Received: by mail-wr1-x444.google.com with SMTP id c3so16221298wru.12 for ; Mon, 15 Jun 2020 02:09:48 -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=1afpgiZSkCxScwIQYbqgkLwgpZTvEZ/sJp0E5CNcZ5k=; b=cSmicChqdnE/e5/HZWkV5Ec8+/awIFZcgGpkuyXPE8uc+KtRLP0YySLje0t5aSUxVZ XW/9637BuD4zITAyTfIPHOIE20qGjB0fNrTBimoAJz28OMhRq94sfJwbr4CSARuVQio7 VLVv6HjVjYLAreZ8NOXbHp44wxRq68NNLMWlYLnk2krkN4exeCL6mOkR3cDQOVT+4LIh A/Rfr0fERe4PiFozP9SE/bjOcMDmX8moj8HP0p3qklDEa9T565a1gu/avyBec7fCaNzp vhAI+FfWDJ50ESVxF/wMAYraTG5be3VsH20+8me+VWu7d5SxwrF8HlL8bBLA+UYklj2W 6NGA== 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=1afpgiZSkCxScwIQYbqgkLwgpZTvEZ/sJp0E5CNcZ5k=; b=V3QSdgj9bQfRKuRSm/n5L6++2HNnM8KYVUAAdAW/heCWQinfJ/EDubnHtmuVUjs5BX s7FJJRkaatljTvW56jN1IsV6HwkdkvpsTKCeVo3uL/8SjKcA3rZjTRu94A/UPqDZoiDc LBMVqzIL+uXWhQvaI+t4Sq2vTeFMHM9hO/aIClk9654CCuAdWziatVuL1W2ltrWGnwBv 4sWacjraKhS5j3Xk6t13qWp2J3gjce7JC3EU9XeC4pjdRckAgexLEYbw8pGrcS1bfIp9 j1MlbMnAjMBFBf3XNrKUPrvDkjan/q42PTdMDHW/lmKsCb50wfE4/Jhy8Qc9jVe09UZ6 oCng== X-Gm-Message-State: AOAM533o9MhdtYZM/fUWpuMew8YLf1udrmmE7Jqlhw61kVWba2FnVb92 K6e/GUTDCE57jJiXfui326BMX8sB2D3ZUw== X-Google-Smtp-Source: ABdhPJyp/2xEDiDre/+ebYIfeT5x+ZslI9jh9sWzEs31ZYpZ305FIggGes5hxs4301Map+pqWXX70g== X-Received: by 2002:a5d:67c8:: with SMTP id n8mr27924127wrw.343.1592212187536; Mon, 15 Jun 2020 02:09:47 -0700 (PDT) Received: from skynet.lan (168.red-88-20-188.staticip.rima-tde.net. [88.20.188.168]) by smtp.gmail.com with ESMTPSA id z7sm23109370wrt.6.2020.06.15.02.09.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 02:09:47 -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 v2 2/4] spi: bcm63xx-spi: allow building for BMIPS Date: Mon, 15 Jun 2020 11:09:41 +0200 Message-Id: <20200615090943.2936839-3-noltari@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200615090943.2936839-1-noltari@gmail.com> References: <20200615080309.2897694-1-noltari@gmail.com> <20200615090943.2936839-1-noltari@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200615_020948_915433_4A8C9746 X-CRM114-Status: GOOD ( 11.71 ) 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:444 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 --- 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 Mon Jun 15 09:09:42 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: 11604425 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 C55AC60D for ; Mon, 15 Jun 2020 09:22:21 +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 9051720663 for ; Mon, 15 Jun 2020 09:22:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="e9RoLiQS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fb/uGGcq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9051720663 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=/GMnxM9UM1UKaLCS8uI2gpPPollAy0k/7zyd1tr77fE=; b=e9RoLiQSfuJumn pFCT1RvhitaY1Vdgg+JKEwJRC7jrv74b8E4MQJU6Ta8l2OpV/S+nFp2pKKRTUr2b9mO0t/NB3llSL GPfQ8x+KENxFXBDp17t85OeyKrKtlbr6hSt3f9Zx5l2/usz1tQ3kEVIWloyOERw8uRqlQX177h5YH EEzYC/cFyt0rhrVYFYaa3h4kfFHAzztYX+nTSy3X/U+0hfgWBgvuQoRj8tPeh4CHLoMnd7JlEMedP wCqs7VeLwHtlGpSTm8d5+rTaJ4Yi8xRVZp1qGoNW00SFLZOccd20iMNKVuEoIDQrQ9j/BDViQTzFI 2lf4hbEbK+bc7n6E5/rQ==; 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 1jklJp-0007l4-7K; Mon, 15 Jun 2020 09:22:17 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkl7l-0006qT-Sn for linux-arm-kernel@lists.infradead.org; Mon, 15 Jun 2020 09:10:02 +0000 Received: by mail-wm1-x343.google.com with SMTP id d128so14010029wmc.1 for ; Mon, 15 Jun 2020 02:09:49 -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=OR0nfmLMMmSCxHE1VSyFIHoRf43UAMOwWvzgX8Ue40s=; b=fb/uGGcqz2JqdS8hP7EbdWBdkEtZo+LduWSmJY4nm8p5GMGLRxR2QI3q8qrZ0YEoGC +Dj1nwtS/Rub1+UED2c9n5vZqs1w6GuYSlqYgujtHtWQ+pGhx335o9PZd6yqX4wOEn2Q 22P9vS7X1d7SGFUrc3RDgZyu40wljofv1mbvakxKX5uLamsLR0+z6YCr6nqXMr6zC/GP 21SzFQO+YC8xFavJL0zRA+C7wzOrwOmeGFnzz3l4uZKq+2PvHxJ0tWqr+vE2Gg6vLKcR 2neqJcQ3papU9nAVd7lEb4DO1SpwxXeAYbtyvFofSLIFavDbRNi9dcCfzHGITc8wVfVA mk9w== 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=OR0nfmLMMmSCxHE1VSyFIHoRf43UAMOwWvzgX8Ue40s=; b=md68jp6C/uF3lqLrorB7ma2LlUP7MsivUSbgs5nlJRUuaqRADSXYgN4sdhpDgD4erU iGjBYJivblIY2ChCNOXxvHplni4mjRFlf+sZusF+LKwolBSbUtylkR8jKonQRNyTk0QW kWSevGbvAsEL8sm5Ju5TRWFEQllTB2fs4cIyxUpJznyywRbhjo0jlVwiM066eEzGDLYl 6wMWyOI09f7KOIwuTWx5Z4YBL0mlTXqeFRkMV6OFRmXYt9jKwV49px6tj0Q8La6I8yOp rXXoKodZ24zPpz4QeNcDVs3318eFyex5pdw+0MsXH6huErqFdwNUJdqhNFzMZG+4aNf/ ydlA== X-Gm-Message-State: AOAM530by65YVyra2RXTo9Fg3d0e1f2JXsJtLEBOyt7lBq2BpTUMfQvu QLv/uJUB/SvToNjn6iRZ/1PgkBAXfmfKDQ== X-Google-Smtp-Source: ABdhPJw2zXcH4A8SO6eyjbtXwJhxo0qyi/290h8tJRwaAVkZtprf7P5eHNUGltZznlI97KF55bELww== X-Received: by 2002:a1c:f608:: with SMTP id w8mr11762885wmc.78.1592212188418; Mon, 15 Jun 2020 02:09:48 -0700 (PDT) Received: from skynet.lan (168.red-88-20-188.staticip.rima-tde.net. [88.20.188.168]) by smtp.gmail.com with ESMTPSA id z7sm23109370wrt.6.2020.06.15.02.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 02:09:48 -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 v2 3/4] spi: bcm63xx-hsspi: add reset support Date: Mon, 15 Jun 2020 11:09:42 +0200 Message-Id: <20200615090943.2936839-4-noltari@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200615090943.2936839-1-noltari@gmail.com> References: <20200615080309.2897694-1-noltari@gmail.com> <20200615090943.2936839-1-noltari@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200615_020950_034269_F0E7277B X-CRM114-Status: GOOD ( 12.72 ) 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:343 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 --- 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..a20a0b88c23a 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_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 Mon Jun 15 09:09:43 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: 11604431 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 72BEB618 for ; Mon, 15 Jun 2020 09:23:02 +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 4CE3120663 for ; Mon, 15 Jun 2020 09:23:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SaD1wpSu"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Eh8ZUSh5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4CE3120663 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=Ii/B/5+4lH4wLrSYHQSQ8Ztg3gPJGrHSvnU68kAwLcE=; b=SaD1wpSuCciebG rkfwTHJMhm289U+BpDFOHKISsObxjmF7BLp7DnYjjpmeRXlil7JGvvifz9O8Im+XaZ9VLXjHYYN9Z gLFEAMmIO8WHlbCSUo5d8h1k0Tn2x86619QaGUSKQCYpdBON84fuuoUdjINt63Wy2yGCUyt9cmrAT xLjF6a690gfsBfsgDtPgqsTbCHpvERUH/Eqoy4bHUtMzxPj6oGMWQuABDwhVzN2C7IXPqFi9axGfA v+g6ucKn4bgqlIrsCJXfj/l8S+TBQwmwCapkncVeURabmPxfEKgNXugk2n3J8XC2dvY6ft3YxPS/E SSgtpKyw+LBF28KxUL+w==; 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 1jklKU-0008Lj-1q; Mon, 15 Jun 2020 09:22:58 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkl7m-0006rG-OB for linux-arm-kernel@lists.infradead.org; Mon, 15 Jun 2020 09:10:02 +0000 Received: by mail-wm1-x342.google.com with SMTP id c71so13817962wmd.5 for ; Mon, 15 Jun 2020 02:09:50 -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=KnGbf5grf0IkRGVHz6T6Je/lqrthZMXPB4yMEA/nohU=; b=Eh8ZUSh5wrn9ZW4a7Ao9x1tY3fRR/5c0ilkslt79XE8NFFHpQm8QvWeU5rFr2aYp1E tEej/CjmTV83cI49kr5d7hr7EJwG36KsyEOmftDFG0dpSZvO5oOsMv1V2Am6ZeoqB7V6 eCDXv9BIroOC6si3ck1daFL8VW3igDakwwbQcmVXT/HqHDmnwm9DpurEjBg/y4kBsBO+ GSnypJEESzOJvEnezdhlKZ3Uh7EQgRMKILVv2xGSmWO7+9LvRvpVViVTPgmZu396fXPk TJAjAdTqdzpllqpuLyhP0E3a/0EPvmXjY5cC4wslASEZIvhmB3wRWvdVhWpvPeez7id2 5vcA== 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=KnGbf5grf0IkRGVHz6T6Je/lqrthZMXPB4yMEA/nohU=; b=NSIW5WBbx3inQCbEnrBQeAimu269JOn/Uokc1BPMwrQLjou9c2ybym68/lgjz6O+2a Ui1v3Y5h/qyHo6iN+nGInSlVom2WDQe9w58mMbSSmuvpn//jkFfunXwdyda7Fy7f+JUE eBURuCQ33qq4IukWE7WXFALWDO5osOgXYLZXfIiGNih4EaiEQ1NQ4Hj6tusLc23bO7DK mFzvUZ9EOKk7ofqp5zc+Ct+9F3XXqw2Jz9kHi0XzlmCNeOMMC+BfupcuXFlkIz/3YTvm cIjeaZZGMxEdEB/ncTnGHjKqzluczoLGTzXrpiiIwimgXYXigq7oMl7dg+M+T9Uh3qel Pqfw== X-Gm-Message-State: AOAM531SqXR0C6DhdruGyo2wGd/CfiQAk3nuT+IwXDGqJCVBV8NwSeJM 0UA0PTxzPu6XwwRN2XzcqeIdMKX73j7Zpw== X-Google-Smtp-Source: ABdhPJzfERI69ORfwOl4kiXFJAzXSSL2kMnLwByHcC0R8ycGyZA/K2B7Xgr6QOiZjOxn4jcAjIoU8w== X-Received: by 2002:a7b:c393:: with SMTP id s19mr12026304wmj.92.1592212189426; Mon, 15 Jun 2020 02:09:49 -0700 (PDT) Received: from skynet.lan (168.red-88-20-188.staticip.rima-tde.net. [88.20.188.168]) by smtp.gmail.com with ESMTPSA id z7sm23109370wrt.6.2020.06.15.02.09.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 02:09:48 -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 v2 4/4] spi: bcm63xx-hsspi: allow building for BMIPS Date: Mon, 15 Jun 2020 11:09:43 +0200 Message-Id: <20200615090943.2936839-5-noltari@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200615090943.2936839-1-noltari@gmail.com> References: <20200615080309.2897694-1-noltari@gmail.com> <20200615090943.2936839-1-noltari@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200615_020950_827670_E79F4A9E X-CRM114-Status: GOOD ( 11.51 ) 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:342 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 --- 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.