From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2BE4C433E1 for ; Tue, 30 Mar 2021 03:29:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C3CF1617ED for ; Tue, 30 Mar 2021 03:29:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230432AbhC3D2B (ORCPT ); Mon, 29 Mar 2021 23:28:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbhC3D1x (ORCPT ); Mon, 29 Mar 2021 23:27:53 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CE60C061764 for ; Mon, 29 Mar 2021 20:27:52 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id w3so22601320ejc.4 for ; Mon, 29 Mar 2021 20:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X1Mep0NDTZqgj41CwSzTV/L+FLNZGsP0ABu2o9b8U30=; b=3iJ6rnxNoJ1aTUrQb8MBityRh32IAoO48UjECVfi4BfI7/zw8eIa5QZsOXEdPj0Ult Ty+5a/+z0tH9MGN4pMs0E1CwVUioqhcepi7Lu84N7r0PBy5kF9ickSommc4x+k/a2Q7B 5E293VfrAtZ/le8pjgcG94Y36E9PUx/WExrGl7fcifPHy0mLzvlaUp7FheK3iZx4EuNi xLS+LonWNrdG4ZdbOnJAxJSrspZk93opFaXsRh4zZX/Fj+TzE1GWOpuunFDm3ojdS1fg kI34Wh6qDZgX/BJt7lnSbqWQ9Hr7UdJ4czc18A6HG2VK+wbwPnHSNukupFvn+R7FyiIC 4ApA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X1Mep0NDTZqgj41CwSzTV/L+FLNZGsP0ABu2o9b8U30=; b=DDzqIb8M7vEj2ArYSs2DUJOZM1HVV8HpYsi7U215GwXVSCQezbJ5d6tV7THOIR9CHA cj5xblIc/RU6fqoLo/uvQdQzLaQTpGqpV2HX7SYWHpWmIhyQd8S/ZUvEvXlYYWccOLfs XFuCeLf87+w9eLu1sOepcQ+HUo7Z131Qh4pdsmGMJ5x+ZJ63I5rxCQXm0mJSCLTMPWPz AugkBKcoWD0azci2EQM+d7rIIpxDD40KjoEjKPE4QDREbJIiRiQYvWBG4+M3FEmEfe8g gSZSHqVuCNwn61AWgZsm99HcL2+2jIXK8NW3DK/x0ih60sBts3veKSrBZY/jkdfeZSi5 sO6w== X-Gm-Message-State: AOAM532TbBDH7YYYJ6XfQE9bAhU6YqhI7zBu/Ti4535rJvp8dLuNgX2P 6Qs0tvM8mNgP5+CnRH/PY0tTtGpcI9BclyMmuJMbzQ== X-Google-Smtp-Source: ABdhPJxJVT4ikpn8Ll3+BLlxrg5DXp62plos3RcvXhSBKDJOAEk7g5/fDnEiJIF4vigHrmnSsJ9PwiqWINiWEhcCWS8= X-Received: by 2002:a17:906:e0d6:: with SMTP id gl22mr30956801ejb.444.1617074870919; Mon, 29 Mar 2021 20:27:50 -0700 (PDT) MIME-Version: 1.0 References: <20210329015938.20316-1-brad@pensando.io> <20210329015938.20316-5-brad@pensando.io> In-Reply-To: From: Brad Larson Date: Mon, 29 Mar 2021 20:27:40 -0700 Message-ID: Subject: Re: [PATCH v2 04/13] spidev: Add Pensando CPLD compatible To: Andy Shevchenko Cc: linux-arm Mailing List , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Mark Brown , Serge Semin , Adrian Hunter , Ulf Hansson , Olof Johansson , "open list:GPIO SUBSYSTEM" , linux-spi , linux-mmc , devicetree , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Mon, Mar 29, 2021 at 3:45 AM Andy Shevchenko wrote: > > On Mon, Mar 29, 2021 at 5:01 AM Brad Larson wrote: > > > > Pensando Elba SoC platforms have a SPI connected CPLD > > for platform management. > > And? It's not a good justification to spread the (debugging only) > spidev interface. > > What tool is going to use it? Why can't you have a driver for that in > the kernel? The driver is in userspace and we need to instantiate /dev/spi0.N in the /dev directory. The CPLD includes a device id and version id that userspace applications use to differentiate functionality on different boards. It wouldn't really be appropriate to use one of the existing entries. For example even with high pin count SoCs we are offloading low speed functionality into the CPLD connected over SPI. The elba-asic-common.dtsi file shows a compatible string of "pensando,cpld-rd1173" which does have a kernel driver we intend to contribute later if there is interest. This IP in the CPLD is readily available from Lattice which provides two I2C Masters which in our case we use for access to the network port transceivers. What was missing in the kernel was a bridge driver that exposes what looks like a standard I2C device to userspace where the drivers/i2c/busses/i2c-rd1173.c handles the spi transfers to the Lattice IP in the CPLD. > > -- > With Best Regards, > Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30675C433DB for ; Tue, 30 Mar 2021 03:35:21 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 B69E1617ED for ; Tue, 30 Mar 2021 03:35:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B69E1617ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pensando.io Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xmno5RAhwOtlJoPlxQZeiNb/3afFiP0qTaoendpglJM=; b=cIryckpfvBTepRVRNOEaKcxcL AMuLGvAQmr9z3KMNJtzd/IcqUq97yN8wVoqGYiyNQ1zoWadsziJRhTw0WmslFTqeekrd8jt/MSqsS mPriKc22bw8uNM1sa7dyNTQzGgdbg/G0yJ7ytH3mNY1MSgkol6w8isYQf5bAwQyyKfaTpInJSH9ko w7GAz5LQ87wlFom2m/HbR+o+LIK1zmDcL05/PV9DzkWg1AnueOKd+zQeFx9SzHAv157P2RpTFXVT5 U2MkDvrrt6y9bTOjuQcQ3HX/5XnDawLv6b3NbPHtuuEcD2few6Y9Jj4JncUpyAU6ZUeT0e1ez4kJs LI+cNMUtQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lR579-002a00-M7; Tue, 30 Mar 2021 03:32:23 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lR52l-002ZDc-Rn for linux-arm-kernel@lists.infradead.org; Tue, 30 Mar 2021 03:27:53 +0000 Received: by mail-ej1-x630.google.com with SMTP id a7so22579089ejs.3 for ; Mon, 29 Mar 2021 20:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X1Mep0NDTZqgj41CwSzTV/L+FLNZGsP0ABu2o9b8U30=; b=3iJ6rnxNoJ1aTUrQb8MBityRh32IAoO48UjECVfi4BfI7/zw8eIa5QZsOXEdPj0Ult Ty+5a/+z0tH9MGN4pMs0E1CwVUioqhcepi7Lu84N7r0PBy5kF9ickSommc4x+k/a2Q7B 5E293VfrAtZ/le8pjgcG94Y36E9PUx/WExrGl7fcifPHy0mLzvlaUp7FheK3iZx4EuNi xLS+LonWNrdG4ZdbOnJAxJSrspZk93opFaXsRh4zZX/Fj+TzE1GWOpuunFDm3ojdS1fg kI34Wh6qDZgX/BJt7lnSbqWQ9Hr7UdJ4czc18A6HG2VK+wbwPnHSNukupFvn+R7FyiIC 4ApA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X1Mep0NDTZqgj41CwSzTV/L+FLNZGsP0ABu2o9b8U30=; b=YvMveWwtZXIR5zkHCoHEPI0YDk4vjCNO1XArgFU6WetO4MFbKZjrZr55TOe1gp8vqj mUJpNome0m+PxsFunpBJXzsebPEQkaskgJolTlWX42KuVkZuNBdIEn/UDhvHijW2Tg1U 5eFD3B30cECzcVbfgVq6375kKiu/vwlkORZm1bge981rYQxr/i7C3WaB4cGq0AYvpjz9 LtsoYNwRxl2OeGsSUQzpcv+wR/vWJgsqbJpTjWLnYxTLadqKOJEFQ6+vHF9kyGI4jvaZ 4hbneC+C1KHt5nkjYj1v5Wu4OL+CZIiNvjSyWVLk3bzQM0yd1njVs8mw1xGnsjgTAL3Q NOGQ== X-Gm-Message-State: AOAM530ftT0Kp++34Jxrt/kPXHM6mdoE0n2D2yz21g5JTAVgJNjKWNP6 p1mcbnRcJ70/w8t7vfxOmGcdvLaVl+dh7E9qU7E+Pg== X-Google-Smtp-Source: ABdhPJxJVT4ikpn8Ll3+BLlxrg5DXp62plos3RcvXhSBKDJOAEk7g5/fDnEiJIF4vigHrmnSsJ9PwiqWINiWEhcCWS8= X-Received: by 2002:a17:906:e0d6:: with SMTP id gl22mr30956801ejb.444.1617074870919; Mon, 29 Mar 2021 20:27:50 -0700 (PDT) MIME-Version: 1.0 References: <20210329015938.20316-1-brad@pensando.io> <20210329015938.20316-5-brad@pensando.io> In-Reply-To: From: Brad Larson Date: Mon, 29 Mar 2021 20:27:40 -0700 Message-ID: Subject: Re: [PATCH v2 04/13] spidev: Add Pensando CPLD compatible To: Andy Shevchenko Cc: linux-arm Mailing List , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Mark Brown , Serge Semin , Adrian Hunter , Ulf Hansson , Olof Johansson , "open list:GPIO SUBSYSTEM" , linux-spi , linux-mmc , devicetree , Linux Kernel Mailing List X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210330_042752_111466_35BD5F8F X-CRM114-Status: GOOD ( 19.11 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Mar 29, 2021 at 3:45 AM Andy Shevchenko wrote: > > On Mon, Mar 29, 2021 at 5:01 AM Brad Larson wrote: > > > > Pensando Elba SoC platforms have a SPI connected CPLD > > for platform management. > > And? It's not a good justification to spread the (debugging only) > spidev interface. > > What tool is going to use it? Why can't you have a driver for that in > the kernel? The driver is in userspace and we need to instantiate /dev/spi0.N in the /dev directory. The CPLD includes a device id and version id that userspace applications use to differentiate functionality on different boards. It wouldn't really be appropriate to use one of the existing entries. For example even with high pin count SoCs we are offloading low speed functionality into the CPLD connected over SPI. The elba-asic-common.dtsi file shows a compatible string of "pensando,cpld-rd1173" which does have a kernel driver we intend to contribute later if there is interest. This IP in the CPLD is readily available from Lattice which provides two I2C Masters which in our case we use for access to the network port transceivers. What was missing in the kernel was a bridge driver that exposes what looks like a standard I2C device to userspace where the drivers/i2c/busses/i2c-rd1173.c handles the spi transfers to the Lattice IP in the CPLD. > > -- > With Best Regards, > Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel