1*b2d2a78aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2*b2d2a78aSEmmanuel Vadot%YAML 1.2 3*b2d2a78aSEmmanuel Vadot--- 4*b2d2a78aSEmmanuel Vadot$id: http://devicetree.org/schemas/bus/qcom,ebi2.yaml# 5*b2d2a78aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6*b2d2a78aSEmmanuel Vadot 7*b2d2a78aSEmmanuel Vadottitle: Qualcomm External Bus Interface 2 (EBI2) 8*b2d2a78aSEmmanuel Vadot 9*b2d2a78aSEmmanuel Vadotdescription: | 10*b2d2a78aSEmmanuel Vadot The EBI2 contains two peripheral blocks: XMEM and LCDC. The XMEM handles any 11*b2d2a78aSEmmanuel Vadot external memory (such as NAND or other memory-mapped peripherals) whereas 12*b2d2a78aSEmmanuel Vadot LCDC handles LCD displays. 13*b2d2a78aSEmmanuel Vadot 14*b2d2a78aSEmmanuel Vadot As it says it connects devices to an external bus interface, meaning address 15*b2d2a78aSEmmanuel Vadot lines (up to 9 address lines so can only address 1KiB external memory space), 16*b2d2a78aSEmmanuel Vadot data lines (16 bits), OE (output enable), ADV (address valid, used on some 17*b2d2a78aSEmmanuel Vadot NOR flash memories), WE (write enable). This on top of 6 different chip selects 18*b2d2a78aSEmmanuel Vadot (CS0 thru CS5) so that in theory 6 different devices can be connected. 19*b2d2a78aSEmmanuel Vadot 20*b2d2a78aSEmmanuel Vadot Apparently this bus is clocked at 64MHz. It has dedicated pins on the package 21*b2d2a78aSEmmanuel Vadot and the bus can only come out on these pins, however if some of the pins are 22*b2d2a78aSEmmanuel Vadot unused they can be left unconnected or remuxed to be used as GPIO or in some 23*b2d2a78aSEmmanuel Vadot cases other orthogonal functions as well. 24*b2d2a78aSEmmanuel Vadot 25*b2d2a78aSEmmanuel Vadot Also CS1 and CS2 has -A and -B signals. Why they have that is unclear to me. 26*b2d2a78aSEmmanuel Vadot 27*b2d2a78aSEmmanuel Vadot The chip selects have the following memory range assignments. This region of 28*b2d2a78aSEmmanuel Vadot memory is referred to as "Chip Peripheral SS FPB0" and is 168MB big. 29*b2d2a78aSEmmanuel Vadot 30*b2d2a78aSEmmanuel Vadot Chip Select Physical address base 31*b2d2a78aSEmmanuel Vadot CS0 GPIO134 0x1a800000-0x1b000000 (8MB) 32*b2d2a78aSEmmanuel Vadot CS1 GPIO39 (A) / GPIO123 (B) 0x1b000000-0x1b800000 (8MB) 33*b2d2a78aSEmmanuel Vadot CS2 GPIO40 (A) / GPIO124 (B) 0x1b800000-0x1c000000 (8MB) 34*b2d2a78aSEmmanuel Vadot CS3 GPIO133 0x1d000000-0x25000000 (128 MB) 35*b2d2a78aSEmmanuel Vadot CS4 GPIO132 0x1c800000-0x1d000000 (8MB) 36*b2d2a78aSEmmanuel Vadot CS5 GPIO131 0x1c000000-0x1c800000 (8MB) 37*b2d2a78aSEmmanuel Vadot 38*b2d2a78aSEmmanuel Vadot The APQ8060 Qualcomm Application Processor User Guide, 80-N7150-14 Rev. A, 39*b2d2a78aSEmmanuel Vadot August 6, 2012 contains some incomplete documentation of the EBI2. 40*b2d2a78aSEmmanuel Vadot 41*b2d2a78aSEmmanuel Vadot FIXME: the manual mentions "write precharge cycles" and "precharge cycles". 42*b2d2a78aSEmmanuel Vadot We have not been able to figure out which bit fields these correspond to 43*b2d2a78aSEmmanuel Vadot in the hardware, or what valid values exist. The current hypothesis is that 44*b2d2a78aSEmmanuel Vadot this is something just used on the FAST chip selects and that the SLOW 45*b2d2a78aSEmmanuel Vadot chip selects are understood fully. There is also a "byte device enable" 46*b2d2a78aSEmmanuel Vadot flag somewhere for 8bit memories. 47*b2d2a78aSEmmanuel Vadot 48*b2d2a78aSEmmanuel Vadot FIXME: The chipselects have SLOW and FAST configuration registers. It's a bit 49*b2d2a78aSEmmanuel Vadot unclear what this means, if they are mutually exclusive or can be used 50*b2d2a78aSEmmanuel Vadot together, or if some chip selects are hardwired to be FAST and others are SLOW 51*b2d2a78aSEmmanuel Vadot by design. 52*b2d2a78aSEmmanuel Vadot 53*b2d2a78aSEmmanuel Vadot The XMEM registers are totally undocumented but could be partially decoded 54*b2d2a78aSEmmanuel Vadot because the Cypress AN49576 Antioch Westbridge apparently has suspiciously 55*b2d2a78aSEmmanuel Vadot similar register layout, see: http://www.cypress.com/file/105771/download 56*b2d2a78aSEmmanuel Vadot 57*b2d2a78aSEmmanuel Vadotmaintainers: 58*b2d2a78aSEmmanuel Vadot - Bjorn Andersson <andersson@kernel.org> 59*b2d2a78aSEmmanuel Vadot 60*b2d2a78aSEmmanuel Vadotproperties: 61*b2d2a78aSEmmanuel Vadot compatible: 62*b2d2a78aSEmmanuel Vadot enum: 63*b2d2a78aSEmmanuel Vadot - qcom,apq8060-ebi2 64*b2d2a78aSEmmanuel Vadot - qcom,msm8660-ebi2 65*b2d2a78aSEmmanuel Vadot 66*b2d2a78aSEmmanuel Vadot reg: 67*b2d2a78aSEmmanuel Vadot items: 68*b2d2a78aSEmmanuel Vadot - description: EBI2 config region 69*b2d2a78aSEmmanuel Vadot - description: XMEM config region 70*b2d2a78aSEmmanuel Vadot 71*b2d2a78aSEmmanuel Vadot reg-names: 72*b2d2a78aSEmmanuel Vadot items: 73*b2d2a78aSEmmanuel Vadot - const: ebi2 74*b2d2a78aSEmmanuel Vadot - const: xmem 75*b2d2a78aSEmmanuel Vadot 76*b2d2a78aSEmmanuel Vadot ranges: true 77*b2d2a78aSEmmanuel Vadot 78*b2d2a78aSEmmanuel Vadot clocks: 79*b2d2a78aSEmmanuel Vadot items: 80*b2d2a78aSEmmanuel Vadot - description: EBI_2X clock 81*b2d2a78aSEmmanuel Vadot - description: EBI clock 82*b2d2a78aSEmmanuel Vadot 83*b2d2a78aSEmmanuel Vadot clock-names: 84*b2d2a78aSEmmanuel Vadot items: 85*b2d2a78aSEmmanuel Vadot - const: ebi2x 86*b2d2a78aSEmmanuel Vadot - const: ebi2 87*b2d2a78aSEmmanuel Vadot 88*b2d2a78aSEmmanuel Vadot '#address-cells': 89*b2d2a78aSEmmanuel Vadot const: 2 90*b2d2a78aSEmmanuel Vadot 91*b2d2a78aSEmmanuel Vadot '#size-cells': 92*b2d2a78aSEmmanuel Vadot const: 1 93*b2d2a78aSEmmanuel Vadot 94*b2d2a78aSEmmanuel Vadotrequired: 95*b2d2a78aSEmmanuel Vadot - compatible 96*b2d2a78aSEmmanuel Vadot - reg 97*b2d2a78aSEmmanuel Vadot - reg-names 98*b2d2a78aSEmmanuel Vadot - ranges 99*b2d2a78aSEmmanuel Vadot - clocks 100*b2d2a78aSEmmanuel Vadot - clock-names 101*b2d2a78aSEmmanuel Vadot - '#address-cells' 102*b2d2a78aSEmmanuel Vadot - '#size-cells' 103*b2d2a78aSEmmanuel Vadot 104*b2d2a78aSEmmanuel VadotpatternProperties: 105*b2d2a78aSEmmanuel Vadot "^.*@[0-5],[0-9a-f]+$": 106*b2d2a78aSEmmanuel Vadot type: object 107*b2d2a78aSEmmanuel Vadot additionalProperties: true 108*b2d2a78aSEmmanuel Vadot properties: 109*b2d2a78aSEmmanuel Vadot reg: 110*b2d2a78aSEmmanuel Vadot maxItems: 1 111*b2d2a78aSEmmanuel Vadot 112*b2d2a78aSEmmanuel Vadot # SLOW chip selects 113*b2d2a78aSEmmanuel Vadot qcom,xmem-recovery-cycles: 114*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 115*b2d2a78aSEmmanuel Vadot description: > 116*b2d2a78aSEmmanuel Vadot The time the memory continues to drive the data bus after OE 117*b2d2a78aSEmmanuel Vadot is de-asserted, in order to avoid contention on the data bus. 118*b2d2a78aSEmmanuel Vadot They are inserted when reading one CS and switching to another 119*b2d2a78aSEmmanuel Vadot CS or read followed by write on the same CS. Minimum value is 120*b2d2a78aSEmmanuel Vadot actually 1, so a value of 0 will still yield 1 recovery cycle. 121*b2d2a78aSEmmanuel Vadot minimum: 0 122*b2d2a78aSEmmanuel Vadot maximum: 15 123*b2d2a78aSEmmanuel Vadot 124*b2d2a78aSEmmanuel Vadot qcom,xmem-write-hold-cycles: 125*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 126*b2d2a78aSEmmanuel Vadot description: > 127*b2d2a78aSEmmanuel Vadot The extra cycles inserted after every write minimum 1. The 128*b2d2a78aSEmmanuel Vadot data out is driven from the time WE is asserted until CS is 129*b2d2a78aSEmmanuel Vadot asserted. With a hold of 1 (value = 0), the CS stays active 130*b2d2a78aSEmmanuel Vadot for 1 extra cycle, etc. 131*b2d2a78aSEmmanuel Vadot minimum: 0 132*b2d2a78aSEmmanuel Vadot maximum: 15 133*b2d2a78aSEmmanuel Vadot 134*b2d2a78aSEmmanuel Vadot qcom,xmem-write-delta-cycles: 135*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 136*b2d2a78aSEmmanuel Vadot description: > 137*b2d2a78aSEmmanuel Vadot The initial latency for write cycles inserted for the first 138*b2d2a78aSEmmanuel Vadot write to a page or burst memory. 139*b2d2a78aSEmmanuel Vadot minimum: 0 140*b2d2a78aSEmmanuel Vadot maximum: 255 141*b2d2a78aSEmmanuel Vadot 142*b2d2a78aSEmmanuel Vadot qcom,xmem-read-delta-cycles: 143*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 144*b2d2a78aSEmmanuel Vadot description: > 145*b2d2a78aSEmmanuel Vadot The initial latency for read cycles inserted for the first 146*b2d2a78aSEmmanuel Vadot read to a page or burst memory. 147*b2d2a78aSEmmanuel Vadot minimum: 0 148*b2d2a78aSEmmanuel Vadot maximum: 255 149*b2d2a78aSEmmanuel Vadot 150*b2d2a78aSEmmanuel Vadot qcom,xmem-write-wait-cycles: 151*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 152*b2d2a78aSEmmanuel Vadot description: > 153*b2d2a78aSEmmanuel Vadot The number of wait cycles for every write access. 154*b2d2a78aSEmmanuel Vadot minimum: 0 155*b2d2a78aSEmmanuel Vadot maximum: 15 156*b2d2a78aSEmmanuel Vadot 157*b2d2a78aSEmmanuel Vadot qcom,xmem-read-wait-cycles: 158*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 159*b2d2a78aSEmmanuel Vadot description: > 160*b2d2a78aSEmmanuel Vadot The number of wait cycles for every read access. 161*b2d2a78aSEmmanuel Vadot minimum: 0 162*b2d2a78aSEmmanuel Vadot maximum: 15 163*b2d2a78aSEmmanuel Vadot 164*b2d2a78aSEmmanuel Vadot 165*b2d2a78aSEmmanuel Vadot # FAST chip selects 166*b2d2a78aSEmmanuel Vadot qcom,xmem-address-hold-enable: 167*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 168*b2d2a78aSEmmanuel Vadot description: > 169*b2d2a78aSEmmanuel Vadot Holds the address for an extra cycle to meet hold time 170*b2d2a78aSEmmanuel Vadot requirements with ADV assertion, when set to 1. 171*b2d2a78aSEmmanuel Vadot enum: [ 0, 1 ] 172*b2d2a78aSEmmanuel Vadot 173*b2d2a78aSEmmanuel Vadot qcom,xmem-adv-to-oe-recovery-cycles: 174*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 175*b2d2a78aSEmmanuel Vadot description: > 176*b2d2a78aSEmmanuel Vadot The number of cycles elapsed before an OE assertion, with 177*b2d2a78aSEmmanuel Vadot respect to the cycle where ADV (address valid) is asserted. 178*b2d2a78aSEmmanuel Vadot minimum: 0 179*b2d2a78aSEmmanuel Vadot maximum: 3 180*b2d2a78aSEmmanuel Vadot 181*b2d2a78aSEmmanuel Vadot qcom,xmem-read-hold-cycles: 182*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 183*b2d2a78aSEmmanuel Vadot description: > 184*b2d2a78aSEmmanuel Vadot The length in cycles of the first segment of a read transfer. 185*b2d2a78aSEmmanuel Vadot For a single read transfer this will be the time from CS 186*b2d2a78aSEmmanuel Vadot assertion to OE assertion. 187*b2d2a78aSEmmanuel Vadot minimum: 0 188*b2d2a78aSEmmanuel Vadot maximum: 15 189*b2d2a78aSEmmanuel Vadot 190*b2d2a78aSEmmanuel Vadot required: 191*b2d2a78aSEmmanuel Vadot - reg 192*b2d2a78aSEmmanuel Vadot 193*b2d2a78aSEmmanuel VadotadditionalProperties: false 194*b2d2a78aSEmmanuel Vadot 195*b2d2a78aSEmmanuel Vadotexamples: 196*b2d2a78aSEmmanuel Vadot - | 197*b2d2a78aSEmmanuel Vadot #include <dt-bindings/clock/qcom,gcc-msm8660.h> 198*b2d2a78aSEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 199*b2d2a78aSEmmanuel Vadot #include <dt-bindings/gpio/gpio.h> 200*b2d2a78aSEmmanuel Vadot 201*b2d2a78aSEmmanuel Vadot external-bus@1a100000 { 202*b2d2a78aSEmmanuel Vadot compatible = "qcom,msm8660-ebi2"; 203*b2d2a78aSEmmanuel Vadot reg = <0x1a100000 0x1000>, <0x1a110000 0x1000>; 204*b2d2a78aSEmmanuel Vadot reg-names = "ebi2", "xmem"; 205*b2d2a78aSEmmanuel Vadot ranges = <0 0x0 0x1a800000 0x00800000>, 206*b2d2a78aSEmmanuel Vadot <1 0x0 0x1b000000 0x00800000>, 207*b2d2a78aSEmmanuel Vadot <2 0x0 0x1b800000 0x00800000>, 208*b2d2a78aSEmmanuel Vadot <3 0x0 0x1d000000 0x08000000>, 209*b2d2a78aSEmmanuel Vadot <4 0x0 0x1c800000 0x00800000>, 210*b2d2a78aSEmmanuel Vadot <5 0x0 0x1c000000 0x00800000>; 211*b2d2a78aSEmmanuel Vadot 212*b2d2a78aSEmmanuel Vadot clocks = <&gcc EBI2_2X_CLK>, <&gcc EBI2_CLK>; 213*b2d2a78aSEmmanuel Vadot clock-names = "ebi2x", "ebi2"; 214*b2d2a78aSEmmanuel Vadot 215*b2d2a78aSEmmanuel Vadot #address-cells = <2>; 216*b2d2a78aSEmmanuel Vadot #size-cells = <1>; 217*b2d2a78aSEmmanuel Vadot 218*b2d2a78aSEmmanuel Vadot ethernet@2,0 { 219*b2d2a78aSEmmanuel Vadot compatible = "smsc,lan9221", "smsc,lan9115"; 220*b2d2a78aSEmmanuel Vadot reg = <2 0x0 0x100>; 221*b2d2a78aSEmmanuel Vadot 222*b2d2a78aSEmmanuel Vadot interrupts-extended = <&pm8058_gpio 7 IRQ_TYPE_EDGE_FALLING>, 223*b2d2a78aSEmmanuel Vadot <&tlmm 29 IRQ_TYPE_EDGE_RISING>; 224*b2d2a78aSEmmanuel Vadot reset-gpios = <&tlmm 30 GPIO_ACTIVE_LOW>; 225*b2d2a78aSEmmanuel Vadot 226*b2d2a78aSEmmanuel Vadot phy-mode = "mii"; 227*b2d2a78aSEmmanuel Vadot reg-io-width = <2>; 228*b2d2a78aSEmmanuel Vadot smsc,force-external-phy; 229*b2d2a78aSEmmanuel Vadot smsc,irq-push-pull; 230*b2d2a78aSEmmanuel Vadot 231*b2d2a78aSEmmanuel Vadot /* SLOW chipselect config */ 232*b2d2a78aSEmmanuel Vadot qcom,xmem-recovery-cycles = <0>; 233*b2d2a78aSEmmanuel Vadot qcom,xmem-write-hold-cycles = <3>; 234*b2d2a78aSEmmanuel Vadot qcom,xmem-write-delta-cycles = <31>; 235*b2d2a78aSEmmanuel Vadot qcom,xmem-read-delta-cycles = <28>; 236*b2d2a78aSEmmanuel Vadot qcom,xmem-write-wait-cycles = <9>; 237*b2d2a78aSEmmanuel Vadot qcom,xmem-read-wait-cycles = <9>; 238*b2d2a78aSEmmanuel Vadot }; 239*b2d2a78aSEmmanuel Vadot }; 240