Message ID | 20230426071045.20753-1-zhuyinbo@loongson.cn |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp60597vqo; Wed, 26 Apr 2023 00:23:18 -0700 (PDT) X-Google-Smtp-Source: AKy350Yvai1CGT9wMSBAkub+IrQrk+B7QOWc1GEoiVtGlMBfK8iGvYW6dY5HpUZvgYvlOa48ur1o X-Received: by 2002:a17:90a:ac07:b0:247:2152:6391 with SMTP id o7-20020a17090aac0700b0024721526391mr19336474pjq.17.1682493798064; Wed, 26 Apr 2023 00:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682493798; cv=none; d=google.com; s=arc-20160816; b=lJ5rA7ZsVfrHZa+oHE92RovptprgHs9Ps3u5KiRHS1BLKvXKeiLsZi5NI9a2ZXjgw/ MTe4ko7vyBtP2r8VuwcSFTWLTFgABSVMY/5QnHSvufdIlLX/boR4Fj5T3oWMvkOYZDRn vQx6KxxMbh8TEjVqmIk+QwGAopeWDfm8X6UgNh9mCnIJpCntXuYLhs9AE0ErA7EEhDJe 2vAFx6x8NjX6ikvSmJw4vQedQ6KAF/A1j7oegD6yFzen1sEY8vDVqvhBiBdVryXakWvp YbKSMuizNRj+RE8pUG1yz2c7Ufi3RIJbkT7E2LTrswPOBew0LxwWv8cQF0ds4Zh/XAjl DJ/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=cIsSQT3Ape3El+Hjp/K9V2xG37KyqiqmiV+OJ9SG0KM=; b=nO3pFqns3TkhhCvDbNFQ0dii47VIZ8Op/6ohSKbC2kGVn+7gxF+RYehLHiD+9rgln9 7TRXHa2KxOX5xumaa2lHwDrXNWqRcyERjtrhPISjIURkktAj7SUr5Iv4iqOzdPG657X1 otr0wmvZMaMPkx5KgeJUxLES8tBX/WuwJBXtT3ETGLX9lYx1HqZZzT0KXPQwfVMpk/EP 5LwkvUFQPlFK0xF6VhnObek3ikdDrzQbgCNC9Z15rgHAHrqVpZ7D2iCUo/WLy/TqdeAJ 83+fiZjIxBsWR4PUbrjQbQ3iaXj9/ui+0sul545mQdA4BTQJQ2UDrWwnjMj9PZ2r2CPB xxGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a17090a7a8e00b002474825c1f0si18168192pjf.123.2023.04.26.00.23.06; Wed, 26 Apr 2023 00:23:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239711AbjDZHPa (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Wed, 26 Apr 2023 03:15:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239635AbjDZHPY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Apr 2023 03:15:24 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ECDCE40CF; Wed, 26 Apr 2023 00:14:37 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.35]) by gateway (Coremail) with SMTP id _____8AxV+mDzkhkQOwAAA--.1617S3; Wed, 26 Apr 2023 15:10:59 +0800 (CST) Received: from user-pc.202.106.0.20 (unknown [10.20.42.35]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxWbJ3zkhkd2M8AA--.16320S2; Wed, 26 Apr 2023 15:10:56 +0800 (CST) From: Yinbo Zhu <zhuyinbo@loongson.cn> To: Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jianmin Lv <lvjianmin@loongson.cn>, wanghongliang@loongson.cn, Liu Peibao <liupeibao@loongson.cn>, loongson-kernel@lists.loongnix.cn, Yinbo Zhu <zhuyinbo@loongson.cn> Subject: [PATCH v9 0/2] spi: loongson: add bus driver for the loongson spi Date: Wed, 26 Apr 2023 15:10:43 +0800 Message-Id: <20230426071045.20753-1-zhuyinbo@loongson.cn> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8BxWbJ3zkhkd2M8AA--.16320S2 X-CM-SenderInfo: 52kx5xhqerqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvJXoWxWFy3Zr48trWrJw4UuFW5Awb_yoW5KF4rpF W5C3Z8Kr4DJF4xArs3Jay7ua4rZ3yrXrZrXay3t34DuryDZ34UZr1ktF1rZrsrAF4ayFn2 qFy0grs5Ga4UZrUanT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU b7xFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUXVWUAwA2ocxC64 kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26r1I6r4UM28E F7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487 Mc804VCY07AIYIkI8VC2zVCFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUXVWUAwAv7VC2z280aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JMxAIw28IcxkI7VAKI48JMxAIw28IcVCjz48v1sIEY20_WwCFx2IqxV CFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r10 6r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxV WUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG 6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr 1UYxBIdaVFxhVjvjDU0xZFpf9x07j8pnQUUUUU= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764222616691947818?= X-GMAIL-MSGID: =?utf-8?q?1764222616691947818?= |
Series |
spi: loongson: add bus driver for the loongson spi
|
|
Message
Yinbo Zhu
April 26, 2023, 7:10 a.m. UTC
Loongson platform support spi hardware controller and this series patch was to add spi driver and binding support. Change in v2: 1. This [PATCH v2 1/2] dt-bindings patch need depend on clk patch: https:// lore.kernel.org/all/20230307115022.12846-1-zhuyinbo@loongson.cn/ 2. Remove the clock-names in spi yaml file. 3. Add "loongson,ls7a-spi" compatible in spi yaml file. 4. Add an || COMPILE_TEST and drop && PCI then add some CONFIG_PCI macro to limit some pci code. 5. Make the spi driver top code comment block that use C++ style. 6. Drop spi->max_speed_hz. 7. Add a spin_lock for loongson_spi_setup. 8. Add a timeout and cpu_relax() in loongson_spi_write_read_8bit. 9. Add spi_transfer_one and drop transfer and rework entire spi driver that include some necessary changes. 10. Use module_init replace subsys_initcall. 11. About PM interface that I don't find any issue so I don't add any changes. Change in v3: 1. This [PATCH v3 1/2] dt-bindings patch need depend on clk patch: https:// lore.kernel.org/all/20230323025229.2971-1-zhuyinbo@loongson.cn/ 2. Drop the unused blank line in loongson,ls-spi.yaml file. 3. Replace clock minItems with clock maxItems in yaml file. 4. Separate spi driver into platform module, pci module and core module. 5. Replace DIV_ROUND_UP with DIV_ROUND_UP_ULL to fix compile error "undefined reference to `__aeabi_uldivmod'" and "__udivdi3 undefined" that reported by test robot. 6. Remove the spin lock. 7. Clear the loongson_spi->hz and loongson_spi->mode in setup to fixup the issue that multiple spi device transfer that maybe cause spi was be misconfigured. Change in v4: 1. This [PATCH v4 1/2] dt-bindings patch need depend on clk patch: https:// lore.kernel.org/all/20230323025229.2971-1-zhuyinbo@loongson.cn/ 2. Add "#include <linux/io.h>" in spi-loongson-core.c for fix the compile issue which devm_ioremap no declaration. 3. Add "EXPORT_SYMBOL_GPL(loongson_spi_dev_pm_ops)" in spi-loongson-core.c for fix the compile issue which loongson_spi_dev_pm_ops undefined. Change in v5: 1. Get rid of the clock patch's dependency and open-code the clock IDs. 2. Fixup checkpatch issue that by installed ply and gitpython package locally, but this series of patch's code doesn't have any change. Change in v6: 1. Remove the "#include <dt-bindings/clock/loongson,ls2k-clk.h>" in yaml file. Change in v7: 1. Remove the "loongson,ls7a-spi" and change yaml file name as "loongson,ls2k-spi.yaml". 2. Use module_pci_driver and module_platform_driver to replace module_init and module_exit. 3. Drop ".owner = THIS_MODULE" in spi platform driver. 4. Add devm_spi_alloc_master devm_spi_register_master to simplify code. 5. Add pci_disable_device() in loongson_spi_pci_unregister. Change in v8: 1. Add reviewed-by information for spi bindings patch. 2. Fixup the uncorrect spi yaml file path in MAINTAINERS file. 3. Add spi_master_suspend and spi_master_resume in spi pm function. Change in v9: 1. Make spi_master_suspend go first in pm suspend. Yinbo Zhu (2): dt-bindings: spi: add loongson spi spi: loongson: add bus driver for the loongson spi controller .../bindings/spi/loongson,ls2k-spi.yaml | 41 +++ MAINTAINERS | 10 + drivers/spi/Kconfig | 31 ++ drivers/spi/Makefile | 3 + drivers/spi/spi-loongson-core.c | 296 ++++++++++++++++++ drivers/spi/spi-loongson-pci.c | 72 +++++ drivers/spi/spi-loongson-plat.c | 47 +++ drivers/spi/spi-loongson.h | 41 +++ 8 files changed, 541 insertions(+)