Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp242003rdb; Tue, 16 Jan 2024 23:53:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCGoJdjBkVTamoTOAOTKP1apeuVHKdK0h3v4MOveTL4ynKLEmeBAlWequERYew6PB40Hn4 X-Received: by 2002:ac2:4157:0:b0:50e:682a:3303 with SMTP id c23-20020ac24157000000b0050e682a3303mr3599981lfi.54.1705477987596; Tue, 16 Jan 2024 23:53:07 -0800 (PST) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bk11-20020a170906b0cb00b00a27a2eece9dsi5687016ejb.553.2024.01.16.23.53.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 23:53:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28618-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kcaCoWLo; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-28618-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28618-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2253C1F24F56 for ; Wed, 17 Jan 2024 07:53:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 426ECC133; Wed, 17 Jan 2024 07:52:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kcaCoWLo" Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 53A431118D for ; Wed, 17 Jan 2024 07:52:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705477977; cv=none; b=Ivgim5096vgXKqAk2lPcAsX+5APRcIRdFWG211TcXTmSXGA84uRgp3OfPlNxd8M6XLmMzfVemueT3NOS+d/kv4ijmRGlrzU6L5y65Xcq2fl9sYdHKcZRfHosSUhnagftgnnhQNgYPTn/OJ+UryN4CvfJzFpnS8gDriQf08x5x9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705477977; c=relaxed/simple; bh=vkwsIUf+4GKH0Wt0J9vNBvR2nXIGyJtfH+L4SrHmTXs=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:Content-Language: To:Cc:References:From:Autocrypt:In-Reply-To:Content-Type: Content-Transfer-Encoding; b=u/t1Fi1xs5Yk+QxloO9T2K+R6qByX0IP5Gik8KOVmeCgMH6kYlK1e7+JBkjbBZSRbV+Y8Eir7zmUMLyedb+CCJdqAe6lkBAYcSOaXDKeqfuB1n1Pam26VebjwArkzdgxWy9jZUHgv65Pi275fpt7V7edUUTwmhEFpGYHbk/WEBI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=kcaCoWLo; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-50eaabc36bcso13293986e87.2 for ; Tue, 16 Jan 2024 23:52:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705477972; x=1706082772; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=j+K2InB5c7pevqOKaItUOOAK91DVhFyytK6/2No2oNQ=; b=kcaCoWLo4XxuQcAGLYK07boM9eO4wPw7jC7fpAZObv6HOs/n3AJ2mKGQOuvwRbuPys qU5ILYuZlNXKCjbtxeHnnKcbcl55KL+mvV0VTrt1fH0PcgTIGCxGnvLmjyKniSR1iGhQ Z+cAZ05IjJ6INY4JUcg/SD2xBSgXznt8GnoX+YgZpQ6cxTxs5jgRJWscmbFPsqxbO4Y5 UW79pnFuTyVP7fQmGQ7Jm5SyLAH8rFXDWIUxzE23hW1pQacfUXR55jMiRY9cmH7no6Tk OH4dV8LCZR3XWNW82fu/Cwf7xwfQXNBgJd45/SzjJWlXMjPCC+HWGTCm/mn3s1e8Cb0I 7TiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705477972; x=1706082772; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=j+K2InB5c7pevqOKaItUOOAK91DVhFyytK6/2No2oNQ=; b=uADuKDrejEfePRp1W5tHAUaCy8OwJKuWO24JN3zWMPL0+28KBzkCiuihIHYAJ8rY15 rWLQD8cjtfEsnXb9US2CeTXPeUBRswUt9IfyyPPaCDgPQ0SvZW26QQNTxQhAiyWSz8U/ GAz/9VleHvn0aor71mVNgKTx7pzTpjNaKmHR0yzVXe05n0/SMVbpngXYxj858OI2y2xD QJvNac0lUcXefRZBiAy/LSMNLf1wlOzh4P1IwaKC4k0M7VbtNjIza9GB2coMne+GsJbU ikyLVcEA+k9hzDGYJoDpPmp5GqPZpQRBpO2H5xWOXCq4SwQs7FW9o6h74X9LZDq5aRZI Qu8Q== X-Gm-Message-State: AOJu0YzrxpTY6xl/0hEuypykaguB/f2v+jbDGK38a0PsrmQbrKYwIfF0 LmeLj4AiU1+ddm9PzM4lkPrhTkk931DtwA== X-Received: by 2002:ac2:5e27:0:b0:50e:b3bb:12aa with SMTP id o7-20020ac25e27000000b0050eb3bb12aamr3460970lfg.59.1705477972384; Tue, 16 Jan 2024 23:52:52 -0800 (PST) Received: from [192.168.1.20] ([178.197.215.66]) by smtp.gmail.com with ESMTPSA id rh5-20020a17090720e500b00a26b44ac54dsm7372797ejb.68.2024.01.16.23.52.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jan 2024 23:52:51 -0800 (PST) Message-ID: <3aef2fc5-f213-42e0-9b72-619364ef6c76@linaro.org> Date: Wed, 17 Jan 2024 08:52:49 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] dt-bindings: fpga: Convert fpga-region binding to yaml Content-Language: en-US To: Michal Simek , linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, git@xilinx.com Cc: Conor Dooley , Krzysztof Kozlowski , Moritz Fischer , Rob Herring , Tom Rix , Wu Hao , Xu Yilun , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "open list:FPGA MANAGER FRAMEWORK" References: <2a48c720bf0efce77d68a0bef10b47671b35506b.1705413862.git.michal.simek@amd.com> From: Krzyszt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7tjKXqBQEscVODaFicsUkjheOD4BfWEcVUqa+XdUEciwG/SgNyxBZepj41oVq FPSVE+Ni2tNrW/e16b8mgXNngHSnbsr6pAIXZH3qFW+4TKPMGZ2rZ6zITrMip+12jgw4mGjy 5y06JZvA02rZT2k9aa7i9dUUFggaanI09jNGbRA/ABEBAAHCwXwEGAEKACYCGwwWIQSb0H4O DFH41ZZ3t1Qbk0N9O0FimwUCYDzvagUJFF+UtgAKCRAbk0N9O0Fim9JzD/0auoGtUu4mgnna oEEpQEOjgT7l9TVuO3Qa/SeH+E0m55y5Fjpp6ZToc481za3xAcxK/BtIX5Wn1mQ6+szfrJQ6 59y2io437BeuWIRjQniSxHz1kgtFECiV30yHRgOoQlzUea7FgsnuWdstgfWi6LxstswEzxLZ Sj1EqpXYZE4uLjh6dW292sO+j4LEqPYr53hyV4I2LPmptPE9Rb9yCTAbSUlzgjiyyjuXhcwM qf3lzsm02y7Ooq+ERVKiJzlvLd9tSe4jRx6Z6LMXhB21fa5DGs/tHAcUF35hSJrvMJzPT/+u /oVmYDFZkbLlqs2XpWaVCo2jv8+iHxZZ9FL7F6AHFzqEFdqGnJQqmEApiRqH6b4jRBOgJ+cY qc+rJggwMQcJL9F+oDm3wX47nr6jIsEB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <2a48c720bf0efce77d68a0bef10b47671b35506b.1705413862.git.michal.simek@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 16/01/2024 15:04, Michal Simek wrote: > Convert the generic fpga region DT binding to json-schema. > There are some differences compare to txt version. > 1. DT overlay can't be described in example that's why directly include > information from overlay to node which was referenced. It is visible in > example with /* DT Overlay contains: &... */ > > 2. All example have been rewritten to be simpler and describe only full > reconfiguration and partial reconfiguration with one bridge. > Completely drop the case where fpga region can inside partial > reconfiguration region which is already described in description > > 3. Fixed some typos in descriptions compare to txt version but most of it > is just c&p from txt file. > > Signed-off-by: Michal Simek > --- .. > + -- > + [1] www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/ug/ug_partrecon.pdf > + [2] tspace.library.utoronto.ca/bitstream/1807/67932/1/Byma_Stuart_A_201411_MAS_thesis.pdf > + [3] https://www.xilinx.com/support/documentation/sw_manuals/xilinx14_1/ug702.pdf > + > +properties: > + $nodename: > + pattern: "^fpga-region(-[0-9]|[1-9][0-9]+)?$" I think you miss here one set of (). Please look at my previous pattern and test yours. This should fail, e.g. on fpga-region-0 > + > + compatible: > + const: fpga-region > + > + "#address-cells": true > + "#size-cells": true > + > + config-complete-timeout-us: > + description: > + The maximum time in microseconds time for the FPGA to go to operating > + mode after the region has been programmed. > + > + encrypted-fpga-config: > + type: boolean > + description: > + Set if the bitstream is encrypted. > + > + external-fpga-config: > + type: boolean > + description: > + Set if the FPGA has already been configured prior to OS boot up. > + > + firmware-name: > + maxItems: 1 > + description: > + Should contain the name of an FPGA image file located on the firmware > + search path. If this property shows up in a live device tree it indicates > + that the FPGA has already been programmed with this image. > + If this property is in an overlay targeting an FPGA region, it is > + a request to program the FPGA with that image. > + > + fpga-bridges: > + $ref: /schemas/types.yaml#/definitions/phandle-array > + description: > + Should contain a list of phandles to FPGA Bridges that must be > + controlled during FPGA programming along with the parent FPGA bridge. > + This property is optional if the FPGA Manager handles the bridges. > + If the fpga-region is the child of an fpga-bridge, the list should not > + contain the parent bridge. > + > + fpga-mgr: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: > + Should contain a phandle to an FPGA Manager. Child FPGA Regions > + inherit this property from their ancestor regions. An fpga-mgr property > + in a region will override any inherited FPGA manager. > + > + partial-fpga-config: > + type: boolean > + description: > + Set if partial reconfiguration is to be done, otherwise full > + reconfiguration is done. > + > + region-freeze-timeout-us: > + description: > + The maximum time in microseconds to wait for bridges to successfully > + become disabled before the region has been programmed. > + > + region-unfreeze-timeout-us: > + description: > + The maximum time in microseconds to wait for bridges to successfully > + become enabled after the region has been programmed. > + > +patternProperties: > + "@(0|[1-9a-f][0-9a-f]*)$": > + type: object You put (0|[...) to disallow @0001? I personally would not care, dtc handles this, and the pattern is confusing. Just @[0-9a-z]+$ > + > + "^[^@]+$": true I dislike it. How is this binding supposed to be used? If in standalone way, then you allow any property so what's the point of this schema? If fpga-bridge.yaml is referenced by other device-specific binding, then all properties will be evaluated here, so the same: you allow any property. Depending on the usage, this might be just like other generic, common schemas, so end with "additionalPropeties: true". > + > +required: > + - compatible > + - "#address-cells" > + - "#size-cells" > + - fpga-mgr > + > +additionalProperties: false > + > +examples: > + - | > + /* > + * Full Reconfiguration without Bridges with DT overlay > + */ > + fpga_mgr0: fpga-mgr@f8007000 { > + compatible = "xlnx,zynq-devcfg-1.0"; > + reg = <0xf8007000 0x100>; > + clocks = <&clkc 12>; > + clock-names = "ref_clk"; > + interrupt-parent = <&intc>; > + interrupts = <0 8 4>; > + syscon = <&slcr>; > + }; I suggest to drop this node. The contents does not really matter for the bridge. > + > + fpga_region0: fpga-region { > + compatible = "fpga-region"; > + #address-cells = <1>; > + #size-cells = <1>; > + fpga-mgr = <&fpga_mgr0>; > + > + /* DT Overlay contains: &fpga_region0 */ > + firmware-name = "zynq-gpio.bin"; > + gpio@40000000 { > + compatible = "xlnx,xps-gpio-1.00.a"; > + reg = <0x40000000 0x10000>; > + gpio-controller; > + #gpio-cells = <2>; > + }; > + }; > + > + - | > + /* > + * Partial reconfiguration with bridge > + */ > + fpga_mgr1: fpga-mgr@f8007000 { > + compatible = "xlnx,zynq-devcfg-1.0"; > + reg = <0xf8007000 0x100>; > + clocks = <&clkc 12>; > + clock-names = "ref_clk"; > + interrupt-parent = <&intc>; > + interrupts = <0 8 4>; > + syscon = <&slcr>; > + }; > + > + fpga_bridge1: fpga-bridge@100000450 { > + compatible = "xlnx,pr-decoupler-1.00", "xlnx,pr-decoupler"; > + reg = <0x10000045 0x10>; > + clocks = <&clkc 15>; > + clock-names = "aclk"; > + }; Also drop both nodes. > + > + fpga_region1: fpga-region { > + compatible = "fpga-region"; > + #address-cells = <1>; > + #size-cells = <1>; > + fpga-mgr = <&fpga_mgr1>; > + fpga-bridges = <&fpga_bridge1>; > + partial-fpga-config; > + > + /* DT Overlay contains: &fpga_region1 */ > + firmware-name = "zynq-gpio-partial.bin"; > + clk100: clk100 { > + compatible = "fixed-clock"; > + #clock-cells = <0>; > + clock-frequency = <100000000>; > + bootph-all; > + }; > + axi { > + compatible = "simple-bus"; > + #address-cells = <1>; > + #size-cells = <1>; > + ranges; > + gpio@40000000 { > + compatible = "xlnx,xps-gpio-1.00.a"; > + reg = <0x40000000 0x10000>; > + #gpio-cells = <2>; > + gpio-controller; > + clocks = <&clk100>; > + }; > + }; > + }; Best regards, Krzysztof