Path: blob/main/sys/contrib/device-tree/Bindings/bus/qcom,ebi2.yaml
48377 views
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)1%YAML 1.22---3$id: http://devicetree.org/schemas/bus/qcom,ebi2.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: Qualcomm External Bus Interface 2 (EBI2)78description: |9The EBI2 contains two peripheral blocks: XMEM and LCDC. The XMEM handles any10external memory (such as NAND or other memory-mapped peripherals) whereas11LCDC handles LCD displays.1213As it says it connects devices to an external bus interface, meaning address14lines (up to 9 address lines so can only address 1KiB external memory space),15data lines (16 bits), OE (output enable), ADV (address valid, used on some16NOR flash memories), WE (write enable). This on top of 6 different chip selects17(CS0 thru CS5) so that in theory 6 different devices can be connected.1819Apparently this bus is clocked at 64MHz. It has dedicated pins on the package20and the bus can only come out on these pins, however if some of the pins are21unused they can be left unconnected or remuxed to be used as GPIO or in some22cases other orthogonal functions as well.2324Also CS1 and CS2 has -A and -B signals. Why they have that is unclear to me.2526The chip selects have the following memory range assignments. This region of27memory is referred to as "Chip Peripheral SS FPB0" and is 168MB big.2829Chip Select Physical address base30CS0 GPIO134 0x1a800000-0x1b000000 (8MB)31CS1 GPIO39 (A) / GPIO123 (B) 0x1b000000-0x1b800000 (8MB)32CS2 GPIO40 (A) / GPIO124 (B) 0x1b800000-0x1c000000 (8MB)33CS3 GPIO133 0x1d000000-0x25000000 (128 MB)34CS4 GPIO132 0x1c800000-0x1d000000 (8MB)35CS5 GPIO131 0x1c000000-0x1c800000 (8MB)3637The APQ8060 Qualcomm Application Processor User Guide, 80-N7150-14 Rev. A,38August 6, 2012 contains some incomplete documentation of the EBI2.3940FIXME: the manual mentions "write precharge cycles" and "precharge cycles".41We have not been able to figure out which bit fields these correspond to42in the hardware, or what valid values exist. The current hypothesis is that43this is something just used on the FAST chip selects and that the SLOW44chip selects are understood fully. There is also a "byte device enable"45flag somewhere for 8bit memories.4647FIXME: The chipselects have SLOW and FAST configuration registers. It's a bit48unclear what this means, if they are mutually exclusive or can be used49together, or if some chip selects are hardwired to be FAST and others are SLOW50by design.5152The XMEM registers are totally undocumented but could be partially decoded53because the Cypress AN49576 Antioch Westbridge apparently has suspiciously54similar register layout, see: http://www.cypress.com/file/105771/download5556maintainers:57- Bjorn Andersson <andersson@kernel.org>5859properties:60compatible:61enum:62- qcom,apq8060-ebi263- qcom,msm8660-ebi26465reg:66items:67- description: EBI2 config region68- description: XMEM config region6970reg-names:71items:72- const: ebi273- const: xmem7475ranges: true7677clocks:78items:79- description: EBI_2X clock80- description: EBI clock8182clock-names:83items:84- const: ebi2x85- const: ebi28687'#address-cells':88const: 28990'#size-cells':91const: 19293required:94- compatible95- reg96- reg-names97- ranges98- clocks99- clock-names100- '#address-cells'101- '#size-cells'102103patternProperties:104"^.*@[0-5],[0-9a-f]+$":105type: object106additionalProperties: true107properties:108reg:109maxItems: 1110111# SLOW chip selects112qcom,xmem-recovery-cycles:113$ref: /schemas/types.yaml#/definitions/uint32114description: >115The time the memory continues to drive the data bus after OE116is de-asserted, in order to avoid contention on the data bus.117They are inserted when reading one CS and switching to another118CS or read followed by write on the same CS. Minimum value is119actually 1, so a value of 0 will still yield 1 recovery cycle.120minimum: 0121maximum: 15122123qcom,xmem-write-hold-cycles:124$ref: /schemas/types.yaml#/definitions/uint32125description: >126The extra cycles inserted after every write minimum 1. The127data out is driven from the time WE is asserted until CS is128asserted. With a hold of 1 (value = 0), the CS stays active129for 1 extra cycle, etc.130minimum: 0131maximum: 15132133qcom,xmem-write-delta-cycles:134$ref: /schemas/types.yaml#/definitions/uint32135description: >136The initial latency for write cycles inserted for the first137write to a page or burst memory.138minimum: 0139maximum: 255140141qcom,xmem-read-delta-cycles:142$ref: /schemas/types.yaml#/definitions/uint32143description: >144The initial latency for read cycles inserted for the first145read to a page or burst memory.146minimum: 0147maximum: 255148149qcom,xmem-write-wait-cycles:150$ref: /schemas/types.yaml#/definitions/uint32151description: >152The number of wait cycles for every write access.153minimum: 0154maximum: 15155156qcom,xmem-read-wait-cycles:157$ref: /schemas/types.yaml#/definitions/uint32158description: >159The number of wait cycles for every read access.160minimum: 0161maximum: 15162163164# FAST chip selects165qcom,xmem-address-hold-enable:166$ref: /schemas/types.yaml#/definitions/uint32167description: >168Holds the address for an extra cycle to meet hold time169requirements with ADV assertion, when set to 1.170enum: [ 0, 1 ]171172qcom,xmem-adv-to-oe-recovery-cycles:173$ref: /schemas/types.yaml#/definitions/uint32174description: >175The number of cycles elapsed before an OE assertion, with176respect to the cycle where ADV (address valid) is asserted.177minimum: 0178maximum: 3179180qcom,xmem-read-hold-cycles:181$ref: /schemas/types.yaml#/definitions/uint32182description: >183The length in cycles of the first segment of a read transfer.184For a single read transfer this will be the time from CS185assertion to OE assertion.186minimum: 0187maximum: 15188189required:190- reg191192additionalProperties: false193194examples:195- |196#include <dt-bindings/clock/qcom,gcc-msm8660.h>197#include <dt-bindings/interrupt-controller/irq.h>198#include <dt-bindings/gpio/gpio.h>199200external-bus@1a100000 {201compatible = "qcom,msm8660-ebi2";202reg = <0x1a100000 0x1000>, <0x1a110000 0x1000>;203reg-names = "ebi2", "xmem";204ranges = <0 0x0 0x1a800000 0x00800000>,205<1 0x0 0x1b000000 0x00800000>,206<2 0x0 0x1b800000 0x00800000>,207<3 0x0 0x1d000000 0x08000000>,208<4 0x0 0x1c800000 0x00800000>,209<5 0x0 0x1c000000 0x00800000>;210211clocks = <&gcc EBI2_2X_CLK>, <&gcc EBI2_CLK>;212clock-names = "ebi2x", "ebi2";213214#address-cells = <2>;215#size-cells = <1>;216217ethernet@2,0 {218compatible = "smsc,lan9221", "smsc,lan9115";219reg = <2 0x0 0x100>;220221interrupts-extended = <&pm8058_gpio 7 IRQ_TYPE_EDGE_FALLING>,222<&tlmm 29 IRQ_TYPE_EDGE_RISING>;223reset-gpios = <&tlmm 30 GPIO_ACTIVE_LOW>;224225phy-mode = "mii";226reg-io-width = <2>;227smsc,force-external-phy;228smsc,irq-push-pull;229230/* SLOW chipselect config */231qcom,xmem-recovery-cycles = <0>;232qcom,xmem-write-hold-cycles = <3>;233qcom,xmem-write-delta-cycles = <31>;234qcom,xmem-read-delta-cycles = <28>;235qcom,xmem-write-wait-cycles = <9>;236qcom,xmem-read-wait-cycles = <9>;237};238};239240241