Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2190082lqo; Mon, 13 May 2024 10:14:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXgHXYs3Mnd/gXxCCd/YZ+QQU776JtCO2MBFB8qZFGu/IMJQSk8UJwzE6AEx7lvXRsH4huJck2FY3ys9gsdP0V0RFSFhryrWC3e5ODq+w== X-Google-Smtp-Source: AGHT+IGv50WpOXRPK1pGQQc3OoaXOyvEndQ/ykguzb43naT84x/1d8SuV6JZyogkrs612j2DhAm0 X-Received: by 2002:a17:90a:348d:b0:2b4:32ae:4712 with SMTP id 98e67ed59e1d1-2b6cc141d7emr9673464a91.9.1715620452506; Mon, 13 May 2024 10:14:12 -0700 (PDT) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628a5b91fsi11646394a91.40.2024.05.13.10.14.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 10:14:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177874-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=uMpModaY; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-177874-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177874-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A2CBBB212EB for ; Mon, 13 May 2024 17:06:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7FA601CF8B; Mon, 13 May 2024 17:06:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="uMpModaY" Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 014D22B9CD for ; Mon, 13 May 2024 17:06:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715619992; cv=none; b=UUnT3ZFm5G1oohN8xvTdbxPcSkCFvhuigusEQfn36LxCMJjadvyBvajYrQl3gQQh2uTK5wYXOXwTX6NlVI6jz5G7y4oMMo02Hqr3qXBPBPZvXK8UUmgWA4N/3dhWrMZ9/hICOFxBQs2wM6T86299MCqKJSI6BnPDqpRymNHVmO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715619992; c=relaxed/simple; bh=+P2SBhCjt1cNR4Hf9i6Gn7yMnwDDxmC4jAga89KBFuE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=AQrPt4QBSHgbEEBtre8LAAmhxRYzWxRFLF9b+Hj+JofRtDHOVHqgydrP2nr78WLojNyxk5gRGiNBi41FFatrtLsLUCA1AqUFbvXJS6fKHo9iP0OIzEtewKqpXXiOZRm6U76dYhotKVQBnBm672gzucmzFPXw7JkPKIV755tN1Oc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=uMpModaY; arc=none smtp.client-ip=209.85.208.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2e09138a2b1so65083101fa.3 for ; Mon, 13 May 2024 10:06:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1715619988; x=1716224788; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pXw985lX5WlJQmTXNpCIqA41wwGetKb+YHxlJsQLqRM=; b=uMpModaYv/H/oI7+De0gNVizuEccAKWldn0kSElxpz/rh8aMUeq/+9KzwaYCqX8ri+ 211heG2kYg+4Nk17DCqrHBD3Xh1SVC0w/0IkVv/llELypli35hjvisBLxQeC5d4YEif9 lUIeeqJyW7u68NTJjuXdOTvIGljGo/on5VrpiE+OQvbzSSzagU89cgaaFgUYlCtdjpQd qprrFIBa4x8Ze1Mx1tne3tQeVP7BcCmbmT8wuemhOmFs/NzeW3DuekXkdpC19A1OsE/x DriXu0c4jcxfCLe7fmn5QAUuN48au5ZzZKJZdSlEpHLAS6n5rhBRQoJz3dK1F0xmaxVt 0oqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715619988; x=1716224788; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pXw985lX5WlJQmTXNpCIqA41wwGetKb+YHxlJsQLqRM=; b=hamGAU7P2C+xqJZZl1i5vBEnuDFuNXbS8VHZp1KlBaZKmA46BbaeywfgkGMs1JZ7N3 LuEUV0uoWRDkxfeiAF6NHzjwXnHH6msWazzGNBf7zDtKB5Krw/cVbOMLpMNm3syGAPhx 0gRZcR8scJtAzKfQVfQYN+r8N2XqGAS8woS15eXCWPTFhADo4oQ17VvtCPTujNIkGafd RBHfQFCMATZ4jjEmtcVhJMq0JzO91GXtlGDeZmH+RdzhseAsaVZnvd19+J60zp9MUEoY 8T36GjQlq7lQI5fIbVFcJjkMlke4gq6ZXs1h/oedv2lJvA+KE7HPpkKDtnvs/VK7eigi vRCw== X-Forwarded-Encrypted: i=1; AJvYcCX96PzAEoNsLTsZh1oLdu0cPvdB+5LrQTYd09CdS9cZdKrg3rVcpftkteu78XcaNQFq9VcIIG+aHVfES+DZ1z1MPm4Eopp9IjxFKP3J X-Gm-Message-State: AOJu0Yz1FxNkS8ZPnLUrHzk+LlwXzc5qX45/3/1ObHyDWp3LlX4+ZXRl aNSj0OeG5+JoRCGf/U5dUimZdfirz269w626+Qi1P/6Iu5+eAW+WG+bNIT8VtotZXjReClkO9Wb 5GKe+LATF2m/R6k+VUz/MEr2t9XZ5tmGdDiinSQ== X-Received: by 2002:a2e:b1c5:0:b0:2d8:8eb4:11a6 with SMTP id 38308e7fff4ca-2e51ff5ce50mr63520551fa.12.1715619988132; Mon, 13 May 2024 10:06:28 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240510-dlech-mainline-spi-engine-offload-2-v2-0-8707a870c435@baylibre.com> <20240510-dlech-mainline-spi-engine-offload-2-v2-1-8707a870c435@baylibre.com> <20240513-headsman-hacking-d51fcc811695@spud> In-Reply-To: <20240513-headsman-hacking-d51fcc811695@spud> From: David Lechner Date: Mon, 13 May 2024 12:06:17 -0500 Message-ID: Subject: Re: [PATCH RFC v2 1/8] spi: dt-bindings: spi-peripheral-props: add spi-offloads property To: Conor Dooley Cc: Mark Brown , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , =?UTF-8?B?TnVubyBTw6E=?= , Michael Hennerich , Lars-Peter Clausen , David Jander , Martin Sperl , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 13, 2024 at 11:46=E2=80=AFAM Conor Dooley wr= ote: > > On Fri, May 10, 2024 at 07:44:24PM -0500, David Lechner wrote: > > This adds a new property to the spi-peripheral-props binding for use > > with peripherals connected to controllers that support offloading. > > > > Here, offloading means that the controller has the ability to perform > > complex SPI transactions without CPU intervention in some shape or form= . > > > > This property will be used to assign controller offload resources to > > each peripheral that needs them. What these resources are will be > > defined by each specific controller binding. > > > > Signed-off-by: David Lechner > > --- > > > > v2 changes: > > > > In v1, instead of generic SPI bindings, there were only controller- > > specific bindings, so this is a new patch. > > > > In the previous version I also had an offloads object node that describ= ed > > what the offload capabilities were but it was suggested that this was > > not necessary/overcomplicated. So I've gone to the other extreme and > > made it perhaps over-simplified now by requiring all information about > > how each offload is used to be encoded in a single u32. > > The property is a u32-array, so I guess, not a single u32? It is an array to handle cases where a peripheral might need more than one offload. But the idea was it put everything about each individual offload in a single u32. e.g. 0x0101 could be offload 1 with hardware trigger 1 and 0x0201 could be offload 1 with hardware trigger 2. Then a peripheral could have spi-offloads =3D <0x0101>, <0x0201>; if it needed to select between both triggers at runtime. > > > We could of course consider using #spi-offload-cells instead for > > allowing encoding multiple parameters for each offload instance if that > > would be preferable. > > A -cells property was my gut reaction to what you'd written here and > seems especially appropriate if there's any likelihood of some future > device using some external resources for spi-offloading. > However, -cells properties go in providers, not consumers, so it wouldn't > end up in spi-periph-props.yaml, but rather in the controller binding, > and instead there'd be a cell array type property in here. I think you > know that though and I'm interpreting what's been written rather than > what you meant. Indeed you guess correctly. So the next question is if it should be the kind of #-cells that implies a phandle like most providers or without phandles like #address-cells? Asking because I got pushback on v1 for using a phandle with offloads (although in that case, the phandle was for the offload instance itself instead for the SPI controller, so maybe this is different in this case?). > > > I also considered adding spi-offload-names that could be used as sort > > of a compatible string (more of an interface name really) in case some > > peripherals may want to support more than 1 specialized type of offload= . > > --- > > .../devicetree/bindings/spi/spi-peripheral-props.yaml | 10 ++= ++++++++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/spi/spi-peripheral-props= yaml b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml > > index 15938f81fdce..32991a2d2264 100644 > > --- a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml > > +++ b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml > > @@ -113,6 +113,16 @@ properties: > > minItems: 2 > > maxItems: 4 > > > > + spi-offloads: > > + $ref: /schemas/types.yaml#/definitions/uint32-array > > + description: > > + Array of controller offload instances that are reserved for use = by the > > + peripheral device. The semantic meaning of the values of the arr= ay > > + elements is defined by the controller. For example, it could be = a simple > > + 0-based index of the offload instance, or it could be a bitfield= where > > + a few bits represent the assigned hardware trigger, a few bits r= epresent > > + the assigned RX stream, etc. > > + > > st,spi-midi-ns: > > description: | > > Only for STM32H7, (Master Inter-Data Idleness) minimum time > > > > -- > > 2.43.2 > >