From patchwork Mon Jun 15 08:03:06 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: 11604155 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 25EA8913 for ; Mon, 15 Jun 2020 08:03:29 +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 0389B2067B for ; Mon, 15 Jun 2020 08:03:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="r8BoRJb8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="up1WuBMw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0389B2067B 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=TXg4nEUi+4Mv09bcQiKO+OzjgrBoc8yr4AJdbO4ifwc=; b=r8BoRJb8c1+QF/ MjniAZ9Adh0CcvkycNZe6Mrj7Xwhkn25h210oUqfitKB+RG21rG77q6n7e7Ld7O6eUMIssdmNP+8q Q8bcOj5AgydnMLm6iCwn0a2cwjDQjVgDLwuNtVhwvtF9VKbwkNXGfZl4kXqXyTQkdyQJfYFNpb9W6 fml2P7/NIVbh7yyWQfbYoIGIYhAUGkuWYXj7MXLfE4dBI/eLoWZbCbGNcUzbk15/9Vs0ne/8R8iEi R+pKURhwBpiUMzeIyjZMjr5ce43jPjLZegPfPAQa48r83sIv9YJF9aZ64HHLm18lbH9jgzfzgqPhK 3JgueGTyMRuKWKJFkRRg==; 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 1jkk5W-0007Ji-Ml; Mon, 15 Jun 2020 08:03:26 +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 1jkk5J-00079A-BL for linux-arm-kernel@lists.infradead.org; Mon, 15 Jun 2020 08:03:14 +0000 Received: by mail-wr1-x443.google.com with SMTP id l10so16016543wrr.10 for ; Mon, 15 Jun 2020 01:03:13 -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=NNdjIWpqOIzd0m8ttGrmgbfjsjDdO4jG01Ng0RZ57Yk=; b=up1WuBMwGRcvmOXYMRqouxeXOkJd2O/E8BLE+kbVXTkkODXYZWAPVAt1O3quhdfszR 74kQKXRnYRikyNh6kE63AUijJ2vj/RSe05UTC6WIvc9OZJPEXFqP+RuYg0n1IVHPcLz8 okU0do5NxuhAVm3YVIUur12LMzc4S24BbpD/oPgbaa0X6trDyrXfxf6MA5+nh8KzZem/ 72FTMablLMbz2NirPdcOyOLbc1czKcW+tI5iUGmL6A0RUg1Sr10l/YIghBvdWFSwqcKN +0gSmjenHZvX6dPeOSWJ0mtA6m0AdG928bMW09S4rsOpMCsoLSkxshtZpbE+FvIlmJCR vt5w== 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=NNdjIWpqOIzd0m8ttGrmgbfjsjDdO4jG01Ng0RZ57Yk=; b=poA8bdYB42kx5b/8K//h3eninZ3eCyl7VsGi8PTVdmxyttgT0e376F5fjxQ3GVmRvT BYN0Wt5hbbgaJHs4D6RKUIkQYv4l74BtfWrlYLR/DwmEkJEarWBR/6ERShH9e8CmTWQ7 KxEubAN1jQDkPoCQS0XxEPpQtdyHl/fDcRl1uPXK9RkuPNvTq9KmrnjazsevGpUD5WG+ Iho4EVqOxMN878/tCMeLCmq/p6HSKmdZoQe7faK1houcVkyq5i5vVaQhbWvtYLs0KzZD wRQgEVPp1ZDE6VFjEM+s1yuW5uZ1l4nFa/2Apt07GDGygfkNhbEtjaIl3iEcNr3vRSTK IA8A== X-Gm-Message-State: AOAM530PjASYPwGQcVzuyAChIooj+HjIJTm/Yeb6mkmCAM/Px6OfBy3f jQnfQcHAmNvJTNMicpd0VpM= X-Google-Smtp-Source: ABdhPJzete+uWJ/dRfkMk2DZxKBP3AjJL4ZDB4Hd3SecqASFs6WOH7JWnG/Kwn/bpOzCryfomdgelQ== X-Received: by 2002:a5d:6b81:: with SMTP id n1mr27100208wrx.411.1592208192034; Mon, 15 Jun 2020 01:03:12 -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 d9sm23107054wre.28.2020.06.15.01.03.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 01:03:11 -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 1/4] spi: bcm63xx-spi: add reset support Date: Mon, 15 Jun 2020 10:03:06 +0200 Message-Id: <20200615080309.2897694-2-noltari@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200615080309.2897694-1-noltari@gmail.com> References: <20200615080309.2897694-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_010313_386985_3E4C0C7E X-CRM114-Status: GOOD ( 12.77 ) 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 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [noltari[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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_EF Message has a valid DKIM or DK signature from envelope-from domain 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 --- 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(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 08:03:07 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: 11604163 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 CE04C912 for ; Mon, 15 Jun 2020 08:03:47 +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 7B0592067B for ; Mon, 15 Jun 2020 08:03:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AdGmGFvH"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tuxtRsJp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B0592067B 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=JeHzsWZgdMBOZ2Ulk+DdWV1SAD5F6h2qybygrO4bWCI=; b=AdGmGFvH1ec1Me th23Uyuzlw0Z9cH/vKYES3LWgN/u86tt3a5CAdeTNC1TdTCIuSaICvR7PMp2SfizOJitSc7TGgVMb ofw1Y+d2zr5esNzF/BnKIprr3dMao71/kOrXYGtgqtp6+9a947i0ykxvgpv5URhUDwA5Vsd0ezHYc ZacZdXdjue37dSXlLtUGiFmreFPygMzvhFYnRVFHDGbbGvFWwMoKIhTjpUYHtUUIQU83wtKu07TfR foP0zxiIf2paMKkFwtiFWcW7usGPCINXfKrRaKKatMjgWIN3YLnf1VlIf/bBGiGEJ9OJ+s/HsaVDo 8AfNzuG2AoQsoMcknEgA==; 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 1jkk5j-0007Xq-0S; Mon, 15 Jun 2020 08:03:39 +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 1jkk5K-00079V-PX for linux-arm-kernel@lists.infradead.org; Mon, 15 Jun 2020 08:03:16 +0000 Received: by mail-wr1-x441.google.com with SMTP id x14so16050623wrp.2 for ; Mon, 15 Jun 2020 01:03:14 -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=9j15buHhd4MKiI4Z3W6luNAtm0Ob/ZJTryZmnMV59NY=; b=tuxtRsJpBCC8hJ2ghKhM7f9YV3ySoYO4eBPB/Y4VIPmWwyaVL9hiX9POpvkdaHrw0y J7WmzDSdaWFgcz9vrNERXvOUtplVmkQzQAGgxeyKMTpSlUt6wi3jO+/UqtFFzFs07SGW tTxgd9WT7riJQ8rse1SaO0n4DfkBv2gpVERAPg6ygOnKi0xInK6VnS/SgRESLQN3nVRE iW85QSm8caxEXuBqMJZHgpsoLgIwnJgE7Te6HkeJaccvKV64qug/03RrOoW9qPtl93MF EcL9bLCWm+U1mHtWOV8KpN8e5AWNBiBowFxRSGss+hxdBylEVP8/JYcj3BM5cn3A3JLh JB0Q== 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=9j15buHhd4MKiI4Z3W6luNAtm0Ob/ZJTryZmnMV59NY=; b=nh/pEax4SQiL/kXupDAH6+dOlqOIjGj5dB71b0Ip6plXKyxGfYMItCYaJpspxPOCfI X1ffVghaiA38tptW/MKQ3vrZVjNdNIeXuFtmIIY06+GvmM7GyYPVaqMTpdMLeztHVBM3 POe5mwZRB1vXtrt1AuJl8CdQtB95YhmEnORklS/qzUbH8ZAFnAnAH5akPOnzu1dVAc46 1XoC4OSJUwP9cj+pxWIriSETeLtSufcrfy8+vyoiXjmclDwNQEPB2my0K/otvaFgJg3J XfFHZ+ltXpoDzlIgBzX7mEvBYguWfJW1blvML0Iv0al6ig3UDjHsMhOC6AmCtw+68D2t IgNQ== X-Gm-Message-State: AOAM533aX9tRgSOVRSbliGlL9pxm9CNWLbpmKjLTSxXiAK13KDVKkTYN 3UzthHIwTDSh4ZNYhDFNZdw= X-Google-Smtp-Source: ABdhPJyeyKfGDyTdOzNRz2x3lHRjgrXZmAham+P818HmOVjjddX+R87QLRQVlvHCPqimUKeT3cJ7DQ== X-Received: by 2002:a5d:4a89:: with SMTP id o9mr26527669wrq.267.1592208192924; Mon, 15 Jun 2020 01:03:12 -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 d9sm23107054wre.28.2020.06.15.01.03.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 01:03:12 -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 2/4] spi: bcm63xx-spi: allow building for BMIPS Date: Mon, 15 Jun 2020 10:03:07 +0200 Message-Id: <20200615080309.2897694-3-noltari@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200615080309.2897694-1-noltari@gmail.com> References: <20200615080309.2897694-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_010314_823309_14353998 X-CRM114-Status: GOOD ( 11.90 ) 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 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [noltari[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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_EF Message has a valid DKIM or DK signature from envelope-from domain -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] 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 --- 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 08:03:08 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: 11604167 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 4020C913 for ; Mon, 15 Jun 2020 08:04:19 +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 1CD442067B for ; Mon, 15 Jun 2020 08:04:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qX4DwF7Z"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aHrtiM4I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CD442067B 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=FM/rRhEjO//kO7bxjNdtLG3E7AGuCJXFpFuFEyN9USg=; b=qX4DwF7ZdwJMMK Q9sIu4QbBMEvov9oExMUFvnb8WIKF0RF+n+p01JnnGG1MIGX+w40IW5JnLzXPePM/+e1G0MxEW5oB hEvqeA1j6GJMWkF22lAIl51uWdrpNLcOxkefxbIX0iw0twZ5f3cI8K69ATULuV2Y1/CGDgERzGZgm xowV1U7WJWhWd0eSPPK9Sy3CRhPf6Ars/S7crdHiXD/f3OleIqFDQPZopdWZLbg2i1WVpOmQDHQvX a0M91mw0FQqCTbFMpJxjzvoTu1JDGrT+5iAWCbPq/xxee/KsnTVXOuFkAbyyAaR43b4zIgzESHc8n ClM0exvIaIFcKm6NYiYw==; 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 1jkk6E-00082R-TG; Mon, 15 Jun 2020 08:04:10 +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 1jkk5M-00079c-FD for linux-arm-kernel@lists.infradead.org; Mon, 15 Jun 2020 08:03:17 +0000 Received: by mail-wr1-x442.google.com with SMTP id x14so16050676wrp.2 for ; Mon, 15 Jun 2020 01:03:14 -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=yyxGbzg5FRRWYSJHpphoCM/7g3fdi4Cub/m4VF29fJ8=; b=aHrtiM4IgI231hsx5aGRUbfgOB/VAF55Jfu3aNyk3m+Wflrr1n9/1n5Bxze4ib0Twt HXF3rWSwGj5ULWJDTUHCAifQ3RwzcrJ6DTzQR2riuPsWiOcsxfs/qWIZEisZelML3wmJ LvcFKmx3ZM/vHUGPswD/og9g0aZ7yHhixoUXEoJzHooAho+sRfZ3sC+EbjUKkPb0BsQX lYuhVWc847T9ljikOITJBhvEXmeKNJihRFAt35HbiOr+9EPWBklwiODBwdZkQS+ML3GN 9d5n4KeIwqySxKHYo8eYWLD3J2gqohgk54AfltJV3ymIV+T8tMGYBr2w4foLAa9pE57K ZvTg== 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=yyxGbzg5FRRWYSJHpphoCM/7g3fdi4Cub/m4VF29fJ8=; b=MOwi0NChcwJxSJaAPQUY0I6fsM6yhWaSfLdbaBgCGqLGnl6mE3UMHmPfEtlIbnfKlr B4ytCglaWeuts1Amg3pdKxhdVFxXIOelfUYyiG902A2fgzJQw5HjviTvskp7UApvye6N F+C35UnSB3gXJIJZ42CX+1Cj+sl2sB3nIEJ1ybNCFvLnsBqCY5P6Qf0zZ1ei184FquYw ppkmSslf8kj1cOWJ2lDak1tAH5OViVjyAplrCOXhAyUT69mGINyQdi0GNwyR+lBoUb3I RdtABs+ksLqHtQ7zRh+k+wbf9BXLcs/9bUxPtjuiNSWYCeqwHtSTDJWAmbGvdabiAo+X q+7g== X-Gm-Message-State: AOAM531fMotSYlc3YRC1uKLhXXA7fyAqbLX4aesvvHYj0FPzlk2kkGyB ufw0Auth7EDLIGJKHz4kY+s= X-Google-Smtp-Source: ABdhPJyVfOfRWwPytyd/13wO0uW8sOuZZgWpictu6cZsZyACR5rnquhjY++l8vHSdSL1yyxVcvj/pg== X-Received: by 2002:adf:fd49:: with SMTP id h9mr28169413wrs.67.1592208193774; Mon, 15 Jun 2020 01:03:13 -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 d9sm23107054wre.28.2020.06.15.01.03.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 01:03:13 -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 3/4] spi: bcm63xx-hsspi: add reset support Date: Mon, 15 Jun 2020 10:03:08 +0200 Message-Id: <20200615080309.2897694-4-noltari@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200615080309.2897694-1-noltari@gmail.com> References: <20200615080309.2897694-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_010316_531635_0225E800 X-CRM114-Status: GOOD ( 13.00 ) 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 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [noltari[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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_EF Message has a valid DKIM or DK signature from envelope-from domain 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 --- 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(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 08:03:09 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: 11604165 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 49826913 for ; Mon, 15 Jun 2020 08:04: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 263B72067B for ; Mon, 15 Jun 2020 08:04: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="cKrFEpH1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g0xVjqvB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 263B72067B 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=d91c7zL8yt3kcK8EXXK0bFjyMW5jwtEoF92s0EnvoIc=; b=cKrFEpH17EeJ9m JxA08SkOWNzXvoR4qiuRcDOfIWcb5esm1kpM56g85YUR0/PGb4dJ8vzD9OErNycoa+FvMxvhvw5L/ LLFBAaFBFd2LzM3r0BCbZAXXPi1Gw+nAGNjGVrW1+wKGQRufamR25N/yVTm4wpYsnE1vDHnCOrSe2 wR3Rx+FeGNcyaL5wXSs9UXNJlLwS2fo1klfO3laknKwcimfQH3cC0nUeDKjZEsr/3YtPyp+HRLAGf MaX/l5c2rCoBgon+rV81cttpzkm/3c3Kcage/PkpDWy9aWAbTOzA6hpUnNe+4t6zFdPxxR4DU/QAj jCpTn2505ORz8iJ25Gow==; 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 1jkk60-0007qB-Ec; Mon, 15 Jun 2020 08:03:56 +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 1jkk5L-0007A1-VL for linux-arm-kernel@lists.infradead.org; Mon, 15 Jun 2020 08:03:17 +0000 Received: by mail-wm1-x342.google.com with SMTP id l26so13620158wme.3 for ; Mon, 15 Jun 2020 01:03:15 -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=gdBft9EbSQxaFcZTBWSVvkfUii6hPWZmZod51XcwM3g=; b=g0xVjqvB6k9fvH6NGm+kO1T5wfZO8l3HKdzO0wSQSvO2LpekjvxflpTQDNAIQwNFao CkC2YMDv0ekrfG7O72j4wUaOThC9p2xN7Tme5DBv+m+tVSh7ZrzvlkDbEBOZ7ifa9usK JiwaiM2Dr8wZX+5MtOVp+PPFMUJf+zc5KIexFxEwW31/CM2AWYgZCg46reKbT1t3Gfgh 4Gq8r9CvsBhuWMUMYuGX62d25dJ8CzujSjfQjRUapV+wxzqtu+AYvmTD7jpQJWmoeA8I qgqBqONep8a3VQZFmNc5KlCL+2UFCM1nojOHZrNSX8rYNo2XpEZG02QzWTp7NngeiSmy r9gA== 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=gdBft9EbSQxaFcZTBWSVvkfUii6hPWZmZod51XcwM3g=; b=pLxMFMRZLIh8c7T+HmQLHUZv9V8FPhilQLG+bvGWxmi0VjBfCt7VHdURsE04u6r6cE qGJbnwkRjb83Qplhmu5aCa41jccMEBzgiUkDDHfKAkKxMF/IMwUVn5VBhjMSYcs+IULq ajUaIAZZhGhR4zxNjwdWLW2npnDAfZ8NcpqpYdIt/OdYVO8kyVfmqiVoJ9cenu4tWBGb IL0k4C/erw5jtt3VOOxv4L5ecr81KyY6pss9tUXjrMsDdRNnwcTkPoKYqqv9yu0e4Cnd LBn9o4Pu7mA7U7uTP2q2ALk8/LnynLm2MYMkUUkZihwP0CFdL0sXn3NfQ5N6ekEb5XiP Ms0w== X-Gm-Message-State: AOAM5329FY03GnuXiwwEP/b9OrlA2liCx3dY06jVl2t6JrfR7SXaHoHi SAzDZ8K8/YXzFum3Kqpby5Q= X-Google-Smtp-Source: ABdhPJwYOlEd8lleqkaydTaZ9E0KnDTQorRKqyyOV9fUtb2vgr76+4VExaNKd9kXu5f/DzFqlcXUeA== X-Received: by 2002:a7b:cf2c:: with SMTP id m12mr11782506wmg.70.1592208194668; Mon, 15 Jun 2020 01:03:14 -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 d9sm23107054wre.28.2020.06.15.01.03.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 01:03:14 -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 4/4] spi: bcm63xx-hsspi: allow building for BMIPS Date: Mon, 15 Jun 2020 10:03:09 +0200 Message-Id: <20200615080309.2897694-5-noltari@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200615080309.2897694-1-noltari@gmail.com> References: <20200615080309.2897694-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_010316_007303_CB2FA45D 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:342 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [noltari[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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_EF Message has a valid DKIM or DK signature from envelope-from domain 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 --- 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.