Path: blob/main/sys/contrib/device-tree/Bindings/bus/qcom,ebi2.txt
48376 views
Qualcomm External Bus Interface 2 (EBI2)12The EBI2 contains two peripheral blocks: XMEM and LCDC. The XMEM handles any3external memory (such as NAND or other memory-mapped peripherals) whereas4LCDC handles LCD displays.56As it says it connects devices to an external bus interface, meaning address7lines (up to 9 address lines so can only address 1KiB external memory space),8data lines (16 bits), OE (output enable), ADV (address valid, used on some9NOR flash memories), WE (write enable). This on top of 6 different chip selects10(CS0 thru CS5) so that in theory 6 different devices can be connected.1112Apparently this bus is clocked at 64MHz. It has dedicated pins on the package13and the bus can only come out on these pins, however if some of the pins are14unused they can be left unconnected or remuxed to be used as GPIO or in some15cases other orthogonal functions as well.1617Also CS1 and CS2 has -A and -B signals. Why they have that is unclear to me.1819The chip selects have the following memory range assignments. This region of20memory is referred to as "Chip Peripheral SS FPB0" and is 168MB big.2122Chip Select Physical address base23CS0 GPIO134 0x1a800000-0x1b000000 (8MB)24CS1 GPIO39 (A) / GPIO123 (B) 0x1b000000-0x1b800000 (8MB)25CS2 GPIO40 (A) / GPIO124 (B) 0x1b800000-0x1c000000 (8MB)26CS3 GPIO133 0x1d000000-0x25000000 (128 MB)27CS4 GPIO132 0x1c800000-0x1d000000 (8MB)28CS5 GPIO131 0x1c000000-0x1c800000 (8MB)2930The APQ8060 Qualcomm Application Processor User Guide, 80-N7150-14 Rev. A,31August 6, 2012 contains some incomplete documentation of the EBI2.3233FIXME: the manual mentions "write precharge cycles" and "precharge cycles".34We have not been able to figure out which bit fields these correspond to35in the hardware, or what valid values exist. The current hypothesis is that36this is something just used on the FAST chip selects and that the SLOW37chip selects are understood fully. There is also a "byte device enable"38flag somewhere for 8bit memories.3940FIXME: The chipselects have SLOW and FAST configuration registers. It's a bit41unclear what this means, if they are mutually exclusive or can be used42together, or if some chip selects are hardwired to be FAST and others are SLOW43by design.4445The XMEM registers are totally undocumented but could be partially decoded46because the Cypress AN49576 Antioch Westbridge apparently has suspiciously47similar register layout, see: http://www.cypress.com/file/105771/download4849Required properties:50- compatible: should be one of:51"qcom,msm8660-ebi2"52"qcom,apq8060-ebi2"53- #address-cells: should be <2>: the first cell is the chipselect,54the second cell is the offset inside the memory range55- #size-cells: should be <1>56- ranges: should be set to:57ranges = <0 0x0 0x1a800000 0x00800000>,58<1 0x0 0x1b000000 0x00800000>,59<2 0x0 0x1b800000 0x00800000>,60<3 0x0 0x1d000000 0x08000000>,61<4 0x0 0x1c800000 0x00800000>,62<5 0x0 0x1c000000 0x00800000>;63- reg: two ranges of registers: EBI2 config and XMEM config areas64- reg-names: should be "ebi2", "xmem"65- clocks: two clocks, EBI_2X and EBI66- clock-names: should be "ebi2x", "ebi2"6768Optional subnodes:69- Nodes inside the EBI2 will be considered device nodes.7071The following optional properties are properties that can be tagged onto72any device subnode. We are assuming that there can be only ONE device per73chipselect subnode, else the properties will become ambiguous.7475Optional properties arrays for SLOW chip selects:76- qcom,xmem-recovery-cycles: recovery cycles is the time the memory continues to77drive the data bus after OE is de-asserted, in order to avoid contention on78the data bus. They are inserted when reading one CS and switching to another79CS or read followed by write on the same CS. Valid values 0 thru 15. Minimum80value is actually 1, so a value of 0 will still yield 1 recovery cycle.81- qcom,xmem-write-hold-cycles: write hold cycles, these are extra cycles82inserted after every write minimum 1. The data out is driven from the time83WE is asserted until CS is asserted. With a hold of 1 (value = 0), the CS84stays active for 1 extra cycle etc. Valid values 0 thru 15.85- qcom,xmem-write-delta-cycles: initial latency for write cycles inserted for86the first write to a page or burst memory. Valid values 0 thru 255.87- qcom,xmem-read-delta-cycles: initial latency for read cycles inserted for the88first read to a page or burst memory. Valid values 0 thru 255.89- qcom,xmem-write-wait-cycles: number of wait cycles for every write access, 0=190cycle. Valid values 0 thru 15.91- qcom,xmem-read-wait-cycles: number of wait cycles for every read access, 0=192cycle. Valid values 0 thru 15.9394Optional properties arrays for FAST chip selects:95- qcom,xmem-address-hold-enable: this is a boolean property stating that we96shall hold the address for an extra cycle to meet hold time requirements97with ADV assertion.98- qcom,xmem-adv-to-oe-recovery-cycles: the number of cycles elapsed before an OE99assertion, with respect to the cycle where ADV (address valid) is asserted.1002 means 2 cycles between ADV and OE. Valid values 0, 1, 2 or 3.101- qcom,xmem-read-hold-cycles: the length in cycles of the first segment of a102read transfer. For a single read transfer this will be the time from CS103assertion to OE assertion. Valid values 0 thru 15.104105106Example:107108ebi2@1a100000 {109compatible = "qcom,apq8060-ebi2";110#address-cells = <2>;111#size-cells = <1>;112ranges = <0 0x0 0x1a800000 0x00800000>,113<1 0x0 0x1b000000 0x00800000>,114<2 0x0 0x1b800000 0x00800000>,115<3 0x0 0x1d000000 0x08000000>,116<4 0x0 0x1c800000 0x00800000>,117<5 0x0 0x1c000000 0x00800000>;118reg = <0x1a100000 0x1000>, <0x1a110000 0x1000>;119reg-names = "ebi2", "xmem";120clocks = <&gcc EBI2_2X_CLK>, <&gcc EBI2_CLK>;121clock-names = "ebi2x", "ebi2";122/* Make sure to set up the pin control for the EBI2 */123pinctrl-names = "default";124pinctrl-0 = <&foo_ebi2_pins>;125126foo-ebi2@2,0 {127compatible = "foo";128reg = <2 0x0 0x100>;129(...)130qcom,xmem-recovery-cycles = <0>;131qcom,xmem-write-hold-cycles = <3>;132qcom,xmem-write-delta-cycles = <31>;133qcom,xmem-read-delta-cycles = <28>;134qcom,xmem-write-wait-cycles = <9>;135qcom,xmem-read-wait-cycles = <9>;136};137};138139140