-
Notifications
You must be signed in to change notification settings - Fork 97
/
prdfMemDqBitmap.C
787 lines (622 loc) · 22.4 KB
/
prdfMemDqBitmap.C
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/diag/prdf/common/plat/mem/prdfMemDqBitmap.C $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
/* implied. See the License for the specific language governing */
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
/** @file prdfMemDqBitmap.C */
#include <prdfMemDqBitmap.H>
#include <UtilHash.H>
#include <iipServiceDataCollector.h>
#include <prdfParserUtils.H>
namespace PRDF
{
using namespace PlatServices;
using namespace PARSERUTILS;
using namespace TARGETING;
using namespace fapi2; // for spare dram config
bool MemDqBitmap::badDqs() const
{
bool o_badDqs = false;
size_t maxPorts = getNumPorts();
for ( uint32_t i = 0; i < maxPorts; i++ )
{
for ( uint32_t j = 0; j < DQ_BITMAP::BITMAP_SIZE; j++ )
{
if ( 0 != iv_data.at(i).bitmap[j] )
{
o_badDqs = true;
break;
}
}
if ( o_badDqs ) break;
}
return o_badDqs;
}
//------------------------------------------------------------------------------
uint32_t MemDqBitmap::badDqs( bool & o_badDqs, uint8_t i_portSlct ) const
{
#define PRDF_FUNC "[MemDqBitmap::badDqs] "
uint32_t o_rc = SUCCESS;
o_badDqs = false;
do
{
size_t maxPorts = getNumPorts();
if ( maxPorts <= i_portSlct )
{
PRDF_ERR(PRDF_FUNC "Invalid parameter: i_portSlct=%d", i_portSlct);
o_rc = FAIL; break;
}
for ( uint32_t j = 0; j < DQ_BITMAP::BITMAP_SIZE; j++ )
{
if ( 0 != iv_data.at(i_portSlct).bitmap[j] )
{
o_badDqs = true;
break;
}
}
} while (0);
return o_rc;
#undef PRDF_FUNC
}
//------------------------------------------------------------------------------
uint32_t MemDqBitmap::setDq( uint8_t i_dq, uint8_t i_portSlct )
{
#define PRDF_FUNC "[MemDqBitmap::setDq] "
uint32_t o_rc = SUCCESS;
do
{
if ( DQS_PER_DIMM <= i_dq )
{
PRDF_ERR( PRDF_FUNC "Invalid parameter: i_dq=%d", i_dq );
o_rc = FAIL; break;
}
size_t maxPorts = getNumPorts();
if ( maxPorts <= i_portSlct )
{
PRDF_ERR(PRDF_FUNC "Invalid parameter: i_portSlct=%d", i_portSlct);
o_rc = FAIL; break;
}
uint8_t byteIdx = i_dq / DQS_PER_BYTE;
uint8_t bitIdx = i_dq % DQS_PER_BYTE;
uint32_t shift = (DQS_PER_BYTE-1) - bitIdx; // 0-7
iv_data[i_portSlct].bitmap[byteIdx] |= 0x01 << shift;
} while (0);
return o_rc;
#undef PRDF_FUNC
}
//------------------------------------------------------------------------------
uint32_t MemDqBitmap::setSymbol( const MemSymbol & i_symbol, uint8_t i_pins )
{
#define PRDF_FUNC "[MemDqBitmap::setSymbol] "
uint32_t o_rc = SUCCESS;
do
{
uint8_t portSlct, byteIdx, bitIdx;
o_rc = getPortByteBitIdx( i_symbol, portSlct, byteIdx, bitIdx );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getPortByteBitIdx() failed" );
break;
}
uint32_t shift = (DQS_PER_BYTE-1) - bitIdx;
// The number of dqs per symbol is equivalent to the ports we have here
size_t dqsPerSym = getNumPorts();
// Calculate pin mask -> (2^dqsPerSym)-1
uint8_t pinMask = 2;
for ( uint8_t i = 1; i < dqsPerSym; i++ ) {pinMask *= 2;}
pinMask -= 1;
i_pins &= pinMask; // Limit to the number of dqs per symbols
shift = (shift / dqsPerSym) * dqsPerSym;
iv_data[portSlct].bitmap[byteIdx] |= i_pins << shift;
} while (0);
return o_rc;
#undef PRDF_FUNC
}
//------------------------------------------------------------------------------
uint32_t MemDqBitmap::setDram( const MemSymbol & i_symbol, uint8_t i_pins )
{
#define PRDF_FUNC "[MemDqBitmap::setDram] "
uint32_t o_rc = SUCCESS;
do
{
uint8_t portSlct, byteIdx, bitIdx;
o_rc = getPortByteBitIdx( i_symbol, portSlct, byteIdx, bitIdx );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getPortByteBitIdx() failed" );
break;
}
if ( iv_x4Dram )
{
i_pins &= 0xf; // limit to 4 bits
uint32_t shift = (DQS_PER_BYTE-1) - bitIdx;
shift = (shift / DQS_PER_NIBBLE) * DQS_PER_NIBBLE; // 0,4
iv_data[portSlct].bitmap[byteIdx] |= i_pins << shift;
}
else
{
i_pins &= 0xff; // limit to 8 bits
iv_data[portSlct].bitmap[byteIdx] |= i_pins;
}
} while (0);
return o_rc;
#undef PRDF_FUNC
}
//------------------------------------------------------------------------------
uint32_t MemDqBitmap::clearDram( const MemSymbol & i_symbol, uint8_t i_pins )
{
#define PRDF_FUNC "[MemDqBitmap::clearDram] "
uint32_t o_rc = SUCCESS;
do
{
uint8_t portSlct, byteIdx, bitIdx;
o_rc = getPortByteBitIdx( i_symbol, portSlct, byteIdx, bitIdx );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getPortByteBitIdx() failed" );
break;
}
if ( iv_x4Dram )
{
i_pins &= 0xf; // limit to 4 bits
uint32_t shift = (DQS_PER_BYTE-1) - bitIdx;
shift = (shift / DQS_PER_NIBBLE) * DQS_PER_NIBBLE; // 0,4
iv_data[portSlct].bitmap[byteIdx] &= ~(i_pins << shift);
}
else
{
i_pins &= 0xff; // limit to 8 bits
iv_data[portSlct].bitmap[byteIdx] &= ~(i_pins);
}
} while (0);
return o_rc;
#undef PRDF_FUNC
}
//------------------------------------------------------------------------------
void MemDqBitmap::clearBitmap()
{
size_t maxPorts = getNumPorts();
for ( uint32_t i = 0; i < maxPorts; i++ )
{
memset( iv_data[i].bitmap, 0x00, sizeof(iv_data[i].bitmap) );
}
}
//------------------------------------------------------------------------------
void MemDqBitmap::getCaptureData( CaptureData & o_cd ) const
{
uint8_t rank = iv_rank.getMaster();
size_t sz_rank = sizeof(rank);
size_t sz_capData = sz_rank + sizeof(iv_data);
// Adjust the size for endianness.
const size_t sz_word = sizeof(CPU_WORD);
sz_capData = ((sz_capData + sz_word-1) / sz_word) * sz_word;
uint8_t capData[sz_capData];
memset( capData, 0x00, sz_capData );
capData[0] = rank;
uint8_t numPorts = getNumPorts();
uint8_t idx = 1;
for ( uint8_t ps = 0; ps < numPorts; ps++ )
{
memcpy( &capData[idx], getData(ps), sizeof(capData[idx]) );
idx += DQ_BITMAP::BITMAP_SIZE;
}
// Fix endianness issues with non PPC machines.
for ( uint32_t i = 0; i < (sz_capData/sz_word); i++ )
((CPU_WORD*)capData)[i] = htonl(((CPU_WORD*)capData)[i]);
BitString bs ( sz_capData*8, (CPU_WORD *) &capData );
o_cd.Add( iv_trgt, Util::hashString("BAD_DQ_BITMAP"), bs );
}
//------------------------------------------------------------------------------
uint32_t MemDqBitmap::getPortByteBitIdx( const MemSymbol & i_symbol,
uint8_t & o_portSlct,
uint8_t & o_byteIdx,
uint8_t & o_bitIdx ) const
{
#define PRDF_FUNC "[MemDqBitmap::getPortByteBitIdx] "
uint32_t o_rc = SUCCESS;
do
{
if ( !i_symbol.isValid() )
{
PRDF_ERR( PRDF_FUNC "i_symbol is invalid" );
o_rc = FAIL; break;
}
o_portSlct = i_symbol.getPortSlct();
o_byteIdx = i_symbol.getDq() / DQS_PER_BYTE;
o_bitIdx = i_symbol.getDq() % DQS_PER_BYTE;
if ( i_symbol.isDramSpared() )
{
o_byteIdx = DRAM_SPARE_BYTE;
}
else if ( i_symbol.isEccSpared() )
{
o_portSlct = ECC_SPARE_PORT;
o_byteIdx = ECC_SPARE_BYTE;
// x4 ECC spare is the second nibble of the byte.
o_bitIdx = (o_bitIdx % DQS_PER_NIBBLE) + DQS_PER_NIBBLE;
}
} while (0);
return o_rc;
#undef PRDF_FUNC
}
//------------------------------------------------------------------------------
uint32_t MemDqBitmap::isChipMark( const MemSymbol & i_symbol, bool & o_cm )
{
#define PRDF_FUNC "[MemDqBitmap::isChipMark] "
uint32_t o_rc = SUCCESS;
o_cm = false;
do
{
// If 2 or more symbols are set in a nibble, the chip mark is present.
uint8_t portSlct, byteIdx, bitIdx;
o_rc = getPortByteBitIdx( i_symbol, portSlct, byteIdx, bitIdx );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getPortByteBitIdx() failed" );
break;
}
uint8_t cmData = iv_data[portSlct].bitmap[byteIdx];
// x4 Drams
if ( iv_x4Dram )
{
// Find which nibble to check.
uint8_t nibble;
if ( bitIdx < 4 )
nibble = ( (cmData>>4) & 0xf );
else
nibble = cmData & 0xf;
// This nibble must have 2 or more symbols set.
o_cm = ( (0x0 != nibble) &&
(0x8 != nibble) &&
(0x4 != nibble) &&
(0x2 != nibble) &&
(0x1 != nibble) );
}
// x8 Drams
else
{
uint32_t count = 0;
while ( 0 != cmData )
{
if ( 0 != (cmData & 0x3) )
count++;
cmData >>= 2;
}
o_cm = ( count >= 2 );
}
} while (0);
return o_rc;
#undef PRDF_FUNC
}
//------------------------------------------------------------------------------
std::vector<MemSymbol> MemDqBitmap::getSymbolList( uint8_t i_portSlct )
{
#define PRDF_FUNC "[MemDqBitmap::getSymbolList] "
std::vector<MemSymbol> o_symbolList;
size_t maxPorts = getNumPorts();
// The number of dqs per symbol is equivalent to the ports we have here
size_t dqsPerSymbol = getNumPorts();
uint8_t symbolsPerByte = SYMBOLS_PER_RANK/(BYTES_PER_DIMM*dqsPerSymbol);
// Calculate bit mask -> (2^dqsPerSym)-1
uint8_t bitMask = 2;
for ( uint8_t i = 1; i < dqsPerSymbol; i++ ) {bitMask *= 2;}
bitMask -= 1;
// loop through all ports
for ( uint8_t port = 0; port < maxPorts; port++ )
{
// loop through each byte in the bitmap
for ( uint8_t byte = 0; byte < DQ_BITMAP::BITMAP_SIZE; byte++ )
{
// loop through each symbol index
for ( uint8_t symIdx = 0; symIdx < symbolsPerByte; symIdx++ )
{
uint8_t shift = ((symbolsPerByte - 1) - symIdx) * dqsPerSymbol;
// if the bit/bit pair is active
if ( ((iv_data[port].bitmap[byte] >> shift) & bitMask) != 0 )
{
// get the dq
uint8_t dq = (byte * DQS_PER_BYTE)+(symIdx * dqsPerSymbol);
// convert the dq to symbol
uint8_t symbol = SYMBOLS_PER_RANK;
TYPE trgtType = getTargetType( iv_trgt );
switch( trgtType )
{
case TYPE_MCA:
symbol = dq2Symbol<TYPE_MCA>( dq, i_portSlct );
break;
case TYPE_MBA:
symbol = dq2Symbol<TYPE_MBA>( dq, i_portSlct );
break;
case TYPE_MEM_PORT:
symbol = dq2Symbol<TYPE_MEM_PORT>( dq, i_portSlct );
break;
case TYPE_OCMB_CHIP:
symbol = dq2Symbol<TYPE_OCMB_CHIP>(dq, i_portSlct);
break;
default:
PRDF_ERR( "Invalid trgt type" );
PRDF_ASSERT( false );
break;
}
// add symbol to output
o_symbolList.push_back( MemSymbol::fromSymbol(iv_trgt,
iv_rank, symbol) );
}
}
}
}
return o_symbolList;
#undef PRDF_FUNC
}
//------------------------------------------------------------------------------
uint32_t __getSpareInfo( TargetHandle_t i_trgt, MemRank i_rank,
uint8_t i_portSlct, uint8_t & o_spareConfig, uint8_t & o_noSpare,
uint8_t & o_lowNibble, uint8_t & o_highNibble, bool & o_spareSupported )
{
#define PRDF_FUNC "[__getSpareInfo] "
uint32_t o_rc = SUCCESS;
o_spareSupported = true;
do
{
TYPE trgtType = getTargetType( i_trgt );
// Spares not supported on MCA
if ( TYPE_MCA == trgtType )
{
o_spareSupported = false;
}
// Centaur/MBA case
else if ( TYPE_MBA == trgtType )
{
o_noSpare = CEN_VPD_DIMM_SPARE_NO_SPARE;
o_lowNibble = CEN_VPD_DIMM_SPARE_LOW_NIBBLE;
o_highNibble = CEN_VPD_DIMM_SPARE_HIGH_NIBBLE;
o_spareConfig = CEN_VPD_DIMM_SPARE_NO_SPARE;
o_rc = getDimmSpareConfig<TYPE_MBA>( i_trgt, i_rank, i_portSlct,
o_spareConfig );
}
// Generic/MEM_PORT case
else
{
o_noSpare = MEM_EFF_DIMM_SPARE_NO_SPARE;
o_lowNibble = MEM_EFF_DIMM_SPARE_LOW_NIBBLE;
o_highNibble = MEM_EFF_DIMM_SPARE_HIGH_NIBBLE;
o_spareConfig = MEM_EFF_DIMM_SPARE_NO_SPARE;
TargetHandle_t memPort = getConnectedChild( i_trgt, TYPE_MEM_PORT,
i_portSlct );
o_rc = getDimmSpareConfig<TYPE_MEM_PORT>( memPort, i_rank,
i_portSlct, o_spareConfig );
}
if( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getDimmSpareConfig() failed" );
break;
}
}while(0);
return o_rc;
#undef PRDF_FUNC
}
//------------------------------------------------------------------------------
uint32_t MemDqBitmap::isSpareAvailable( uint8_t i_portSlct, bool & o_dramSpare,
bool & o_eccSpare )
{
#define PRDF_FUNC "[MemDqBitmap::isSpareAvailable] "
uint32_t o_rc = SUCCESS;
o_dramSpare = false;
o_eccSpare = false;
do
{
// Check to make sure the portSlct is valid
size_t maxPorts = getNumPorts();
if ( maxPorts <= i_portSlct )
{
PRDF_ERR( PRDF_FUNC "Invalid parameter: i_portSlct=%d", i_portSlct);
o_rc = FAIL; break;
}
uint8_t spareConfig, noSpare, lowNibble, highNibble;
bool spareSupported = true;
o_rc = __getSpareInfo( iv_trgt, iv_rank, i_portSlct, spareConfig,
noSpare, lowNibble, highNibble, spareSupported );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "__getSpareInfo failed" );
break;
}
// Spare is not available.
if ( !spareSupported )
{
o_dramSpare = false;
o_eccSpare = false;
break;
}
uint8_t spareDqBits = iv_data.at(i_portSlct).bitmap[DRAM_SPARE_BYTE];
if ( iv_x4Dram )
{
// Spare is on the lower nibble
if ( lowNibble == spareConfig )
{
o_dramSpare = ( 0 == ( spareDqBits & 0xf0 ) );
}
// Spare is on the higher nibble
else if ( highNibble == spareConfig )
{
o_dramSpare = ( 0 == ( spareDqBits & 0x0f ) );
}
// Check for ECC spare
uint8_t eccDqBits =
iv_data.at(ECC_SPARE_PORT).bitmap[ECC_SPARE_BYTE];
o_eccSpare = ( 0 == (eccDqBits & 0x0f) );
}
else
{
o_dramSpare = ( 0 == spareDqBits );
}
} while (0);
return o_rc;
#undef PRDF_FUNC
}
//------------------------------------------------------------------------------
uint32_t MemDqBitmap::setDramSpare( uint8_t i_portSlct, uint8_t i_pins )
{
#define PRDF_FUNC "[MemDqBitmap::setDramSpare] "
uint32_t o_rc = SUCCESS;
do
{
// Check to make sure the portSlct is valid
size_t maxPorts = getNumPorts();
if ( maxPorts <= i_portSlct )
{
PRDF_ERR( PRDF_FUNC "Invalid parameter: i_portSlct=%d", i_portSlct);
o_rc = FAIL; break;
}
uint8_t spareConfig, noSpare, lowNibble, highNibble;
bool spareSupported = true;
o_rc = __getSpareInfo( iv_trgt, iv_rank, i_portSlct, spareConfig,
noSpare, lowNibble, highNibble, spareSupported );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "__getSpareInfo failed" );
break;
}
if ( noSpare == spareConfig || !spareSupported )
{
PRDF_ERR( PRDF_FUNC "DRAM Spare is not available" );
o_rc = FAIL; break;
}
if ( iv_x4Dram )
{
i_pins &= 0xf; // limit to 4 bits
if ( lowNibble == spareConfig )
{
i_pins = i_pins << DQS_PER_NIBBLE;
}
iv_data[i_portSlct].bitmap[DRAM_SPARE_BYTE] |= i_pins;
}
else
{
i_pins &= 0xff; // limit to 8 bits
iv_data[i_portSlct].bitmap[DRAM_SPARE_BYTE] |= i_pins;
}
} while (0);
return o_rc;
#undef PRDF_FUNC
}
//------------------------------------------------------------------------------
uint32_t MemDqBitmap::setEccSpare( uint8_t i_pins )
{
#define PRDF_FUNC "[MemDqBitmap::setEccSpare] "
uint32_t o_rc = SUCCESS;
do
{
// Use __getSpareInfo just to check if spares are supported or not
uint8_t spareConfig, noSpare, lowNibble, highNibble;
bool spareSupported = true;
o_rc = __getSpareInfo( iv_trgt, iv_rank, 0, spareConfig,
noSpare, lowNibble, highNibble, spareSupported );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "__getSpareInfo failed" );
break;
}
// Break out if spares are not supported
if ( !spareSupported ) break;
if ( !iv_x4Dram )
{
PRDF_ERR( PRDF_FUNC "0x%08x does not support x4 ECC spare",
getHuid(iv_trgt) );
o_rc = FAIL; break;
}
i_pins &= 0xf; // limit to 4 bits
iv_data[ECC_SPARE_PORT].bitmap[ECC_SPARE_BYTE] |= i_pins;
} while( 0 );
return o_rc;
#undef PRDF_FUNC
}
//##############################################################################
// Utility Functions
//##############################################################################
uint32_t setDramInVpd( TargetHandle_t i_trgt, const MemRank & i_rank,
MemSymbol i_symbol )
{
#define PRDF_FUNC "[MemDqBitmap::__setDramInVpd] "
uint32_t o_rc = SUCCESS;
do
{
MemDqBitmap dqBitmap;
o_rc = getBadDqBitmap( i_trgt, i_rank, dqBitmap );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getBadDqBitmap(0x%08x, 0x%02x) failed.",
getHuid(i_trgt), i_rank.getKey() );
break;
}
o_rc = dqBitmap.setDram( i_symbol );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "setDram() failed." );
break;
}
o_rc = setBadDqBitmap( i_trgt, i_rank, dqBitmap );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "setBadDqBitmap(0x%08x, 0x%02x) failed.",
getHuid(i_trgt), i_rank.getKey() );
break;
}
}while(0);
return o_rc;
#undef PRDF_FUNC
}
//------------------------------------------------------------------------------
uint32_t clearDramInVpd( TargetHandle_t i_trgt, const MemRank & i_rank,
MemSymbol i_symbol )
{
#define PRDF_FUNC "[MemDqBitmap::__clearDramInVpd] "
uint32_t o_rc = SUCCESS;
do
{
MemDqBitmap dqBitmap;
o_rc = getBadDqBitmap( i_trgt, i_rank, dqBitmap );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getBadDqBitmap(0x%08x, 0x%02x) failed.",
getHuid(i_trgt), i_rank.getKey() );
break;
}
o_rc = dqBitmap.clearDram( i_symbol );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "clearDram() failed." );
break;
}
o_rc = setBadDqBitmap( i_trgt, i_rank, dqBitmap );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "setBadDqBitmap(0x%08x, 0x%02x) failed.",
getHuid(i_trgt), i_rank.getKey() );
break;
}
}while(0);
return o_rc;
#undef PRDF_FUNC
}
//------------------------------------------------------------------------------
} // end namespace PRDF