~ubuntu-branches/ubuntu/trusty/linux-keystone/trusty-updates

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
This document describes the device tree bindings associated with the KeyStone
Serial RapidIO driver support.

Required properties
-------------------

#address-cells
#size-cells:      Should be '1' if the device has sub-nodes with 'reg' property.
reg:              Address and length of the register set for the SRIO subsystem on
                  the SOC. There are three ranges of registers:
		   - RapidIO registers
		   - boot configuration registers (for JTAGID and K1 SerDes setup)
		   - SerDes configuration registers
clocks:           Clock IDs array as required by the controller.
clock-names:      Names of clocks corresponding to IDs in the clock property.
compatible:       Should be "ti,keystone-rapidio".
interrupts:       The two IRQ definitions for:
		   - RIO special interrupts (doorbell, error, port-write in, ...)
                   - LSU completion.

Optional properties
-------------------

dma-coherent:     Indicate if DirectIO operations support hw cache-coherency.
		  On KeyStone platforms it is recommended to set this property
		  when running on ARM cores.
keystone2-serdes: Indicate that the driver needs to use KeyStone 2 SerDes
		  initialization. If not specified, it will be KeyStone 1
		  initialization instead.
baudrate:         This the lane baudrate configuration number (from 0 to 3).
		  If not specified the baudrate configuration 0 will be used
                  (1.25Gbps).
path_mode:        This is the SerDes lane to port configuration number (from 0 to 4).
		  If not specified the mode 0 will be used (4 ports in 1x).
port-register-timeout:
		  This is the delay in seconds for waiting the port registration at
                  startup. if not specified a default 30 second value will be used.
ports:            This is the bitfield of RapidIO port(s) to probe at startup.
		  If not specified, no port will be used.
dev-id-size:      RapidIO common transport system size:
                   0 - Small size, 8-bit deviceID fields, 256 devices.
                   1 - Large size, 16-bit deviceID fields, 65536 devices.
		  If not specifed 0 (8-bit) value will be used.
lsu:              Index of the two LSUs that will be used for DirectIO transfers and
		  maintenance requests. If not specified LSU 0 will be used for both
		  (LSUs can be shared).
tx_channel:       This is the packet DMA channel name associated with MP transmit.
                  If not specified the "riotx" name will be used.
tx_queue_depth:   Number of descriptors for the transmit queue. Default is 128
                  descriptors.
num-mboxes:       Number of receive mailboxes used for MP. If not specified, only one
		  mailbox will be used.
pkt-forward:      This allow to define the routing table for hardware packet
		  forwarding. There are 8 entries in the table. Each entry starts
		  with the lower DeviceID boundary, then the upper DeviceID boundary
		  and the output port to route packets whose DestID falls within the
		  described range.
		  For example, '0x3 0x3 1' will forward incoming packets with DestID
		  0x3 to port 1.
		  All the 8 entries must be referenced with the 3 values.

SerDes optional properties
--------------------------

These properties are used to tune the KeyStone 2 SerDes hardware parameters and
coefficients. For more information please refer to KeyStone II Architecture
Serializer/Deserializer (SerDes) User Guide (SPRUHO3) available on www.ti.com.

serdes_1sb:       Allow to set the TX driver 1 lsb pre emphasis setting for KeyStone
		  2 SerDes. There is one value per lane. Default value is 0.
serdes_c1:        Allow to override value of TX driver C1 coefficient for KeyStone
		  2 SerDes. There is one value per lane. Default value if not
		  specified is 6 for 3.125Gbps and 4 for other baudrates.
serdes_c2:        Allow to override value of TX driver C2 coefficient for KeyStone
		  2 SerDes. There is one value per lane. Default value is 0 if not
		  specified.
serdes_cm:	  Allow to override value of TX driver CM coefficient for KeyStone
		  2 SerDes. There is one value per lane. Default value is 0.
serdes_att:       Allow to set attenuator setting of TX driver for KeyStone 2 SerDes.
		  There is one value per lane. Default value is 12 if not specified.
serdes_vreg:      Allow to set regulator voltage setting for TX driver for KeyStone 2
		  SerDes. There is one value per lane. Default value is 4 if not
		  specified.
serdes_vdreg:     Allow to set lane regulator output voltage setting for TX driver
                  for KeyStone 2. Default value is 1 (VNOM) if not specified.
serdes_rx_att_start:
                  Allow to set attenuator start value of RX driver for Keystone 2
                  SerDes. There is one value per lane. Default value is 3.
serdes_rx_boost_start:
                  Allow to set attenuator start value of RX driver for Keystone 2
		  SerDes. There is one value per lane. Default value is 3.
serdes_rx_att:    Allow to set attenuator static value of RX driver for Keystone 2
                  SerDes. If set to -1, dynamic calibration is used instead.
                  There is one value per lane. Default value is -1 (dynamic cal).
serdes_rx_boost:  Allow to set attenuator start value of RX driver for Keystone 2
                  SerDes. If set to -1, dynamic calibration is used instead.
                  There is one value per lane. Default value is -1 (dynamic cal).

Sub-nodes
---------

Each mailbox (according to num-mboxes) must be added as subnodes "mbox-%d" with %d the
mailbox number (from 0 to n).
This sub-node has the following properties:

rx_channel:       The packet DMA channel associated to this receive mailbox.
rx_queue_depth:   There can be at present a maximum of 4 queues per packet DMA channel.
		  We can specify the number of descriptors for each queue.
rx-buffer-size:   For each receive queue, we can specify the buffer size.
stream_id:        If specified, the mailbox will be mapped to the indicated stream ID
		  and packet type 9 will be used instead of packet type 11.

Example
-------

rapidio: rapidio@2900000 {
	#address-cells = <1>;
        #size-cells = <1>;
        reg = <0x2900000 0x40000        /* rio regs */
               0x2620000 0x1000         /* boot config regs */
	       0x232c000 0x2000>;       /* serdes config regs */
        clocks = <&clksrio>;
        clock-names = "clk_srio";
        compatible = "ti,keystone-rapidio";
	dma-coherent;

        keystone2-serdes;
        baudrate  = <3>;              /* 5Gbps */
        path_mode = <4>;              /* 1 ports in 4x */
	port-register-timeout = <30>; /* 30 seconds */
	lsu       = <0 0>;            /* DIO and maintenance LSUs */

        tx_channel = "riotx";
        tx_queue_depth = <256>;

        ports = <0x1>;      /* bitfield of port(s) to probe */
        dev-id-size = <0>;  /* RapidIO common transport system
                             * size.
                             * 0 - Small size. 8-bit deviceID
                             *     fields. 256 devices.
                             * 1 - Large size, 16-bit deviceID
                             *     fields. 65536 devices.
                             */
	interrupts = <0 152 0xf01 0 153 0xf01>; /* RIO and LSU IRQs */

        num-mboxes = <2>;

        mbox-0 {
	        rx_channel = "riorx0";
                rx_queue_depth  = <256 0 0 0>;
                rx_buffer_size  = <4096 0 0 0>;
                /*stream_id = <0>;*/
        };

        mbox-1 {
	        rx_channel = "riorx1";
                rx_queue_depth  = <256 0 0 0>;
                rx_buffer_size  = <4096 0 0 0>;
                /*stream_id = <1>;*/
        };
};