From patchwork Tue Feb 7 06:58:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Zhang X-Patchwork-Id: 13131123 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 6B810C636CD for ; Tue, 7 Feb 2023 06:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=gsSA4gZZO8ufV5S3iBO8Zd1KQSUcmBre0QpmHugsdc4=; b=FH3GP5RudgI3Uq 3dMKXwxmb6Qxx2l8bRtl8YPgKRwQE0Hi4OdV/bk0Ac4qTmC8ggewtpCa59LW/WCjf2LuW6M5gTdv+ Nfmrs6SIVfD5UPdAcJlZ3Qd4jTOeTGfHypLj3aqVp3gHdlnELnFO83FnUhs+j8Nnlf6q1SB+Wb0m0 1AK/V2M2YHSPefMuFr8NJVyhDpPpMDgtqGCYcYLYK0wZLB+OdKxthxdBoektwZBgcWrhkV0UP3p9G 1aNpyO7e4VA/mpgvSYw3cRwtWs/gNwUiSGj5TS3s7w4RT4C3eL31jLD3F5xflBhc7Y0vlt3HCRt7g cqXmb2sPzBlmFypsKbRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPHwV-00B33s-TD; Tue, 07 Feb 2023 06:59:04 +0000 Received: from lpdvsmtp11.broadcom.com ([192.19.166.231] helo=relay.smtp-ext.broadcom.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPHwT-00B32w-DN for linux-arm-kernel@lists.infradead.org; Tue, 07 Feb 2023 06:59:03 +0000 Received: from mail-lvn-it-01.lvn.broadcom.net (mail-lvn-it-01.lvn.broadcom.net [10.75.146.107]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 3AB52C0000F1; Mon, 6 Feb 2023 22:58:59 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 3AB52C0000F1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1675753139; bh=jE7c1dPLcvlI1LKoj2DHekUT3pKHSXYImFUa2hckSa0=; h=From:To:Cc:Subject:Date:From; b=nrw/0wudd5qdfefuOh86vIQTRAqLf2LVMPmRkKLo8tNxJVIjEPlZDM1sQkGS8m81r QZVJ7srzXNrOC9qZ1MfgDONPV5XJHV/y/nY3MjRR8VJ9TUKLWmccwFw56vvOHoBl+K CECv2r9VGjJFZo+ES+f7p5RqHLpF4nJAaQ4lkUkc= Received: from bcacpedev-irv-3.lvn.broadcom.net (bcacpedev-irv-3.lvn.broadcom.net [10.75.138.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-lvn-it-01.lvn.broadcom.net (Postfix) with ESMTPS id 2F3C218041CAC6; Mon, 6 Feb 2023 22:58:59 -0800 (PST) Received: by bcacpedev-irv-3.lvn.broadcom.net (Postfix, from userid 28376) id 4E4E0101B35; Mon, 6 Feb 2023 22:58:47 -0800 (PST) From: William Zhang To: Linux SPI List , Broadcom Kernel List Cc: kursad.oney@broadcom.com, anand.gore@broadcom.com, dan.beygelman@broadcom.com, dregan@mail.com, f.fainelli@gmail.com, joel.peshkin@broadcom.com, jonas.gorski@gmail.com, tomer.yacoby@broadcom.com, William Zhang , Krzysztof Kozlowski , Mark Brown , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 00/15] spi: bcm63xx-hsspi: driver and doc updates Date: Mon, 6 Feb 2023 22:58:11 -0800 Message-Id: <20230207065826.285013-1-william.zhang@broadcom.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230206_225901_802103_D7F1E467 X-CRM114-Status: GOOD ( 22.60 ) 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 This patch series include the accumulative updates and fixes for the driver from Broadcom. It also added a new driver for the updated SPI controller found in the new BCMBCA SoC. The device tree document is converted to yaml format and updated accordingly. Changes in v3: - Clean up spi-controller.yaml and update the example - Drop the generic compatible string brcm,bcmbca-hsspi from the document and dts files - Port the cs_change and cs_off logic from SPI core spi_transfer_one_message function to both controller drivers. - Factor dummy cs workaround into a function, adjust the logic for different xfer modes and fine tune message level in bcm63xx-hsspi controller driver - Replace hard-coded opcode with SPINOR_OP definition - Add a new patch to export export spi_transfer_cs_change_delay_exec function in the spi core - Add a new patch to include compatible string brcm,bcmbca-hsspi-v1.0 in bcm63xx-hsspi controller driver - Minor coding style fix in bcmbca-hsspi controller driver - Add Acked-by and Reviewed-by tag Changes in v2: - Update the dts yaml document and all the related dtsi/dts accordingly - Fix build error for Alpha platform - Add a new patch for bcm63xx-hsspi driver to support the new compatible string - Make interrupt mode required but keep polling mode as default. Also add a sysfs option wait_mode for run-time mode change - Remove use_cs_workaround option and change the transfer logic to try prepend mode first and if not prependable, switch to dummy cs mode with clock limit at the 25MHz. Add driver sysfs node xfer_mode for run-time configuration to dummy cs or prepend mode. - Withdraw SPI device specific clock gate option patch for now William Zhang (15): dt-bindings: spi: Convert bcm63xx-hsspi bindings to json-schema dt-bindings: spi: Add bcmbca-hsspi controller support ARM: dts: broadcom: bcmbca: Add spi controller node arm64: dts: broadcom: bcmbca: Add spi controller node spi: bcm63xx-hsspi: Add new compatible string support spi: bcm63xx-hsspi: Endianness fix for ARM based SoC spi: bcm63xx-hsspi: Add polling mode support spi: export spi_transfer_cs_change_delay_exec function spi: bcm63xx-hsspi: Handle cs_change correctly spi: bcm63xx-hsspi: Fix multi-bit mode setting spi: bcm63xx-hsspi: Add prepend mode support spi: spi-mem: Allow controller supporting mem_ops without exec_op spi: bcm63xx-hsspi: Disable spi mem dual io read op support spi: bcmbca-hsspi: Add driver for newer HSSPI controller MAINTAINERS: Add entry for Broadcom Broadband SoC HS SPI drivers .../bindings/spi/brcm,bcm63xx-hsspi.yaml | 134 ++++ .../bindings/spi/spi-bcm63xx-hsspi.txt | 33 - MAINTAINERS | 12 + arch/arm/boot/dts/bcm47622.dtsi | 18 + arch/arm/boot/dts/bcm63138.dtsi | 18 + arch/arm/boot/dts/bcm63148.dtsi | 18 + arch/arm/boot/dts/bcm63178.dtsi | 19 + arch/arm/boot/dts/bcm6756.dtsi | 19 + arch/arm/boot/dts/bcm6846.dtsi | 18 + arch/arm/boot/dts/bcm6855.dtsi | 19 + arch/arm/boot/dts/bcm6878.dtsi | 19 + arch/arm/boot/dts/bcm947622.dts | 4 + arch/arm/boot/dts/bcm963138.dts | 4 + arch/arm/boot/dts/bcm963138dvt.dts | 4 + arch/arm/boot/dts/bcm963148.dts | 4 + arch/arm/boot/dts/bcm963178.dts | 4 + arch/arm/boot/dts/bcm96756.dts | 4 + arch/arm/boot/dts/bcm96846.dts | 4 + arch/arm/boot/dts/bcm96855.dts | 4 + arch/arm/boot/dts/bcm96878.dts | 4 + .../boot/dts/broadcom/bcmbca/bcm4908.dtsi | 18 + .../boot/dts/broadcom/bcmbca/bcm4912.dtsi | 20 + .../boot/dts/broadcom/bcmbca/bcm63146.dtsi | 19 + .../boot/dts/broadcom/bcmbca/bcm63158.dtsi | 19 + .../boot/dts/broadcom/bcmbca/bcm6813.dtsi | 20 + .../boot/dts/broadcom/bcmbca/bcm6856.dtsi | 18 + .../boot/dts/broadcom/bcmbca/bcm6858.dtsi | 18 + .../boot/dts/broadcom/bcmbca/bcm94908.dts | 4 + .../boot/dts/broadcom/bcmbca/bcm94912.dts | 4 + .../boot/dts/broadcom/bcmbca/bcm963146.dts | 4 + .../boot/dts/broadcom/bcmbca/bcm963158.dts | 4 + .../boot/dts/broadcom/bcmbca/bcm96813.dts | 4 + .../boot/dts/broadcom/bcmbca/bcm96856.dts | 4 + .../boot/dts/broadcom/bcmbca/bcm96858.dts | 4 + drivers/spi/Kconfig | 9 + drivers/spi/Makefile | 1 + drivers/spi/spi-bcm63xx-hsspi.c | 488 ++++++++++++- drivers/spi/spi-bcmbca-hsspi.c | 651 ++++++++++++++++++ drivers/spi/spi-mem.c | 2 +- drivers/spi/spi.c | 20 +- include/linux/spi/spi.h | 5 +- 41 files changed, 1620 insertions(+), 79 deletions(-) create mode 100644 Documentation/devicetree/bindings/spi/brcm,bcm63xx-hsspi.yaml delete mode 100644 Documentation/devicetree/bindings/spi/spi-bcm63xx-hsspi.txt create mode 100644 drivers/spi/spi-bcmbca-hsspi.c