From nobody Thu Dec 18 00:45:42 2025 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 41F51180053 for ; Wed, 17 Jul 2024 13:19:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721222384; cv=none; b=fkqfa9wt+jsLnpjC2cyU+UrOhV4RshlnQTyb+GzjnX7iBkYrxDBZn9H4pH10ZP1l/X6qpslh4aCSKkcycEKHIajYxsKFBwuWW6Jti0Hyw8DTob3bGtpTdQsTIaV7Lq7A3n5g9CG+UDqfhF4NvtYYnxlmo7sP2/tzPaKBgs52mWU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721222384; c=relaxed/simple; bh=Lpe5tdTvf6Hb4RKMDpmtXw70hfzTjmPX3MjIxnADx+s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=HwNY/eZ+8O3tuHlvp7aAOzkhXve2bIP0qNIixVC6BKDk616XeXrbBKFnrO8O1n4yrKzhHFbbbRwHP3JuYjC/de6FEzGjDTukgRG90toH3itv41wtmwC6AHzqPDz9Y7HEVY5P1eR5CMI84uy2bR4gd5iOv3Oq4h53dfdkD/loUeY= 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=bEjwr3Be; arc=none smtp.client-ip=209.85.128.44 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bEjwr3Be" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4272738eb9eso50959885e9.3 for ; Wed, 17 Jul 2024 06:19:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721222379; x=1721827179; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=eq5/Igl7L/85n1P2T/eGC/F3bFZlI2k0nRRcpIhOjXg=; b=bEjwr3BeFlxhJcFEWeqXUyxSJfKmDRU+haqg6GDFiVU6Zq1xRQb5t56mf/NQUoe3uj LT7u+V0ni3757ISlefvJeRjNSP6z+OHhDPNHijgbCOEzMFp6WA4HEeEHorSoa+h2SYpx 0E1TA61wdmkcOGC+BCqCA6K38eXemi4g0wM6kuAW90neKWGs57OveABX2poTmdrDjlkK xrkTWevPDDtVmFryOH+/UeR/ZelWIS9nEW85kw8u2kDO53q93rF6QGZ2FkBymRrclETL 5jlw3P3xvwophnKjz/8DwwOvp+cPNq1Ms+Vd6q9s85L3JB7jKY0KXn/tAlz1gPPS91fI 0LbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721222379; x=1721827179; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eq5/Igl7L/85n1P2T/eGC/F3bFZlI2k0nRRcpIhOjXg=; b=bBe9L9d4IAH0VS2oORH/4fsxev83RVj9aAbATF7tOUsq/H9uXrq5FjNnrq7qp1kDJJ FMIE6LZfgF/+w0qdH+KTyTr7jDY44odQmfXdpgUYb+vFzmCgxSdlyw4YXhx0o097A9ak M82t0RG9E8TE6dc5r8Tm0mlnFvvsDlPoRH3isMjanHZ24Ax5GtxIbvY3+Wez7hutY+Bj E6anML7N+BJYb9TbmmPXYk66GHyacnHK0iTDrUcOsscunai5sa3jzL1uUDN6RFKHQD4g Y9mMbBynGc+WJdcBp0t0uMbfsuLS/HsqbC1M8+kfut7nL3AeZtstnbest/LS24kA5byi Cngw== X-Forwarded-Encrypted: i=1; AJvYcCXl+9ozrncMINHPghJHoFn+Cfro26DalmPtWNhn0rVqm1kiSrYhe6F2Ep8CbVWxvcF+SouJuIU/soFpBypDFJjuiG7/TfmKHbqvBTHD X-Gm-Message-State: AOJu0YzkEZLMYuY0sIXT1b6fBx7q6pljOkasJXpADddTORR5azXwSnv1 iDWwhstqVgXnVzkKzg4QnfF/VeMuuAWma8sRxG7SY1azcCembvtDGG6j2thoofY= X-Google-Smtp-Source: AGHT+IFJOPCjoCEAqQXqG7fJlTnDNnYTfnz7sZOEN35qNW9L6yBnj/aToKm5F3qmoELE67uobm9WBQ== X-Received: by 2002:adf:f645:0:b0:368:4226:4084 with SMTP id ffacd0b85a97d-3684226418amr383771f8f.6.1721222379478; Wed, 17 Jul 2024 06:19:39 -0700 (PDT) Received: from rayyan-pc.broadband ([2a0a:ef40:ee7:2401:197d:e048:a80f:bc44]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680daccbe9sm11625869f8f.59.2024.07.17.06.19.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jul 2024 06:19:39 -0700 (PDT) From: Rayyan Ansari To: devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Rayyan Ansari , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-kernel@vger.kernel.org Subject: [PATCH] dt-bindings: bus: qcom,ebi2: convert to dtschema Date: Wed, 17 Jul 2024 14:10:26 +0100 Message-ID: <20240717131030.51419-1-rayyan.ansari@linaro.org> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Convert the bindings for the External Bus Interface on apq8060 and msm8660 from the old text format to yaml. Signed-off-by: Rayyan Ansari Reviewed-by: Krzysztof Kozlowski --- .../devicetree/bindings/bus/qcom,ebi2.txt | 138 ---------- .../devicetree/bindings/bus/qcom,ebi2.yaml | 239 ++++++++++++++++++ 2 files changed, 239 insertions(+), 138 deletions(-) delete mode 100644 Documentation/devicetree/bindings/bus/qcom,ebi2.txt create mode 100644 Documentation/devicetree/bindings/bus/qcom,ebi2.yaml diff --git a/Documentation/devicetree/bindings/bus/qcom,ebi2.txt b/Document= ation/devicetree/bindings/bus/qcom,ebi2.txt deleted file mode 100644 index 5058aa2c63b2..000000000000 --- a/Documentation/devicetree/bindings/bus/qcom,ebi2.txt +++ /dev/null @@ -1,138 +0,0 @@ -Qualcomm External Bus Interface 2 (EBI2) - -The EBI2 contains two peripheral blocks: XMEM and LCDC. The XMEM handles a= ny -external memory (such as NAND or other memory-mapped peripherals) whereas -LCDC handles LCD displays. - -As it says it connects devices to an external bus interface, meaning addre= ss -lines (up to 9 address lines so can only address 1KiB external memory spac= e), -data lines (16 bits), OE (output enable), ADV (address valid, used on some -NOR flash memories), WE (write enable). This on top of 6 different chip se= lects -(CS0 thru CS5) so that in theory 6 different devices can be connected. - -Apparently this bus is clocked at 64MHz. It has dedicated pins on the pack= age -and the bus can only come out on these pins, however if some of the pins a= re -unused they can be left unconnected or remuxed to be used as GPIO or in so= me -cases other orthogonal functions as well. - -Also CS1 and CS2 has -A and -B signals. Why they have that is unclear to m= e. - -The chip selects have the following memory range assignments. This region = of -memory is referred to as "Chip Peripheral SS FPB0" and is 168MB big. - -Chip Select Physical address base -CS0 GPIO134 0x1a800000-0x1b000000 (8MB) -CS1 GPIO39 (A) / GPIO123 (B) 0x1b000000-0x1b800000 (8MB) -CS2 GPIO40 (A) / GPIO124 (B) 0x1b800000-0x1c000000 (8MB) -CS3 GPIO133 0x1d000000-0x25000000 (128 MB) -CS4 GPIO132 0x1c800000-0x1d000000 (8MB) -CS5 GPIO131 0x1c000000-0x1c800000 (8MB) - -The APQ8060 Qualcomm Application Processor User Guide, 80-N7150-14 Rev. A, -August 6, 2012 contains some incomplete documentation of the EBI2. - -FIXME: the manual mentions "write precharge cycles" and "precharge cycles". -We have not been able to figure out which bit fields these correspond to -in the hardware, or what valid values exist. The current hypothesis is that -this is something just used on the FAST chip selects and that the SLOW -chip selects are understood fully. There is also a "byte device enable" -flag somewhere for 8bit memories. - -FIXME: The chipselects have SLOW and FAST configuration registers. It's a = bit -unclear what this means, if they are mutually exclusive or can be used -together, or if some chip selects are hardwired to be FAST and others are = SLOW -by design. - -The XMEM registers are totally undocumented but could be partially decoded -because the Cypress AN49576 Antioch Westbridge apparently has suspiciously -similar register layout, see: http://www.cypress.com/file/105771/download - -Required properties: -- compatible: should be one of: - "qcom,msm8660-ebi2" - "qcom,apq8060-ebi2" -- #address-cells: should be <2>: the first cell is the chipselect, - the second cell is the offset inside the memory range -- #size-cells: should be <1> -- ranges: should be set to: - ranges =3D <0 0x0 0x1a800000 0x00800000>, - <1 0x0 0x1b000000 0x00800000>, - <2 0x0 0x1b800000 0x00800000>, - <3 0x0 0x1d000000 0x08000000>, - <4 0x0 0x1c800000 0x00800000>, - <5 0x0 0x1c000000 0x00800000>; -- reg: two ranges of registers: EBI2 config and XMEM config areas -- reg-names: should be "ebi2", "xmem" -- clocks: two clocks, EBI_2X and EBI -- clock-names: should be "ebi2x", "ebi2" - -Optional subnodes: -- Nodes inside the EBI2 will be considered device nodes. - -The following optional properties are properties that can be tagged onto -any device subnode. We are assuming that there can be only ONE device per -chipselect subnode, else the properties will become ambiguous. - -Optional properties arrays for SLOW chip selects: -- qcom,xmem-recovery-cycles: recovery cycles is the time the memory contin= ues to - drive the data bus after OE is de-asserted, in order to avoid contention= on - the data bus. They are inserted when reading one CS and switching to ano= ther - CS or read followed by write on the same CS. Valid values 0 thru 15. Min= imum - value is actually 1, so a value of 0 will still yield 1 recovery cycle. -- qcom,xmem-write-hold-cycles: write hold cycles, these are extra cycles - inserted after every write minimum 1. The data out is driven from the ti= me - WE is asserted until CS is asserted. With a hold of 1 (value =3D 0), the= CS - stays active for 1 extra cycle etc. Valid values 0 thru 15. -- qcom,xmem-write-delta-cycles: initial latency for write cycles inserted = for - the first write to a page or burst memory. Valid values 0 thru 255. -- qcom,xmem-read-delta-cycles: initial latency for read cycles inserted fo= r the - first read to a page or burst memory. Valid values 0 thru 255. -- qcom,xmem-write-wait-cycles: number of wait cycles for every write acces= s, 0=3D1 - cycle. Valid values 0 thru 15. -- qcom,xmem-read-wait-cycles: number of wait cycles for every read access,= 0=3D1 - cycle. Valid values 0 thru 15. - -Optional properties arrays for FAST chip selects: -- qcom,xmem-address-hold-enable: this is a boolean property stating that we - shall hold the address for an extra cycle to meet hold time requirements - with ADV assertion. -- qcom,xmem-adv-to-oe-recovery-cycles: the number of cycles elapsed before= an OE - assertion, with respect to the cycle where ADV (address valid) is assert= ed. - 2 means 2 cycles between ADV and OE. Valid values 0, 1, 2 or 3. -- qcom,xmem-read-hold-cycles: the length in cycles of the first segment of= a - read transfer. For a single read transfer this will be the time from CS - assertion to OE assertion. Valid values 0 thru 15. - - -Example: - -ebi2@1a100000 { - compatible =3D "qcom,apq8060-ebi2"; - #address-cells =3D <2>; - #size-cells =3D <1>; - ranges =3D <0 0x0 0x1a800000 0x00800000>, - <1 0x0 0x1b000000 0x00800000>, - <2 0x0 0x1b800000 0x00800000>, - <3 0x0 0x1d000000 0x08000000>, - <4 0x0 0x1c800000 0x00800000>, - <5 0x0 0x1c000000 0x00800000>; - reg =3D <0x1a100000 0x1000>, <0x1a110000 0x1000>; - reg-names =3D "ebi2", "xmem"; - clocks =3D <&gcc EBI2_2X_CLK>, <&gcc EBI2_CLK>; - clock-names =3D "ebi2x", "ebi2"; - /* Make sure to set up the pin control for the EBI2 */ - pinctrl-names =3D "default"; - pinctrl-0 =3D <&foo_ebi2_pins>; - - foo-ebi2@2,0 { - compatible =3D "foo"; - reg =3D <2 0x0 0x100>; - (...) - qcom,xmem-recovery-cycles =3D <0>; - qcom,xmem-write-hold-cycles =3D <3>; - qcom,xmem-write-delta-cycles =3D <31>; - qcom,xmem-read-delta-cycles =3D <28>; - qcom,xmem-write-wait-cycles =3D <9>; - qcom,xmem-read-wait-cycles =3D <9>; - }; -}; diff --git a/Documentation/devicetree/bindings/bus/qcom,ebi2.yaml b/Documen= tation/devicetree/bindings/bus/qcom,ebi2.yaml new file mode 100644 index 000000000000..1b1fb3538e6e --- /dev/null +++ b/Documentation/devicetree/bindings/bus/qcom,ebi2.yaml @@ -0,0 +1,239 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/bus/qcom,ebi2.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm External Bus Interface 2 (EBI2) + +description: | + The EBI2 contains two peripheral blocks: XMEM and LCDC. The XMEM handles= any + external memory (such as NAND or other memory-mapped peripherals) whereas + LCDC handles LCD displays. + + As it says it connects devices to an external bus interface, meaning add= ress + lines (up to 9 address lines so can only address 1KiB external memory sp= ace), + data lines (16 bits), OE (output enable), ADV (address valid, used on so= me + NOR flash memories), WE (write enable). This on top of 6 different chip = selects + (CS0 thru CS5) so that in theory 6 different devices can be connected. + + Apparently this bus is clocked at 64MHz. It has dedicated pins on the pa= ckage + and the bus can only come out on these pins, however if some of the pins= are + unused they can be left unconnected or remuxed to be used as GPIO or in = some + cases other orthogonal functions as well. + + Also CS1 and CS2 has -A and -B signals. Why they have that is unclear to= me. + + The chip selects have the following memory range assignments. This regio= n of + memory is referred to as "Chip Peripheral SS FPB0" and is 168MB big. + + Chip Select Physical address base + CS0 GPIO134 0x1a800000-0x1b000000 (8MB) + CS1 GPIO39 (A) / GPIO123 (B) 0x1b000000-0x1b800000 (8MB) + CS2 GPIO40 (A) / GPIO124 (B) 0x1b800000-0x1c000000 (8MB) + CS3 GPIO133 0x1d000000-0x25000000 (128 MB) + CS4 GPIO132 0x1c800000-0x1d000000 (8MB) + CS5 GPIO131 0x1c000000-0x1c800000 (8MB) + + The APQ8060 Qualcomm Application Processor User Guide, 80-N7150-14 Rev. = A, + August 6, 2012 contains some incomplete documentation of the EBI2. + + FIXME: the manual mentions "write precharge cycles" and "precharge cycle= s". + We have not been able to figure out which bit fields these correspond to + in the hardware, or what valid values exist. The current hypothesis is t= hat + this is something just used on the FAST chip selects and that the SLOW + chip selects are understood fully. There is also a "byte device enable" + flag somewhere for 8bit memories. + + FIXME: The chipselects have SLOW and FAST configuration registers. It's = a bit + unclear what this means, if they are mutually exclusive or can be used + together, or if some chip selects are hardwired to be FAST and others ar= e SLOW + by design. + + The XMEM registers are totally undocumented but could be partially decod= ed + because the Cypress AN49576 Antioch Westbridge apparently has suspicious= ly + similar register layout, see: http://www.cypress.com/file/105771/download + +maintainers: + - Bjorn Andersson + +properties: + compatible: + enum: + - qcom,apq8060-ebi2 + - qcom,msm8660-ebi2 + + reg: + items: + - description: EBI2 config region + - description: XMEM config region + + reg-names: + items: + - const: ebi2 + - const: xmem + + ranges: true + + clocks: + items: + - description: EBI_2X clock + - description: EBI clock + + clock-names: + items: + - const: ebi2x + - const: ebi2 + + '#address-cells': + const: 2 + + '#size-cells': + const: 1 + +required: + - compatible + - reg + - reg-names + - ranges + - clocks + - clock-names + - '#address-cells' + - '#size-cells' + +patternProperties: + "^.*@[0-5],[0-9a-f]+$": + type: object + additionalProperties: true + properties: + reg: + maxItems: 1 + + # SLOW chip selects + qcom,xmem-recovery-cycles: + $ref: /schemas/types.yaml#/definitions/uint32 + description: > + The time the memory continues to drive the data bus after OE + is de-asserted, in order to avoid contention on the data bus. + They are inserted when reading one CS and switching to another + CS or read followed by write on the same CS. Minimum value is + actually 1, so a value of 0 will still yield 1 recovery cycle. + minimum: 0 + maximum: 15 + + qcom,xmem-write-hold-cycles: + $ref: /schemas/types.yaml#/definitions/uint32 + description: > + The extra cycles inserted after every write minimum 1. The + data out is driven from the time WE is asserted until CS is + asserted. With a hold of 1 (value =3D 0), the CS stays active + for 1 extra cycle, etc. + minimum: 0 + maximum: 15 + + qcom,xmem-write-delta-cycles: + $ref: /schemas/types.yaml#/definitions/uint32 + description: > + The initial latency for write cycles inserted for the first + write to a page or burst memory. + minimum: 0 + maximum: 255 + + qcom,xmem-read-delta-cycles: + $ref: /schemas/types.yaml#/definitions/uint32 + description: > + The initial latency for read cycles inserted for the first + read to a page or burst memory. + minimum: 0 + maximum: 255 + + qcom,xmem-write-wait-cycles: + $ref: /schemas/types.yaml#/definitions/uint32 + description: > + The number of wait cycles for every write access. + minimum: 0 + maximum: 15 + + qcom,xmem-read-wait-cycles: + $ref: /schemas/types.yaml#/definitions/uint32 + description: > + The number of wait cycles for every read access. + minimum: 0 + maximum: 15 + + + # FAST chip selects + qcom,xmem-address-hold-enable: + $ref: /schemas/types.yaml#/definitions/uint32 + description: > + Holds the address for an extra cycle to meet hold time + requirements with ADV assertion, when set to 1. + enum: [ 0, 1 ] + + qcom,xmem-adv-to-oe-recovery-cycles: + $ref: /schemas/types.yaml#/definitions/uint32 + description: > + The number of cycles elapsed before an OE assertion, with + respect to the cycle where ADV (address valid) is asserted. + minimum: 0 + maximum: 3 + + qcom,xmem-read-hold-cycles: + $ref: /schemas/types.yaml#/definitions/uint32 + description: > + The length in cycles of the first segment of a read transfer. + For a single read transfer this will be the time from CS + assertion to OE assertion. + minimum: 0 + maximum: 15 + + required: + - reg + +additionalProperties: false + +examples: + - | + #include + #include + #include + + external-bus@1a100000 { + compatible =3D "qcom,msm8660-ebi2"; + reg =3D <0x1a100000 0x1000>, <0x1a110000 0x1000>; + reg-names =3D "ebi2", "xmem"; + ranges =3D <0 0x0 0x1a800000 0x00800000>, + <1 0x0 0x1b000000 0x00800000>, + <2 0x0 0x1b800000 0x00800000>, + <3 0x0 0x1d000000 0x08000000>, + <4 0x0 0x1c800000 0x00800000>, + <5 0x0 0x1c000000 0x00800000>; + + clocks =3D <&gcc EBI2_2X_CLK>, <&gcc EBI2_CLK>; + clock-names =3D "ebi2x", "ebi2"; + + #address-cells =3D <2>; + #size-cells =3D <1>; + + ethernet@2,0 { + compatible =3D "smsc,lan9221", "smsc,lan9115"; + reg =3D <2 0x0 0x100>; + + interrupts-extended =3D <&pm8058_gpio 7 IRQ_TYPE_EDGE_FALLING>, + <&tlmm 29 IRQ_TYPE_EDGE_RISING>; + reset-gpios =3D <&tlmm 30 GPIO_ACTIVE_LOW>; + + phy-mode =3D "mii"; + reg-io-width =3D <2>; + smsc,force-external-phy; + smsc,irq-push-pull; + + /* SLOW chipselect config */ + qcom,xmem-recovery-cycles =3D <0>; + qcom,xmem-write-hold-cycles =3D <3>; + qcom,xmem-write-delta-cycles =3D <31>; + qcom,xmem-read-delta-cycles =3D <28>; + qcom,xmem-write-wait-cycles =3D <9>; + qcom,xmem-read-wait-cycles =3D <9>; + }; + }; --=20 2.45.2