1*4882a593Smuzhiyun* Texas Instruments Keystone Navigator Queue Management SubSystem driver 2*4882a593Smuzhiyun 3*4882a593SmuzhiyunThe QMSS (Queue Manager Sub System) found on Keystone SOCs is one of 4*4882a593Smuzhiyunthe main hardware sub system which forms the backbone of the Keystone 5*4882a593Smuzhiyunmulti-core Navigator. QMSS consist of queue managers, packed-data structure 6*4882a593Smuzhiyunprocessors(PDSP), linking RAM, descriptor pools and infrastructure 7*4882a593SmuzhiyunPacket DMA. 8*4882a593SmuzhiyunThe Queue Manager is a hardware module that is responsible for accelerating 9*4882a593Smuzhiyunmanagement of the packet queues. Packets are queued/de-queued by writing or 10*4882a593Smuzhiyunreading descriptor address to a particular memory mapped location. The PDSPs 11*4882a593Smuzhiyunperform QMSS related functions like accumulation, QoS, or event management. 12*4882a593SmuzhiyunLinking RAM registers are used to link the descriptors which are stored in 13*4882a593Smuzhiyundescriptor RAM. Descriptor RAM is configurable as internal or external memory. 14*4882a593SmuzhiyunThe QMSS driver manages the PDSP setups, linking RAM regions, 15*4882a593Smuzhiyunqueue pool management (allocation, push, pop and notify) and descriptor 16*4882a593Smuzhiyunpool management. 17*4882a593Smuzhiyun 18*4882a593Smuzhiyun 19*4882a593SmuzhiyunRequired properties: 20*4882a593Smuzhiyun- compatible : Must be "ti,keystone-navigator-qmss". 21*4882a593Smuzhiyun : Must be "ti,66ak2g-navss-qm" for QMSS on K2G SoC. 22*4882a593Smuzhiyun- clocks : phandle to the reference clock for this device. 23*4882a593Smuzhiyun- queue-range : <start number> total range of queue numbers for the device. 24*4882a593Smuzhiyun- linkram0 : <address size> for internal link ram, where size is the total 25*4882a593Smuzhiyun link ram entries. 26*4882a593Smuzhiyun- linkram1 : <address size> for external link ram, where size is the total 27*4882a593Smuzhiyun external link ram entries. If the address is specified as "0" 28*4882a593Smuzhiyun driver will allocate memory. 29*4882a593Smuzhiyun- qmgrs : child node describing the individual queue managers on the 30*4882a593Smuzhiyun SoC. On keystone 1 devices there should be only one node. 31*4882a593Smuzhiyun On keystone 2 devices there can be more than 1 node. 32*4882a593Smuzhiyun -- managed-queues : the actual queues managed by each queue manager 33*4882a593Smuzhiyun instance, specified as <"base queue #" "# of queues">. 34*4882a593Smuzhiyun -- reg : Address and size of the register set for the device. 35*4882a593Smuzhiyun Register regions should be specified in the following 36*4882a593Smuzhiyun order 37*4882a593Smuzhiyun - Queue Peek region. 38*4882a593Smuzhiyun - Queue status RAM. 39*4882a593Smuzhiyun - Queue configuration region. 40*4882a593Smuzhiyun - Descriptor memory setup region. 41*4882a593Smuzhiyun - Queue Management/Queue Proxy region for queue Push. 42*4882a593Smuzhiyun - Queue Management/Queue Proxy region for queue Pop. 43*4882a593Smuzhiyun 44*4882a593SmuzhiyunFor QMSS on K2G SoC, following QM reg indexes are used in that order 45*4882a593Smuzhiyun - Queue Peek region. 46*4882a593Smuzhiyun - Queue configuration region. 47*4882a593Smuzhiyun - Queue Management/Queue Proxy region for queue Push/Pop. 48*4882a593Smuzhiyun 49*4882a593Smuzhiyun- queue-pools : child node classifying the queue ranges into pools. 50*4882a593Smuzhiyun Queue ranges are grouped into 3 type of pools: 51*4882a593Smuzhiyun - qpend : pool of qpend(interruptible) queues 52*4882a593Smuzhiyun - general-purpose : pool of general queues, primarily used 53*4882a593Smuzhiyun as free descriptor queues or the 54*4882a593Smuzhiyun transmit DMA queues. 55*4882a593Smuzhiyun - accumulator : pool of queues on PDSP accumulator channel 56*4882a593Smuzhiyun Each range can have the following properties: 57*4882a593Smuzhiyun -- qrange : number of queues to use per queue range, specified as 58*4882a593Smuzhiyun <"base queue #" "# of queues">. 59*4882a593Smuzhiyun -- interrupts : Optional property to specify the interrupt mapping 60*4882a593Smuzhiyun for interruptible queues. The driver additionally sets 61*4882a593Smuzhiyun the interrupt affinity hint based on the cpu mask. 62*4882a593Smuzhiyun -- qalloc-by-id : Optional property to specify that the queues in this 63*4882a593Smuzhiyun range can only be allocated by queue id. 64*4882a593Smuzhiyun -- accumulator : Accumulator channel specification. Any of the PDSPs in 65*4882a593Smuzhiyun QMSS can be loaded with the accumulator firmware. The 66*4882a593Smuzhiyun accumulator firmware’s job is to poll a select number of 67*4882a593Smuzhiyun queues looking for descriptors that have been pushed 68*4882a593Smuzhiyun into them. Descriptors are popped from the queue and 69*4882a593Smuzhiyun placed in a buffer provided by the host. When the list 70*4882a593Smuzhiyun becomes full or a programmed time period expires, the 71*4882a593Smuzhiyun accumulator triggers an interrupt to the host to read 72*4882a593Smuzhiyun the buffer for descriptor information. This firmware 73*4882a593Smuzhiyun comes in 16, 32, and 48 channel builds. Each of these 74*4882a593Smuzhiyun channels can be configured to monitor 32 contiguous 75*4882a593Smuzhiyun queues. Accumulator channel property is specified as: 76*4882a593Smuzhiyun <pdsp-id, channel, entries, pacing mode, latency> 77*4882a593Smuzhiyun pdsp-id : QMSS PDSP running accumulator firmware 78*4882a593Smuzhiyun on which the channel has to be 79*4882a593Smuzhiyun configured 80*4882a593Smuzhiyun channel : Accumulator channel number 81*4882a593Smuzhiyun entries : Size of the accumulator descriptor list 82*4882a593Smuzhiyun pacing mode : Interrupt pacing mode 83*4882a593Smuzhiyun 0 : None, i.e interrupt on list full only 84*4882a593Smuzhiyun 1 : Time delay since last interrupt 85*4882a593Smuzhiyun 2 : Time delay since first new packet 86*4882a593Smuzhiyun 3 : Time delay since last new packet 87*4882a593Smuzhiyun latency : time to delay the interrupt, specified 88*4882a593Smuzhiyun in microseconds. 89*4882a593Smuzhiyun -- multi-queue : Optional property to specify that the channel has to 90*4882a593Smuzhiyun monitor up to 32 queues starting at the base queue #. 91*4882a593Smuzhiyun- descriptor-regions : child node describing the memory regions for keystone 92*4882a593Smuzhiyun navigator packet DMA descriptors. The memory for 93*4882a593Smuzhiyun descriptors will be allocated by the driver. 94*4882a593Smuzhiyun -- id : region number in QMSS. 95*4882a593Smuzhiyun -- region-spec : specifies the number of descriptors in the 96*4882a593Smuzhiyun region, specified as 97*4882a593Smuzhiyun <"# of descriptors" "descriptor size">. 98*4882a593Smuzhiyun -- link-index : start index, i.e. index of the first 99*4882a593Smuzhiyun descriptor in the region. 100*4882a593Smuzhiyun 101*4882a593SmuzhiyunOptional properties: 102*4882a593Smuzhiyun- dma-coherent : Present if DMA operations are coherent. 103*4882a593Smuzhiyun- pdsps : child node describing the PDSP configuration. 104*4882a593Smuzhiyun -- firmware : firmware to be loaded on the PDSP. 105*4882a593Smuzhiyun -- id : the qmss pdsp that will run the firmware. 106*4882a593Smuzhiyun -- reg : Address and size of the register set for the PDSP. 107*4882a593Smuzhiyun Register regions should be specified in the following 108*4882a593Smuzhiyun order 109*4882a593Smuzhiyun - PDSP internal RAM region. 110*4882a593Smuzhiyun - PDSP control/status region registers. 111*4882a593Smuzhiyun - QMSS interrupt distributor registers. 112*4882a593Smuzhiyun - PDSP command interface region. 113*4882a593Smuzhiyun 114*4882a593SmuzhiyunExample: 115*4882a593Smuzhiyun 116*4882a593Smuzhiyunqmss: qmss@2a40000 { 117*4882a593Smuzhiyun compatible = "ti,keystone-qmss"; 118*4882a593Smuzhiyun dma-coherent; 119*4882a593Smuzhiyun #address-cells = <1>; 120*4882a593Smuzhiyun #size-cells = <1>; 121*4882a593Smuzhiyun clocks = <&chipclk13>; 122*4882a593Smuzhiyun ranges; 123*4882a593Smuzhiyun queue-range = <0 0x4000>; 124*4882a593Smuzhiyun linkram0 = <0x100000 0x8000>; 125*4882a593Smuzhiyun linkram1 = <0x0 0x10000>; 126*4882a593Smuzhiyun 127*4882a593Smuzhiyun qmgrs { 128*4882a593Smuzhiyun #address-cells = <1>; 129*4882a593Smuzhiyun #size-cells = <1>; 130*4882a593Smuzhiyun ranges; 131*4882a593Smuzhiyun qmgr0 { 132*4882a593Smuzhiyun managed-queues = <0 0x2000>; 133*4882a593Smuzhiyun reg = <0x2a40000 0x20000>, 134*4882a593Smuzhiyun <0x2a06000 0x400>, 135*4882a593Smuzhiyun <0x2a02000 0x1000>, 136*4882a593Smuzhiyun <0x2a03000 0x1000>, 137*4882a593Smuzhiyun <0x23a80000 0x20000>, 138*4882a593Smuzhiyun <0x2a80000 0x20000>; 139*4882a593Smuzhiyun }; 140*4882a593Smuzhiyun 141*4882a593Smuzhiyun qmgr1 { 142*4882a593Smuzhiyun managed-queues = <0x2000 0x2000>; 143*4882a593Smuzhiyun reg = <0x2a60000 0x20000>, 144*4882a593Smuzhiyun <0x2a06400 0x400>, 145*4882a593Smuzhiyun <0x2a04000 0x1000>, 146*4882a593Smuzhiyun <0x2a05000 0x1000>, 147*4882a593Smuzhiyun <0x23aa0000 0x20000>, 148*4882a593Smuzhiyun <0x2aa0000 0x20000>; 149*4882a593Smuzhiyun }; 150*4882a593Smuzhiyun }; 151*4882a593Smuzhiyun queue-pools { 152*4882a593Smuzhiyun qpend { 153*4882a593Smuzhiyun qpend-0 { 154*4882a593Smuzhiyun qrange = <658 8>; 155*4882a593Smuzhiyun interrupts =<0 40 0xf04 0 41 0xf04 0 42 0xf04 156*4882a593Smuzhiyun 0 43 0xf04 0 44 0xf04 0 45 0xf04 157*4882a593Smuzhiyun 0 46 0xf04 0 47 0xf04>; 158*4882a593Smuzhiyun }; 159*4882a593Smuzhiyun qpend-1 { 160*4882a593Smuzhiyun qrange = <8704 16>; 161*4882a593Smuzhiyun interrupts = <0 48 0xf04 0 49 0xf04 0 50 0xf04 162*4882a593Smuzhiyun 0 51 0xf04 0 52 0xf04 0 53 0xf04 163*4882a593Smuzhiyun 0 54 0xf04 0 55 0xf04 0 56 0xf04 164*4882a593Smuzhiyun 0 57 0xf04 0 58 0xf04 0 59 0xf04 165*4882a593Smuzhiyun 0 60 0xf04 0 61 0xf04 0 62 0xf04 166*4882a593Smuzhiyun 0 63 0xf04>; 167*4882a593Smuzhiyun qalloc-by-id; 168*4882a593Smuzhiyun }; 169*4882a593Smuzhiyun qpend-2 { 170*4882a593Smuzhiyun qrange = <8720 16>; 171*4882a593Smuzhiyun interrupts = <0 64 0xf04 0 65 0xf04 0 66 0xf04 172*4882a593Smuzhiyun 0 59 0xf04 0 68 0xf04 0 69 0xf04 173*4882a593Smuzhiyun 0 70 0xf04 0 71 0xf04 0 72 0xf04 174*4882a593Smuzhiyun 0 73 0xf04 0 74 0xf04 0 75 0xf04 175*4882a593Smuzhiyun 0 76 0xf04 0 77 0xf04 0 78 0xf04 176*4882a593Smuzhiyun 0 79 0xf04>; 177*4882a593Smuzhiyun }; 178*4882a593Smuzhiyun }; 179*4882a593Smuzhiyun general-purpose { 180*4882a593Smuzhiyun gp-0 { 181*4882a593Smuzhiyun qrange = <4000 64>; 182*4882a593Smuzhiyun }; 183*4882a593Smuzhiyun netcp-tx { 184*4882a593Smuzhiyun qrange = <640 9>; 185*4882a593Smuzhiyun qalloc-by-id; 186*4882a593Smuzhiyun }; 187*4882a593Smuzhiyun }; 188*4882a593Smuzhiyun accumulator { 189*4882a593Smuzhiyun acc-0 { 190*4882a593Smuzhiyun qrange = <128 32>; 191*4882a593Smuzhiyun accumulator = <0 36 16 2 50>; 192*4882a593Smuzhiyun interrupts = <0 215 0xf01>; 193*4882a593Smuzhiyun multi-queue; 194*4882a593Smuzhiyun qalloc-by-id; 195*4882a593Smuzhiyun }; 196*4882a593Smuzhiyun acc-1 { 197*4882a593Smuzhiyun qrange = <160 32>; 198*4882a593Smuzhiyun accumulator = <0 37 16 2 50>; 199*4882a593Smuzhiyun interrupts = <0 216 0xf01>; 200*4882a593Smuzhiyun multi-queue; 201*4882a593Smuzhiyun }; 202*4882a593Smuzhiyun acc-2 { 203*4882a593Smuzhiyun qrange = <192 32>; 204*4882a593Smuzhiyun accumulator = <0 38 16 2 50>; 205*4882a593Smuzhiyun interrupts = <0 217 0xf01>; 206*4882a593Smuzhiyun multi-queue; 207*4882a593Smuzhiyun }; 208*4882a593Smuzhiyun acc-3 { 209*4882a593Smuzhiyun qrange = <224 32>; 210*4882a593Smuzhiyun accumulator = <0 39 16 2 50>; 211*4882a593Smuzhiyun interrupts = <0 218 0xf01>; 212*4882a593Smuzhiyun multi-queue; 213*4882a593Smuzhiyun }; 214*4882a593Smuzhiyun }; 215*4882a593Smuzhiyun }; 216*4882a593Smuzhiyun descriptor-regions { 217*4882a593Smuzhiyun #address-cells = <1>; 218*4882a593Smuzhiyun #size-cells = <1>; 219*4882a593Smuzhiyun ranges; 220*4882a593Smuzhiyun region-12 { 221*4882a593Smuzhiyun id = <12>; 222*4882a593Smuzhiyun region-spec = <8192 128>; /* num_desc desc_size */ 223*4882a593Smuzhiyun link-index = <0x4000>; 224*4882a593Smuzhiyun }; 225*4882a593Smuzhiyun }; 226*4882a593Smuzhiyun pdsps { 227*4882a593Smuzhiyun #address-cells = <1>; 228*4882a593Smuzhiyun #size-cells = <1>; 229*4882a593Smuzhiyun ranges; 230*4882a593Smuzhiyun pdsp0@2a10000 { 231*4882a593Smuzhiyun reg = <0x2a10000 0x1000>, 232*4882a593Smuzhiyun <0x2a0f000 0x100>, 233*4882a593Smuzhiyun <0x2a0c000 0x3c8>, 234*4882a593Smuzhiyun <0x2a20000 0x4000>; 235*4882a593Smuzhiyun id = <0>; 236*4882a593Smuzhiyun }; 237*4882a593Smuzhiyun }; 238*4882a593Smuzhiyun}; /* qmss */ 239