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