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