xref: /linux/Documentation/devicetree/bindings/memory-controllers/qcom,ebi2.yaml (revision 4f9786035f9e519db41375818e1d0b5f20da2f10)
1a72824ffSRob Herring (Arm)# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2a72824ffSRob Herring (Arm)%YAML 1.2
3a72824ffSRob Herring (Arm)---
4a72824ffSRob Herring (Arm)$id: http://devicetree.org/schemas/memory-controllers/qcom,ebi2.yaml#
5a72824ffSRob Herring (Arm)$schema: http://devicetree.org/meta-schemas/core.yaml#
6a72824ffSRob Herring (Arm)
7a72824ffSRob Herring (Arm)title: Qualcomm External Bus Interface 2 (EBI2)
8a72824ffSRob Herring (Arm)
9a72824ffSRob Herring (Arm)description: |
10a72824ffSRob Herring (Arm)  The EBI2 contains two peripheral blocks: XMEM and LCDC. The XMEM handles any
11a72824ffSRob Herring (Arm)  external memory (such as NAND or other memory-mapped peripherals) whereas
12a72824ffSRob Herring (Arm)  LCDC handles LCD displays.
13a72824ffSRob Herring (Arm)
14a72824ffSRob Herring (Arm)  As it says it connects devices to an external bus interface, meaning address
15a72824ffSRob Herring (Arm)  lines (up to 9 address lines so can only address 1KiB external memory space),
16a72824ffSRob Herring (Arm)  data lines (16 bits), OE (output enable), ADV (address valid, used on some
17a72824ffSRob Herring (Arm)  NOR flash memories), WE (write enable). This on top of 6 different chip selects
18a72824ffSRob Herring (Arm)  (CS0 thru CS5) so that in theory 6 different devices can be connected.
19a72824ffSRob Herring (Arm)
20a72824ffSRob Herring (Arm)  Apparently this bus is clocked at 64MHz. It has dedicated pins on the package
21a72824ffSRob Herring (Arm)  and the bus can only come out on these pins, however if some of the pins are
22a72824ffSRob Herring (Arm)  unused they can be left unconnected or remuxed to be used as GPIO or in some
23a72824ffSRob Herring (Arm)  cases other orthogonal functions as well.
24a72824ffSRob Herring (Arm)
25a72824ffSRob Herring (Arm)  Also CS1 and CS2 has -A and -B signals. Why they have that is unclear to me.
26a72824ffSRob Herring (Arm)
27a72824ffSRob Herring (Arm)  The chip selects have the following memory range assignments. This region of
28a72824ffSRob Herring (Arm)  memory is referred to as "Chip Peripheral SS FPB0" and is 168MB big.
29a72824ffSRob Herring (Arm)
30a72824ffSRob Herring (Arm)  Chip Select                     Physical address base
31a72824ffSRob Herring (Arm)  CS0 GPIO134                     0x1a800000-0x1b000000 (8MB)
32a72824ffSRob Herring (Arm)  CS1 GPIO39 (A) / GPIO123 (B)    0x1b000000-0x1b800000 (8MB)
33a72824ffSRob Herring (Arm)  CS2 GPIO40 (A) / GPIO124 (B)    0x1b800000-0x1c000000 (8MB)
34a72824ffSRob Herring (Arm)  CS3 GPIO133                     0x1d000000-0x25000000 (128 MB)
35a72824ffSRob Herring (Arm)  CS4 GPIO132                     0x1c800000-0x1d000000 (8MB)
36a72824ffSRob Herring (Arm)  CS5 GPIO131                     0x1c000000-0x1c800000 (8MB)
37a72824ffSRob Herring (Arm)
38a72824ffSRob Herring (Arm)  The APQ8060 Qualcomm Application Processor User Guide, 80-N7150-14 Rev. A,
39a72824ffSRob Herring (Arm)  August 6, 2012 contains some incomplete documentation of the EBI2.
40a72824ffSRob Herring (Arm)
41a72824ffSRob Herring (Arm)  FIXME: the manual mentions "write precharge cycles" and "precharge cycles".
42a72824ffSRob Herring (Arm)  We have not been able to figure out which bit fields these correspond to
43a72824ffSRob Herring (Arm)  in the hardware, or what valid values exist. The current hypothesis is that
44a72824ffSRob Herring (Arm)  this is something just used on the FAST chip selects and that the SLOW
45a72824ffSRob Herring (Arm)  chip selects are understood fully. There is also a "byte device enable"
46a72824ffSRob Herring (Arm)  flag somewhere for 8bit memories.
47a72824ffSRob Herring (Arm)
48a72824ffSRob Herring (Arm)  FIXME: The chipselects have SLOW and FAST configuration registers. It's a bit
49a72824ffSRob Herring (Arm)  unclear what this means, if they are mutually exclusive or can be used
50a72824ffSRob Herring (Arm)  together, or if some chip selects are hardwired to be FAST and others are SLOW
51a72824ffSRob Herring (Arm)  by design.
52a72824ffSRob Herring (Arm)
53a72824ffSRob Herring (Arm)  The XMEM registers are totally undocumented but could be partially decoded
54a72824ffSRob Herring (Arm)  because the Cypress AN49576 Antioch Westbridge apparently has suspiciously
55a72824ffSRob Herring (Arm)  similar register layout, see: http://www.cypress.com/file/105771/download
56a72824ffSRob Herring (Arm)
57a72824ffSRob Herring (Arm)maintainers:
58a72824ffSRob Herring (Arm)  - Bjorn Andersson <andersson@kernel.org>
59a72824ffSRob Herring (Arm)
60a72824ffSRob Herring (Arm)properties:
61a72824ffSRob Herring (Arm)  compatible:
62a72824ffSRob Herring (Arm)    enum:
63a72824ffSRob Herring (Arm)      - qcom,apq8060-ebi2
64a72824ffSRob Herring (Arm)      - qcom,msm8660-ebi2
65a72824ffSRob Herring (Arm)
66a72824ffSRob Herring (Arm)  reg:
67a72824ffSRob Herring (Arm)    items:
68a72824ffSRob Herring (Arm)      - description: EBI2 config region
69a72824ffSRob Herring (Arm)      - description: XMEM config region
70a72824ffSRob Herring (Arm)
71a72824ffSRob Herring (Arm)  reg-names:
72a72824ffSRob Herring (Arm)    items:
73a72824ffSRob Herring (Arm)      - const: ebi2
74a72824ffSRob Herring (Arm)      - const: xmem
75a72824ffSRob Herring (Arm)
76a72824ffSRob Herring (Arm)  ranges: true
77a72824ffSRob Herring (Arm)
78a72824ffSRob Herring (Arm)  clocks:
79a72824ffSRob Herring (Arm)    items:
80a72824ffSRob Herring (Arm)      - description: EBI_2X clock
81a72824ffSRob Herring (Arm)      - description: EBI clock
82a72824ffSRob Herring (Arm)
83a72824ffSRob Herring (Arm)  clock-names:
84a72824ffSRob Herring (Arm)    items:
85a72824ffSRob Herring (Arm)      - const: ebi2x
86a72824ffSRob Herring (Arm)      - const: ebi2
87a72824ffSRob Herring (Arm)
88a72824ffSRob Herring (Arm)  '#address-cells':
89a72824ffSRob Herring (Arm)    const: 2
90a72824ffSRob Herring (Arm)
91a72824ffSRob Herring (Arm)  '#size-cells':
92a72824ffSRob Herring (Arm)    const: 1
93a72824ffSRob Herring (Arm)
94a72824ffSRob Herring (Arm)required:
95a72824ffSRob Herring (Arm)  - compatible
96a72824ffSRob Herring (Arm)  - reg
97a72824ffSRob Herring (Arm)  - reg-names
98a72824ffSRob Herring (Arm)  - ranges
99a72824ffSRob Herring (Arm)  - clocks
100a72824ffSRob Herring (Arm)  - clock-names
101a72824ffSRob Herring (Arm)  - '#address-cells'
102a72824ffSRob Herring (Arm)  - '#size-cells'
103a72824ffSRob Herring (Arm)
104a72824ffSRob Herring (Arm)patternProperties:
105a72824ffSRob Herring (Arm)  "^.*@[0-5],[0-9a-f]+$":
106a72824ffSRob Herring (Arm)    type: object
107*5935d1f1SKrzysztof Kozlowski    $ref: mc-peripheral-props.yaml#
108a72824ffSRob Herring (Arm)    additionalProperties: true
109a72824ffSRob Herring (Arm)
110a72824ffSRob Herring (Arm)additionalProperties: false
111a72824ffSRob Herring (Arm)
112a72824ffSRob Herring (Arm)examples:
113a72824ffSRob Herring (Arm)  - |
114a72824ffSRob Herring (Arm)    #include <dt-bindings/clock/qcom,gcc-msm8660.h>
115a72824ffSRob Herring (Arm)    #include <dt-bindings/interrupt-controller/irq.h>
116a72824ffSRob Herring (Arm)    #include <dt-bindings/gpio/gpio.h>
117a72824ffSRob Herring (Arm)
118a72824ffSRob Herring (Arm)    external-bus@1a100000 {
119a72824ffSRob Herring (Arm)        compatible = "qcom,msm8660-ebi2";
120a72824ffSRob Herring (Arm)        reg = <0x1a100000 0x1000>, <0x1a110000 0x1000>;
121a72824ffSRob Herring (Arm)        reg-names = "ebi2", "xmem";
122a72824ffSRob Herring (Arm)        ranges = <0 0x0 0x1a800000 0x00800000>,
123a72824ffSRob Herring (Arm)                 <1 0x0 0x1b000000 0x00800000>,
124a72824ffSRob Herring (Arm)                 <2 0x0 0x1b800000 0x00800000>,
125a72824ffSRob Herring (Arm)                 <3 0x0 0x1d000000 0x08000000>,
126a72824ffSRob Herring (Arm)                 <4 0x0 0x1c800000 0x00800000>,
127a72824ffSRob Herring (Arm)                 <5 0x0 0x1c000000 0x00800000>;
128a72824ffSRob Herring (Arm)
129a72824ffSRob Herring (Arm)        clocks = <&gcc EBI2_2X_CLK>, <&gcc EBI2_CLK>;
130a72824ffSRob Herring (Arm)        clock-names = "ebi2x", "ebi2";
131a72824ffSRob Herring (Arm)
132a72824ffSRob Herring (Arm)        #address-cells = <2>;
133a72824ffSRob Herring (Arm)        #size-cells = <1>;
134a72824ffSRob Herring (Arm)
135a72824ffSRob Herring (Arm)        ethernet@2,0 {
136a72824ffSRob Herring (Arm)            compatible = "smsc,lan9221", "smsc,lan9115";
137a72824ffSRob Herring (Arm)            reg = <2 0x0 0x100>;
138a72824ffSRob Herring (Arm)
139a72824ffSRob Herring (Arm)            interrupts-extended = <&pm8058_gpio 7 IRQ_TYPE_EDGE_FALLING>,
140a72824ffSRob Herring (Arm)                                  <&tlmm 29 IRQ_TYPE_EDGE_RISING>;
141a72824ffSRob Herring (Arm)            reset-gpios = <&tlmm 30 GPIO_ACTIVE_LOW>;
142a72824ffSRob Herring (Arm)
143a72824ffSRob Herring (Arm)            phy-mode = "mii";
144a72824ffSRob Herring (Arm)            reg-io-width = <2>;
145a72824ffSRob Herring (Arm)            smsc,force-external-phy;
146a72824ffSRob Herring (Arm)            smsc,irq-push-pull;
147a72824ffSRob Herring (Arm)
148a72824ffSRob Herring (Arm)            /* SLOW chipselect config */
149a72824ffSRob Herring (Arm)            qcom,xmem-recovery-cycles = <0>;
150a72824ffSRob Herring (Arm)            qcom,xmem-write-hold-cycles = <3>;
151a72824ffSRob Herring (Arm)            qcom,xmem-write-delta-cycles = <31>;
152a72824ffSRob Herring (Arm)            qcom,xmem-read-delta-cycles = <28>;
153a72824ffSRob Herring (Arm)            qcom,xmem-write-wait-cycles = <9>;
154a72824ffSRob Herring (Arm)            qcom,xmem-read-wait-cycles = <9>;
155a72824ffSRob Herring (Arm)        };
156a72824ffSRob Herring (Arm)    };
157