Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp685169pxf; Thu, 1 Apr 2021 10:52:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxp3apL7g47hfryBd3aE9GMdK1A/Izmy2RcJpt9HEBVdvFupTN80IliKK7kp89zwLzjrNSR X-Received: by 2002:a17:907:929:: with SMTP id au9mr10271294ejc.28.1617299568138; Thu, 01 Apr 2021 10:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617299568; cv=none; d=google.com; s=arc-20160816; b=wJxwEkINBEmkSVkuV0qDbnMMQfx/vGs3SQtwgTXbGTibXiVwoQ2ZY8Cx/L160NW3uv COiSyvdy+3NMRH1C5Rfqg6E4LbdFeTlTcWk8quwV5Bw6MtC1gaCW1z0PjPQluvpk/eha yevVWUydDx9AXBD8Te97Jx+e94FkQx0nS/+hRFB0OeWUL9HRk69p1n9F+LDb/iStUsGi ys5qy3maaoTI1w5FpmoxK5N+/MfQGGzCUfK+wUog6cc7+GA9TXFRkEEF5GgBJfoCGKLj yZy6rJeBjvJSE2yVq7Sf2LpO3orT/Se2s7OKSXkxZhzbiGxuOtgYmyrjE45OrKnH7N4n Hs0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kgXD3U/DrQ9vSxCEaPsInQj0EAhn8kdogWYjyNQBOE4=; b=ePNO32MKad7xRcZzAb2P8GAnkFpqxfyEi8lyE7lZ970nazMi1UJxhcPq3QdTGS0oX3 UvrhJxfRNfAv9QT3ueomtHTYoCXf9mPQzPMr1oj3d0yARRUT7BUpaJ7G2KRxz2z57G7W o2lKWlf4Td1aC23R7d4sgBQ2zRxYXrbXx+qBAIN3Ij2EokdQedycYSfi7QR3+jvuazEM ea4huFw5fInuJXQtZzg7af74pDvC55M7DATsbbcQ0LEhy3iT1dkfIElZEhxLVweCDnEg zv+86Q6us7w+TfuaPwIU3xfeOnPbtwWYWiReu+qxe63cBGxQ+66fGQE0DEl3H52qhI6R ockw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KE3cKfhc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si4395642ejw.723.2021.04.01.10.52.24; Thu, 01 Apr 2021 10:52:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KE3cKfhc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236624AbhDARt2 (ORCPT + 99 others); Thu, 1 Apr 2021 13:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234740AbhDARje (ORCPT ); Thu, 1 Apr 2021 13:39:34 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 274A4C05BD35 for ; Thu, 1 Apr 2021 06:08:07 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id g8so2699612lfv.12 for ; Thu, 01 Apr 2021 06:08:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kgXD3U/DrQ9vSxCEaPsInQj0EAhn8kdogWYjyNQBOE4=; b=KE3cKfhcFR48eqKLC026k68pj4XXeu75rKpuzgjr/cCOeB3a2ZoW36SGUE4+5fJ2Kg anl1T6Ry7ODVw+cyx2r1T6RHnx5kkzvXPZPGKI/WinOkm3cxHCJYDKa47N7RMBmg7W4o bT5zsLP/Ud06DHmEe7NDDOvxnTDhyg1EfC+zGD+QJKaaFK6GMJr9QI5VTH7yhehh0ZRB 8jsBc2SewYPaNHJ6kej06LXk7XfXSAiPhQfS9i2LVStwmZfSGw69eirzZd0H+DeFfmaV +Tj7OUgjmT6L8z/J7Ndvo0Fs7o0gWpUXH8ddz91BF+gO0bZ66D+xNFhJTvSJKD8cniuS 5M8w== 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=kgXD3U/DrQ9vSxCEaPsInQj0EAhn8kdogWYjyNQBOE4=; b=umNcC+zdeTYmXNUezbGYuYMnPzTA37i1G0ytZn87A6jIkSWMr8r7XC9G0Acy3U3nUN /F/sd15ChugbNrjKSJy5fp45QVyXjTWcBrSMH+mjeDkIEGchZEJJNZbByihEsjdvaZW6 UhVyhhGLChGkfgy5XcIcg2kA67+tJAqMMWEg1YDBlpIhuXHEti5R0IvZ0L6L/7t8nanr 9OvyGfIrcUp+Q7fPq25UcblSWitTuGr+jCmcmpHLKCB8zi408ZuntyAz09fQVoDmucvZ xvYjpx0Ca86gMC6neIJ03EaJMrkoY73nICnv+nlxTgLdBi3Dq306XDEaXJvM/4WilKJb U/JA== X-Gm-Message-State: AOAM530hCEMuG7jP3/D2CNFqvTIp4J4IUuSelRSA1D5RsOH/Tf7KkSiE N4a/MxVTcxn4Wez5qveuJ9dt27r5OswFvYAueyO/iVAVn/F2Cx6g X-Received: by 2002:a05:6512:243:: with SMTP id b3mr5550624lfo.529.1617282485530; Thu, 01 Apr 2021 06:08:05 -0700 (PDT) MIME-Version: 1.0 References: <20210330085655.12615-1-wsa+renesas@sang-engineering.com> <20210330085655.12615-2-wsa+renesas@sang-engineering.com> In-Reply-To: <20210330085655.12615-2-wsa+renesas@sang-engineering.com> From: Linus Walleij Date: Thu, 1 Apr 2021 15:07:54 +0200 Message-ID: Subject: Re: [PATCH RFC/RFT 1/1] misc: add simple logic analyzer using polling To: Wolfram Sang , Bartosz Golaszewski Cc: linux-kernel , Linux-Renesas , "open list:GPIO SUBSYSTEM" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 30, 2021 at 10:58 AM Wolfram Sang wrote: > This is a simple logic analyzer using GPIO polling. It comes with a > script to isolate a CPU for polling. While this is definately not a > production level analyzer, it can be a helpful first view when remote > debugging. Read the documentation for details. > > Signed-off-by: Wolfram Sang I am a great supporter of this idea. When we created gpiod_get_array_value() and friends, the idea was exactly to be able to do things like this. It's a good way to utilize the fact that several GPIO lines can often be read from a single register read. > + i2c-analyzer { > + compatible = "gpio-logic-analyzer"; > + probe-gpios = <&gpio6 21 GPIO_OPEN_DRAIN>, <&gpio6 4 GPIO_OPEN_DRAIN>; > + probe-names = "SCL", "SDA"; > + }; > + > +The binding documentation is in the ``misc`` folder of the Kernel binding > +documentation. (...) > +++ b/Documentation/devicetree/bindings/misc/gpio-logic-analyzer.yaml When other debugging tools for GPIO got DT bindings it was concluded that it is possible to create bindings like this for debugging without even specifying any formal bindings. They are just for debugging after all. Personally I like the bindings anyway. > diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig I would consider housing this tool under drivers/gpio actually. We have other funky things like gpio-sim and gpio-aggregator so why not. I would create a Kconfig menu with "GPIO hardware hacking tools". But Bartosz would need to agree on that idea. > +config GPIO_LOGIC_ANALYZER > + tristate "Simple GPIO logic analyzer" > + depends on GPIOLIB || COMPILE_TEST > + help depends on EXPERT I would say. Definitely not something for the average user. Yours, Linus Walleij