FreeBSD kernel pms device code
sautil.c
Go to the documentation of this file.
1/*******************************************************************************
2*Copyright (c) 2014 PMC-Sierra, Inc. All rights reserved.
3*
4*Redistribution and use in source and binary forms, with or without modification, are permitted provided
5*that the following conditions are met:
6*1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
7*following disclaimer.
8*2. Redistributions in binary form must reproduce the above copyright notice,
9*this list of conditions and the following disclaimer in the documentation and/or other materials provided
10*with the distribution.
11*
12*THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
13*WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
15*FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16*NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
17*BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19*SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
20
21********************************************************************************/
22/*******************************************************************************/
28/******************************************************************************/
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD$");
31#include <dev/pms/config.h>
32
34#ifdef SA_TESTBASE_EXTRA
35#include <string.h>
36#endif /* SA_TESTBASE_EXTRA */
37
38
39#ifdef SA_ENABLE_TRACE_FUNCTIONS
40#ifdef siTraceFileID
41#undef siTraceFileID
42#endif
43#define siTraceFileID 'S'
44#endif
45
46/******************************************************************************/
55/*******************************************************************************/
56int siIsHexDigit(char a)
57{
58 return ( (((a) >= 'a') && ((a) <= 'z')) ||
59 (((a) >= 'A') && ((a) <= 'Z')) ||
60 (((a) >= '0') && ((a) <= '9')) ||
61 ( (a) == '*'));
62}
63
64/******************************************************************************/
73/*******************************************************************************/
75void*
76si_memcpy(void *dst, void *src, bit32 count)
77{
78/*
79 bit32 x;
80 unsigned char *dst1 = (unsigned char *)dst;
81 unsigned char *src1 = (unsigned char *)src;
82
83 for (x=0; x < count; x++)
84 dst1[x] = src1[x];
85
86 return dst;
87*/
88 return memcpy(dst, src, count);
89}
90
91
92/******************************************************************************/
101/*******************************************************************************/
103void*
104si_memset(void *s, int c, bit32 n)
105{
106/*
107 bit32 i;
108 char *dst = (char *)s;
109 for (i=0; i < n; i++)
110 {
111 dst[i] = (char) c;
112 }
113 return (void *)(&dst[i-n]);
114*/
115 return memset(s, c, n);
116}
117
118
119/******************************************************************************/
128/*******************************************************************************/
129GLOBAL void
131 agsaRoot_t *agRoot,
132 bit32 count)
133{
134 bit32 j, num_found = 0;
135 agsaIORequestDesc_t *pRequestDesc = agNULL;
136 agsaLLRoot_t *saRoot = agNULL;
137 bit32 i;
138 mpiOCQueue_t *circularQ;
139
140 /* sanity check */
141 SA_ASSERT((agNULL != agRoot), "");
142 saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
143 SA_ASSERT((agNULL != saRoot), "");
144
145
147 // return;
148
149
150 if(smIS_SPCV(agRoot))
151 {
152 bit32 sp1;
154
156 {
157 SA_DBG1(("siDumpActiveIORequests: SCRATCH_PAD1_V_ERROR_STAT 0x%x\n",sp1 ));
158 }
159 SA_DBG1(("siDumpActiveIORequests: SCRATCH_PAD0 value = 0x%x\n", ossaHwRegRead(agRoot, V_Scratchpad_0_Register)));
160 SA_DBG1(("siDumpActiveIORequests: SCRATCH_PAD1 value = 0x%x\n", ossaHwRegRead(agRoot, V_Scratchpad_1_Register)));
161 SA_DBG1(("siDumpActiveIORequests: SCRATCH_PAD2 value = 0x%x\n", ossaHwRegRead(agRoot, V_Scratchpad_2_Register)));
162 SA_DBG1(("siDumpActiveIORequests: SCRATCH_PAD3 value = 0x%x\n", ossaHwRegRead(agRoot, V_Scratchpad_3_Register)));
163 }
164
165 for ( i = 0; i < saRoot->QueueConfig.numOutboundQueues; i++ )
166 {
167 circularQ = &saRoot->outboundQueue[i];
168 OSSA_READ_LE_32(circularQ->agRoot, &circularQ->producerIdx, circularQ->piPointer, 0);
169 if(circularQ->producerIdx != circularQ->consumerIdx)
170 {
171 SA_DBG1(("siDumpActiveIORequests:OBQ%d PI 0x%03x CI 0x%03x\n", i,circularQ->producerIdx, circularQ->consumerIdx ));
172 }
173 }
174
175 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), 0);
176 SA_DBG1(("siDumpActiveIORequests: Current Time: %d ticks (usecpertick=%d)\n",
177 saRoot->timeTick, saRoot->usecsPerTick));
178
179 for ( j = 0; j < count; j ++ )
180 {
181 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), j);
182
183 if (pRequestDesc->valid == agTRUE)
184 {
185 num_found++;
186 SA_DBG1(("siDumpActiveIORequests: IO #%4d: %p Tag=%03X Type=%08X Device 0x%X Pending for %d seconds\n",
187 j,
188 pRequestDesc->pIORequestContext,
189 pRequestDesc->HTag,
190 pRequestDesc->requestType,
191 pRequestDesc->pDevice ? pRequestDesc->pDevice->DeviceMapIndex : 0,
192 ((saRoot->timeTick - pRequestDesc->startTick)*saRoot->usecsPerTick)/1000000 ));
193
194 }
195 }
196 if(count)
197 {
198 SA_DBG1(("siDumpActiveIORequests: %d found active\n",num_found));
199 }
200
201}
202
203/******************************************************************************/
212/*******************************************************************************/
213GLOBAL void
215 agsaRoot_t *agRoot)
216{
217 bit32 j;
218 bit32 num_found = 0;
219 agsaIORequestDesc_t *pRequestDesc = agNULL;
220 agsaLLRoot_t *saRoot = agNULL;
221
222 /* sanity check */
223 SA_ASSERT((agNULL != agRoot), "");
224 saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
225 SA_ASSERT((agNULL != saRoot), "");
226
227 if(saRoot)
228 {
229 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), 0);
230
231 for ( j = 0; j < saRoot->swConfig.maxActiveIOs; j++ )
232 {
233 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), j);
234
235 if (pRequestDesc->valid == agTRUE)
236 {
237 num_found++;
238 pRequestDesc->valid = agFALSE;
239 }
240 }
241 if(num_found)
242 {
243 SA_DBG1(("siClearActiveIORequests %d found active\n",num_found));
244 }
245 }
246 else
247 {
248 SA_DBG1(("siClearActiveIORequests saroot NULL\n"));
249 }
250
251}
252
253/******************************************************************************/
262/*******************************************************************************/
263GLOBAL void
265 agsaRoot_t *agRoot,
266 bit32 device )
267{
268 bit32 j, num_found = 0;
269 agsaIORequestDesc_t *pRequestDesc = agNULL;
270 agsaLLRoot_t *saRoot = agNULL;
271
272 /* sanity check */
273 SA_ASSERT((agNULL != agRoot), "");
274 saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
275 SA_ASSERT((agNULL != saRoot), "");
276
277 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), 0);
278
279 for ( j = 0; j < saRoot->swConfig.maxActiveIOs; j++ )
280 {
281 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), j);
282
283 if (pRequestDesc->valid == agTRUE)
284 {
285 if (pRequestDesc->pDevice)
286 {
287 if (pRequestDesc->pDevice->DeviceMapIndex == device)
288 {
289 num_found++;
290 pRequestDesc->valid = agFALSE;
291 }
292 }
293 }
294 }
295 if(num_found)
296 {
297 SA_DBG1(("siClearActiveIORequestsOnDevice 0x%x %d cleared\n",device,num_found));
298 }
299
300}
301
302
303
304/******************************************************************************/
313/*******************************************************************************/
314GLOBAL void
316 agsaRoot_t *agRoot,
317 bit32 device )
318{
319 bit32 j, num_found = 0;
320 agsaIORequestDesc_t *pRequestDesc = agNULL;
321 agsaLLRoot_t *saRoot = agNULL;
322
323 /* sanity check */
324 SA_ASSERT((agNULL != agRoot), "");
325 saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
326 SA_ASSERT((agNULL != saRoot), "");
327
328 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), 0);
329
330 for ( j = 0; j < saRoot->swConfig.maxActiveIOs; j++ )
331 {
332 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), j);
333
334 if (pRequestDesc->valid == agTRUE)
335 {
336 if (pRequestDesc->pDevice)
337 {
338 if (pRequestDesc->pDevice->DeviceMapIndex == device)
339 {
340 num_found++;
341 if(saRoot->ResetStartTick > pRequestDesc->startTick)
342 {
343 SA_DBG2(("siCountActiveIORequestsOnDevice: saRoot->ResetStartTick %d pRequestDesc->startTick %d\n",
344 saRoot->ResetStartTick, pRequestDesc->startTick));
345 }
346 }
347 }
348 }
349 }
350 if(num_found)
351 {
352 SA_DBG1(("siCountActiveIORequestsOnDevice 0x%x %d found active\n",device,num_found));
353 }
354
355}
356
357
358
359/******************************************************************************/
368/*******************************************************************************/
369GLOBAL void
371 agsaRoot_t *agRoot)
372{
373 bit32 j, num_found = 0;
374 agsaIORequestDesc_t *pRequestDesc = agNULL;
375 agsaLLRoot_t *saRoot = agNULL;
376
377 /* sanity check */
378 SA_ASSERT((agNULL != agRoot), "");
379 if( agRoot == agNULL)
380 {
381 return;
382 }
383 saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
384 if( saRoot == agNULL)
385 {
386 return;
387 }
388 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), 0);
389
390 for ( j = 0; j < saRoot->swConfig.maxActiveIOs; j++ )
391 {
392 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), j);
393
394 if (pRequestDesc->valid == agTRUE)
395 {
396 num_found++;
397 if(saRoot->ResetStartTick > pRequestDesc->startTick)
398 {
399 SA_DBG2(("saCountActiveIORequests: saRoot->ResetStartTick %d pRequestDesc->startTick %d\n",
400 saRoot->ResetStartTick, pRequestDesc->startTick));
401 }
402 }
403 }
404 if(num_found)
405 {
406 SA_DBG1(("saCountActiveIORequests %d found active\n",num_found));
407 }
408
409}
410
411
413{
414
415 if(smIsCfg_V8008(agRoot) == 1) return 1;
416 if(smIsCfg_V8009(agRoot) == 1) return 1;
417 if(smIsCfg_V8018(agRoot) == 1) return 1;
418 if(smIsCfg_V8019(agRoot) == 1) return 1;
419 if(smIsCfg_V8088(agRoot) == 1) return 1;
420 if(smIsCfg_V8089(agRoot) == 1) return 1;
421 if(smIsCfg_V8070(agRoot) == 1) return 1;
422 if(smIsCfg_V8071(agRoot) == 1) return 1;
423 if(smIsCfg_V8072(agRoot) == 1) return 1;
424 if(smIsCfg_V8073(agRoot) == 1) return 1;
425 if(smIS_SPCV8074(agRoot) == 1) return 1;
426 if(smIS_SPCV8075(agRoot) == 1) return 1;
427 if(smIS_SPCV8076(agRoot) == 1) return 1;
428 if(smIS_SPCV8077(agRoot) == 1) return 1;
429 if(smIsCfg_V8025(agRoot) == 1) return 1;
430 if(smIsCfg_V9015(agRoot) == 1) return 1;
431 if(smIsCfg_V9060(agRoot) == 1) return 1;
432 if(smIsCfg_V8006(agRoot) == 1) return 1;
433
434 return 0;
435}
436
438{
439 if(smIS_spc8001(agRoot) == 1) return 1;
440 if(smIS_spc8081(agRoot) == 1) return 1;
441 if(smIS_SFC_AS_SPC(agRoot) == 1) return 1;
442 return 0;
443}
444
445
446GLOBAL bit32 smIS_HIL( agsaRoot_t *agRoot) /* or delray */
447{
448 if(smIS_spc8081(agRoot) == 1) return 1;
449 if(smIS_ADAP8088(agRoot) == 1) return 1;
450 if(smIS_ADAP8089(agRoot) == 1) return 1;
451 if(smIS_SPCV8074(agRoot) == 1) return 1;
452 if(smIS_SPCV8075(agRoot) == 1) return 1;
453 if(smIS_SPCV8076(agRoot) == 1) return 1;
454 if(smIS_SPCV8077(agRoot) == 1) return 1;
455 return 0;
456
457}
458
460{
461 if(smIS_SPCV8008(agRoot) == 1) return 1;
462 if(smIS_SPCV8009(agRoot) == 1) return 1;
463 if(smIS_SPCV8018(agRoot) == 1) return 1;
464 if(smIS_SPCV8019(agRoot) == 1) return 1;
465 if(smIS_ADAP8088(agRoot) == 1) return 1;
466 if(smIS_ADAP8089(agRoot) == 1) return 1;
467 return 0;
468}
469
471{
472 if(smIS_SPCV8070(agRoot) == 1) return 1;
473 if(smIS_SPCV8071(agRoot) == 1) return 1;
474 if(smIS_SPCV8072(agRoot) == 1) return 1;
475 if(smIS_SPCV8073(agRoot) == 1) return 1;
476 if(smIS_SPCV8074(agRoot) == 1) return 1;
477 if(smIS_SPCV8075(agRoot) == 1) return 1;
478 if(smIS_SPCV8076(agRoot) == 1) return 1;
479 if(smIS_SPCV8077(agRoot) == 1) return 1;
480 if(smIS_SPCV9015(agRoot) == 1) return 1;
481 if(smIS_SPCV9060(agRoot) == 1) return 1;
482 if(smIS_SPCV8006(agRoot) == 1) return 1;
483 return 0;
484}
485
487{
488 if(smIS_SPCV8009(agRoot) == 1) return 1;
489 if(smIS_SPCV8018(agRoot) == 1) return 1;
490 if(smIS_SPCV8019(agRoot) == 1) return 1;
491 if(smIS_SPCV8071(agRoot) == 1) return 1;
492 if(smIS_SPCV8072(agRoot) == 1) return 1;
493 if(smIS_SPCV8073(agRoot) == 1) return 1;
494 if(smIS_SPCV8076(agRoot) == 1) return 1;
495 if(smIS_SPCV8077(agRoot) == 1) return 1;
496 if(smIS_ADAP8088(agRoot) == 1) return 1;
497 if(smIS_ADAP8089(agRoot) == 1) return 1;
498 if(smIS_SPCV8006(agRoot) == 1) return 1;
499 return 0;
500}
501
503{
504 if(smIS_SPC6V(agRoot) == 1) return 1;
505 if(smIS_SPC12V(agRoot) == 1) return 1;
506 if(smIS_SFC_AS_V(agRoot) == 1 ) return 1;
507 return 0;
508}
509
511{
512 if(smIS_SPCV8009(agRoot) == 1) return 1;
513 if(smIS_ADAP8088(agRoot) == 1) return 1;
514 if(smIS_SPCV8019(agRoot) == 1) return 1;
515 if(smIS_SPCV8071(agRoot) == 1) return 1;
516 if(smIS_SPCV8073(agRoot) == 1) return 1;
517 if(smIS_SPCV8077(agRoot) == 1) return 1;
518 if(smIS_SPCV9015(agRoot) == 1) return 1;
519 if(smIS_SPCV9060(agRoot) == 1) return 1;
520 return 0;
521}
522
523
524
525#if defined(SALLSDK_DEBUG)
526
527/******************************************************************************/
539/*******************************************************************************/
541 bit32 debugLevel,
542 siPrintType type,
543 char *header,
544 void *a,
545 bit32 length
546 )
547{
548 bit32 x, rem;
549 bit8 *buffer = (bit8 *)a;
550 bit32 *lPtr;
551 bit8 temp[16];
552
553 ossaLogDebugString(gLLDebugLevel, debugLevel, ("%s\n", header));
554
555 if (type == SA_8)
556 {
557 for (x=0; x < length/16; x++)
558 {
560 ("%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x == "
561 "%c%c%c%c%c%c%c%c - %c%c%c%c%c%c%c%c\n",
562 *(buffer),
563 *(buffer+1),
564 *(buffer+2),
565 *(buffer+3),
566 *(buffer+4),
567 *(buffer+5),
568 *(buffer+6),
569 *(buffer+7),
570 *(buffer+8),
571 *(buffer+9),
572 *(buffer+10),
573 *(buffer+11),
574 *(buffer+12),
575 *(buffer+13),
576 *(buffer+14),
577 *(buffer+15),
578 siIsHexDigit(*(buffer)) ? *(buffer) : ' ',
579 siIsHexDigit(*(buffer+1)) ? *(buffer+1) : ' ',
580 siIsHexDigit(*(buffer+2)) ? *(buffer+2) : ' ',
581 siIsHexDigit(*(buffer+3)) ? *(buffer+3) : ' ',
582 siIsHexDigit(*(buffer+4)) ? *(buffer+4) : ' ',
583 siIsHexDigit(*(buffer+5)) ? *(buffer+5) : ' ',
584 siIsHexDigit(*(buffer+6)) ? *(buffer+6) : ' ',
585 siIsHexDigit(*(buffer+7)) ? *(buffer+7) : ' ',
586 siIsHexDigit(*(buffer+8)) ? *(buffer+8) : ' ',
587 siIsHexDigit(*(buffer+9)) ? *(buffer+9) : ' ',
588 siIsHexDigit(*(buffer+10)) ? *(buffer+10) : ' ',
589 siIsHexDigit(*(buffer+11)) ? *(buffer+11) : ' ',
590 siIsHexDigit(*(buffer+12)) ? *(buffer+12) : ' ',
591 siIsHexDigit(*(buffer+13)) ? *(buffer+13) : ' ',
592 siIsHexDigit(*(buffer+14)) ? *(buffer+14) : ' ',
593 siIsHexDigit(*(buffer+15)) ? *(buffer+15) : ' ')
594 );
595
596 buffer += 16;
597 }
598
599 rem = length%16;
600 if (rem)
601 {
602 for (x = 0; x < 16; x++)
603 {
604 temp[x] = ' ';
605 }
606
607 for (x = 0; x < rem; x++)
608 {
609 temp[x] = *(buffer+x);
610 }
611
612 buffer = temp;
613
615 ("%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x == "
616 "%c%c%c%c%c%c%c%c - %c%c%c%c%c%c%c%c\n",
617 *(buffer),
618 *(buffer+1),
619 *(buffer+2),
620 *(buffer+3),
621 *(buffer+4),
622 *(buffer+5),
623 *(buffer+6),
624 *(buffer+7),
625 *(buffer+8),
626 *(buffer+9),
627 *(buffer+10),
628 *(buffer+11),
629 *(buffer+12),
630 *(buffer+13),
631 *(buffer+14),
632 *(buffer+15),
633 siIsHexDigit(*(buffer)) ? *(buffer) : ' ',
634 siIsHexDigit(*(buffer+1)) ? *(buffer+1) : ' ',
635 siIsHexDigit(*(buffer+2)) ? *(buffer+2) : ' ',
636 siIsHexDigit(*(buffer+3)) ? *(buffer+3) : ' ',
637 siIsHexDigit(*(buffer+4)) ? *(buffer+4) : ' ',
638 siIsHexDigit(*(buffer+5)) ? *(buffer+5) : ' ',
639 siIsHexDigit(*(buffer+6)) ? *(buffer+6) : ' ',
640 siIsHexDigit(*(buffer+7)) ? *(buffer+7) : ' ',
641 siIsHexDigit(*(buffer+8)) ? *(buffer+8) : ' ',
642 siIsHexDigit(*(buffer+9)) ? *(buffer+9) : ' ',
643 siIsHexDigit(*(buffer+10)) ? *(buffer+10) : ' ',
644 siIsHexDigit(*(buffer+11)) ? *(buffer+11) : ' ',
645 siIsHexDigit(*(buffer+12)) ? *(buffer+12) : ' ',
646 siIsHexDigit(*(buffer+13)) ? *(buffer+13) : ' ',
647 siIsHexDigit(*(buffer+14)) ? *(buffer+14) : ' ',
648 siIsHexDigit(*(buffer+15)) ? *(buffer+15) : ' ')
649 );
650 }
651 }
652 else
653 {
654 bit32 *ltemp = (bit32 *)temp;
655 lPtr = (bit32 *) a;
656
657 for (x=0; x < length/4; x++)
658 {
660 ("%08x %08x %08x %08x\n",
661 *(lPtr),
662 *(lPtr+1),
663 *(lPtr+2),
664 *(lPtr+3))
665 );
666
667 lPtr += 4;
668 }
669
670 rem = length%4;
671 if (rem)
672 {
673 for (x = 0; x < 4; x++)
674 {
675 ltemp[x] = 0;
676 }
677
678 for (x = 0; x < rem; x++)
679 {
680 ltemp[x] = lPtr[x];
681 }
682
683 lPtr = ltemp;
684
686 ("%08x %08x %08x %08x\n",
687 *(lPtr),
688 *(lPtr+1),
689 *(lPtr+2),
690 *(lPtr+3))
691 );
692 }
693 }
694
695}
696
697
698
699void sidump_hwConfig(agsaHwConfig_t *hwConfig)
700{
701 SA_DBG2(("sidump_hwConfig:hwConfig->hwInterruptCoalescingTimer 0x%x\n",hwConfig->hwInterruptCoalescingTimer ));
702 SA_DBG2(("sidump_hwConfig:hwConfig->hwInterruptCoalescingControl 0x%x\n",hwConfig->hwInterruptCoalescingControl ));
703 SA_DBG2(("sidump_hwConfig:hwConfig->intReassertionOption 0x%x\n",hwConfig->intReassertionOption ));
704 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister0 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister0 ));
705 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister1 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister1 ));
706 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister2 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister2 ));
707 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister3 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister3 ));
708 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister4 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister4 ));
709 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister5 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister5 ));
710 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister6 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister6 ));
711 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister7 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister7 ));
712 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister8 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister8 ));
713 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister9 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister9 ));
714 SA_DBG2(("sidump_hwConfig:hwConfig->hwOption 0x%x\n",hwConfig->hwOption ));
715}
716
717void sidump_swConfig(agsaSwConfig_t *swConfig)
718{
719 SA_DBG2(("sidump_swConfig:swConfig->maxActiveIOs 0x%x\n",swConfig->maxActiveIOs ));
720 SA_DBG2(("sidump_swConfig:swConfig->numDevHandles 0x%x\n",swConfig->numDevHandles ));
721 SA_DBG2(("sidump_swConfig:swConfig->smpReqTimeout 0x%x\n",swConfig->smpReqTimeout ));
722 SA_DBG2(("sidump_swConfig:swConfig->numberOfEventRegClients 0x%x\n",swConfig->numberOfEventRegClients ));
723 SA_DBG2(("sidump_swConfig:swConfig->sizefEventLog1 0x%x\n",swConfig->sizefEventLog1 ));
724 SA_DBG2(("sidump_swConfig:swConfig->sizefEventLog2 0x%x\n",swConfig->sizefEventLog2 ));
725 SA_DBG2(("sidump_swConfig:swConfig->eventLog1Option 0x%x\n",swConfig->eventLog1Option ));
726 SA_DBG2(("sidump_swConfig:swConfig->eventLog2Option 0x%x\n",swConfig->eventLog2Option ));
727 SA_DBG2(("sidump_swConfig:swConfig->fatalErrorInterruptEnable 0x%x\n",swConfig->fatalErrorInterruptEnable ));
728 SA_DBG2(("sidump_swConfig:swConfig->fatalErrorInterruptVector 0x%x\n",swConfig->fatalErrorInterruptVector ));
729 SA_DBG2(("sidump_swConfig:swConfig->max_MSI_InterruptVectors 0x%x\n",swConfig->max_MSI_InterruptVectors ));
730 SA_DBG2(("sidump_swConfig:swConfig->max_MSIX_InterruptVectors 0x%x\n",swConfig->max_MSIX_InterruptVectors ));
731 SA_DBG2(("sidump_swConfig:swConfig->legacyInt_X 0x%x\n",swConfig->legacyInt_X ));
732 SA_DBG2(("sidump_swConfig:swConfig->hostDirectAccessSupport 0x%x\n",swConfig->hostDirectAccessSupport ));
733 SA_DBG2(("sidump_swConfig:swConfig->hostDirectAccessMode 0x%x\n",swConfig->hostDirectAccessMode ));
734 SA_DBG2(("sidump_swConfig:swConfig->param1 0x%x\n",swConfig->param1 ));
735 SA_DBG2(("sidump_swConfig:swConfig->param2 0x%x\n",swConfig->param2 ));
736 SA_DBG2(("sidump_swConfig:swConfig->param3 %p\n",swConfig->param3 ));
737 SA_DBG2(("sidump_swConfig:swConfig->param4 %p\n",swConfig->param4 ));
738
739}
740
741
742void sidump_Q_config( agsaQueueConfig_t *queueConfig )
743{
744 bit32 x;
745
746 SA_DBG2(("sidump_Q_config: queueConfig->generalEventQueue 0x%x\n", queueConfig->generalEventQueue ));
747 SA_DBG2(("sidump_Q_config: queueConfig->numInboundQueues 0x%x\n", queueConfig->numInboundQueues ));
748 SA_DBG2(("sidump_Q_config: queueConfig->numOutboundQueues 0x%x\n", queueConfig->numOutboundQueues ));
749 SA_DBG2(("sidump_Q_config: queueConfig->iqHighPriorityProcessingDepth 0x%x\n", queueConfig->iqHighPriorityProcessingDepth ));
750 SA_DBG2(("sidump_Q_config: queueConfig->iqNormalPriorityProcessingDepth 0x%x\n", queueConfig->iqNormalPriorityProcessingDepth ));
751 SA_DBG2(("sidump_Q_config: queueConfig->queueOption 0x%x\n", queueConfig->queueOption ));
752 SA_DBG2(("sidump_Q_config: queueConfig->tgtDeviceRemovedEventQueue 0x%x\n", queueConfig->tgtDeviceRemovedEventQueue ));
753
754 for(x=0;x < queueConfig->numInboundQueues;x++)
755 {
756 SA_DBG2(("sidump_Q_config: queueConfig->inboundQueues[%d].elementCount 0x%x\n",x,queueConfig->inboundQueues[x].elementCount ));
757 SA_DBG2(("sidump_Q_config: queueConfig->inboundQueues[%d].elementSize 0x%x\n",x,queueConfig->inboundQueues[x].elementSize ));
758 }
759
760 for(x=0;x < queueConfig->numOutboundQueues;x++)
761 {
762
763 SA_DBG2(("sidump_Q_config: queueConfig->outboundQueues[%d].elementCount 0x%x\n",x,queueConfig->outboundQueues[x].elementCount ));
764 SA_DBG2(("sidump_Q_config: queueConfig->outboundQueues[%d].elementSize 0x%x\n",x,queueConfig->outboundQueues[x].elementSize ));
765 }
766
767}
768#endif
769
770#ifdef SALL_API_TEST
771/******************************************************************************/
784/*******************************************************************************/
785GLOBAL bit32 saGetLLCounters(
786 agsaRoot_t *agRoot,
787 bit32 counters,
788 agsaLLCountInfo_t *LLCountInfo
789 )
790{
791 agsaLLRoot_t *saRoot = (agsaLLRoot_t *) (agRoot->sdkData);
792 bit32 i;
793
794 for (i = 0; i < LL_COUNTERS; i++)
795 {
796 if (counters & (1 << i))
797 LLCountInfo->arrayIOCounter[i] = saRoot->LLCounters.arrayIOCounter[i];
798 }
799
800 return AGSA_RC_SUCCESS;
801}
802
803/******************************************************************************/
816/*******************************************************************************/
817GLOBAL bit32 saResetLLCounters(
818 agsaRoot_t *agRoot,
819 bit32 counters
820 )
821{
822 agsaLLRoot_t *saRoot = (agsaLLRoot_t *) (agRoot->sdkData);
823 bit32 i;
824
825 for (i = 0; i < LL_COUNTERS; i++)
826 {
827 if (counters & (1 << i))
828 saRoot->LLCounters.arrayIOCounter[i] = 0;
829 }
830
831 return AGSA_RC_SUCCESS;
832}
833#endif
834
bit32 device
Definition: encrypt_ioctl.h:2
#define ossaLogDebugString
Definition: ossa.h:35
#define agNULL
Definition: ostypes.h:151
#define GLOBAL
Definition: ostypes.h:131
unsigned int bit32
Definition: ostypes.h:99
#define agFALSE
Definition: ostypes.h:150
#define FORCEINLINE
Definition: ostypes.h:86
#define agTRUE
Definition: ostypes.h:149
unsigned char bit8
Definition: ostypes.h:97
#define AGSA_RC_SUCCESS
Definition: sa.h:780
This file defines global types.
#define V_Scratchpad_2_Register
Definition: sahwreg.h:105
#define V_Scratchpad_3_Register
Definition: sahwreg.h:106
#define V_Scratchpad_1_Register
Definition: sahwreg.h:104
#define V_Scratchpad_0_Register
Definition: sahwreg.h:103
#define SCRATCH_PAD1_V_ERROR_STATE(ScratchPad1)
Definition: sahwreg.h:296
bit32 gLLDebugLevel
Definition: sainit.c:40
#define smIS_SPCV8009(agr)
Definition: samacro.h:141
#define smIsCfg_V8073(agr)
Definition: samacro.h:126
#define smIS_SPCV8077(agr)
Definition: samacro.h:155
#define AGSAMEM_ELEMENT_READ(pMem, index)
AGSAMEM_ELEMENT_READ macro.
Definition: samacro.h:84
#define smIS_SPCV8071(agr)
Definition: samacro.h:148
#define smIS_spc8001(agr)
Definition: samacro.h:163
#define smIS_ADAP8088(agr)
Definition: samacro.h:144
#define smIS_SFC_AS_V(agr)
Definition: samacro.h:170
#define smIS_SPCV8075(agr)
Definition: samacro.h:153
#define smIsCfg_V8008(agr)
Definition: samacro.h:115
#define smIsCfg_V8006(agr)
Definition: samacro.h:132
#define smIsCfg_V8088(agr)
Definition: samacro.h:120
#define smIsCfg_V8071(agr)
Definition: samacro.h:124
#define smIS_SPCV8073(agr)
Definition: samacro.h:150
#define smIsCfg_V9015(agr)
Definition: samacro.h:133
enum siPrintType_e siPrintType
#define smIS_ADAP8089(agr)
Definition: samacro.h:145
#define SA_DBG1(format)
Definition: samacro.h:200
#define smIS_spc8081(agr)
Definition: samacro.h:164
#define smIS_SPCV8006(agr)
Definition: samacro.h:156
#define smIS_SPCV8070(agr)
Definition: samacro.h:147
#define smIS_SPCV8008(agr)
Definition: samacro.h:140
#define smIS_SPCV9015(agr)
Definition: samacro.h:157
#define smIsCfg_V9060(agr)
Definition: samacro.h:134
#define smIsCfg_V8072(agr)
Definition: samacro.h:125
#define smIsCfg_V8019(agr)
Definition: samacro.h:118
#define SA_DBG2(format)
Definition: samacro.h:201
#define smIS_SFC_AS_SPC(agr)
Definition: samacro.h:168
#define smIS_SPCV8072(agr)
Definition: samacro.h:149
@ SA_8
Definition: samacro.h:213
#define smIS_SPCV8074(agr)
Definition: samacro.h:152
#define smIsCfg_V8018(agr)
Definition: samacro.h:117
#define SA_ASSERT
Definition: samacro.h:209
#define smIsCfg_V8089(agr)
Definition: samacro.h:121
#define smIS_SPCV8076(agr)
Definition: samacro.h:154
#define smIS_SPCV9060(agr)
Definition: samacro.h:158
#define smIS_SPCV8019(agr)
Definition: samacro.h:143
#define smIsCfg_V8025(agr)
Definition: samacro.h:113
#define smIsCfg_V8009(agr)
Definition: samacro.h:116
#define smIS_SPCV8018(agr)
Definition: samacro.h:142
#define smIsCfg_V8070(agr)
Definition: samacro.h:123
GLOBAL FORCEINLINE bit32 ossaHwRegRead(agsaRoot_t *agRoot, bit32 regOffset)
Definition: ossacmnapi.c:3521
GLOBAL void siPrintBuffer(bit32 debugLevel, siPrintType type, char *header, void *a, bit32 length)
GLOBAL bit32 smIsCfg_V_ANY(agsaRoot_t *agRoot)
Definition: sautil.c:412
GLOBAL void siCountActiveIORequestsOnDevice(agsaRoot_t *agRoot, bit32 device)
siCountActiveIORequestsOnDevice count all active IO's
Definition: sautil.c:315
GLOBAL void siClearActiveIORequests(agsaRoot_t *agRoot)
saCountActiveIORequests
Definition: sautil.c:214
GLOBAL bit32 smIS_SPC(agsaRoot_t *agRoot)
Definition: sautil.c:437
GLOBAL bit32 smIS_SPC12V(agsaRoot_t *agRoot)
Definition: sautil.c:470
int siIsHexDigit(char a)
Check for Hex digit.
Definition: sautil.c:56
GLOBAL void siClearActiveIORequestsOnDevice(agsaRoot_t *agRoot, bit32 device)
siCountActiveIORequestsOnDevice count all active IO's
Definition: sautil.c:264
GLOBAL bit32 smIS_SPC6V(agsaRoot_t *agRoot)
Definition: sautil.c:459
__FBSDID("$FreeBSD$")
GLOBAL bit32 smIS_ENCRYPT(agsaRoot_t *agRoot)
Definition: sautil.c:510
GLOBAL bit32 smIS_SPCV_2_IOP(agsaRoot_t *agRoot)
Definition: sautil.c:486
FORCEINLINE void * si_memset(void *s, int c, bit32 n)
memset
Definition: sautil.c:104
GLOBAL bit32 smIS_SPCV(agsaRoot_t *agRoot)
Definition: sautil.c:502
FORCEINLINE void * si_memcpy(void *dst, void *src, bit32 count)
memcopy
Definition: sautil.c:76
GLOBAL void saCountActiveIORequests(agsaRoot_t *agRoot)
saCountActiveIORequests count all active IO's
Definition: sautil.c:370
GLOBAL void siDumpActiveIORequests(agsaRoot_t *agRoot, bit32 count)
siDumpActiveIORequests
Definition: sautil.c:130
GLOBAL bit32 smIS_HIL(agsaRoot_t *agRoot)
Definition: sautil.c:446
data structure stores OS specific and LL specific context
Definition: sa.h:1658
void * sdkData
Definition: sa.h:1660
bit32 DeviceMapIndex
Definition: satypes.h:123
structure describe hardware configuration
Definition: sa.h:2301
bit32 hwInterruptCoalescingControl
Definition: sa.h:2305
agsaPhyAnalogSetupTable_t phyAnalogConfig
Definition: sa.h:2309
bit32 hwOption
Definition: sa.h:2307
bit32 intReassertionOption
Definition: sa.h:2306
bit32 hwInterruptCoalescingTimer
Definition: sa.h:2304
the LL defined IO request descriptor
Definition: satypes.h:132
agsaIORequest_t * pIORequestContext
Definition: satypes.h:134
agsaDeviceDesc_t * pDevice
Definition: satypes.h:135
the LLRoot
Definition: satypes.h:209
bit32 usecsPerTick
Definition: satypes.h:232
agsaMem_t IORequestMem
Definition: satypes.h:213
bit32 ResetStartTick
Definition: satypes.h:235
bit32 timeTick
Definition: satypes.h:234
agsaSwConfig_t swConfig
Definition: satypes.h:252
mpiOCQueue_t outboundQueue[AGSA_MAX_OUTBOUND_Q]
Definition: satypes.h:258
agsaQueueConfig_t QueueConfig
Definition: satypes.h:253
agsaPhyAnalogSetupRegisters_t phyAnalogSetupRegisters[MAX_INDEX]
Definition: sa.h:1770
agsaQueueOutbound_t outboundQueues[AGSA_MAX_OUTBOUND_Q]
Definition: sa.h:2441
bit8 tgtDeviceRemovedEventQueue
Definition: sa.h:2438
agsaQueueInbound_t inboundQueues[AGSA_MAX_INBOUND_Q]
Definition: sa.h:2440
bit8 iqNormalPriorityProcessingDepth
Definition: sa.h:2435
bit8 iqHighPriorityProcessingDepth
Definition: sa.h:2436
bit16 numInboundQueues
Definition: sa.h:2428
bit32 queueOption
Definition: sa.h:2439
bit16 numOutboundQueues
Definition: sa.h:2429
bit8 generalEventQueue
Definition: sa.h:2437
bit32 elementCount
Definition: sa.h:2377
bit32 elementSize
Definition: sa.h:2379
bit32 elementCount
Definition: sa.h:2390
bit32 elementSize
Definition: sa.h:2393
structure describe software configuration
Definition: sa.h:2319
bit32 eventLog1Option
Definition: sa.h:2328
bit32 smpReqTimeout
Definition: sa.h:2323
bit32 max_MSI_InterruptVectors
Definition: sa.h:2334
bit32 fatalErrorInterruptEnable
Definition: sa.h:2331
bit32 legacyInt_X
Definition: sa.h:2336
bit32 eventLog2Option
Definition: sa.h:2329
bit32 maxActiveIOs
Definition: sa.h:2320
bit32 param2
Definition: sa.h:2345
void * param4
Definition: sa.h:2347
bit32 sizefEventLog2
Definition: sa.h:2327
bit32 numDevHandles
Definition: sa.h:2321
bit32 sizefEventLog1
Definition: sa.h:2326
bit32 param1
Definition: sa.h:2344
void * param3
Definition: sa.h:2346
bit32 hostDirectAccessMode
Definition: sa.h:2338
bit32 max_MSIX_InterruptVectors
Definition: sa.h:2335
bit32 hostDirectAccessSupport
Definition: sa.h:2337
bit32 fatalErrorInterruptVector
Definition: sa.h:2333
bit32 numberOfEventRegClients
Definition: sa.h:2324
void * piPointer
Definition: mpi.h:160
bit32 consumerIdx
Definition: mpi.h:163
agsaRoot_t * agRoot
Definition: mpi.h:165
bit32 producerIdx
Definition: mpi.h:162