40
40
#endif
41
41
namespace fapi2
42
42
{
43
+
44
+ // POZ SBE will convert its plat target to the structure, sbe_target_info
45
+ // before streaming to HB/BMC/FSP as part of HWP FFDC. Platfrom will try
46
+ // to create the target based on this strucuture to guard, callout etc.
47
+
48
+ union sbe_target_info
49
+ {
50
+ uint64_t value;
51
+ struct
52
+ {
53
+ uint64_t logtargetType: 8 ; // used for target type
54
+ uint64_t : 40 ; // for future use
55
+ union
56
+ {
57
+ uint64_t instanceID: 16 ;
58
+ struct
59
+ {
60
+ uint64_t mcast_type: 3 ;
61
+ uint64_t mcast_group: 3 ;
62
+ uint64_t : 10 ;
63
+ } __attribute__ ((packed));
64
+ } __attribute__((packed));
65
+ } __attribute__ ((packed));
66
+ };
67
+
43
68
// For HW callout - Clock position undefined to 0xFF(default)
44
69
#define CLOCK_POS_UNDEF 0xFF
45
70
#define AVSBUS_UNDEF 0xFF
@@ -358,15 +383,22 @@ inline fapi2::ffdc_t getFfdcData(sbeFfdc_t& i_sbeFfdc,
358
383
359
384
if (l_ffdc.size () == EI_FFDC_SIZE_TARGET)
360
385
{
361
- #ifdef FAPI2_ENABLE_PLATFORM_GET_TARGET
362
386
387
+ #ifndef FAPI2_ENABLE_PLATFORM_GET_TARGET
388
+ // Circumvent warning: unused parameter 'i_sbeChip_instance' [-Wunused-parameter]
389
+ static_cast <void >(i_sbeChip_instance);
390
+ static_cast <void >(i_sbeChipTargetType);
391
+ #else
363
392
uint64_t targetData = i_sbeFfdc.data ;
393
+ // get a fapi target for the passed in chip instance
394
+ fapi2::Target<TARGET_TYPE_ANY_POZ_CHIP> l_sbeChip;
364
395
365
396
// For P10, target data will be in format
366
397
// 0:47 = target type
367
398
// 48:63 = instance
368
399
if (i_sbeChipTargetType == TARGET_TYPE_PROC_CHIP)
369
400
{
401
+ l_sbeChip = getTarget<TARGET_TYPE_PROC_CHIP>(i_sbeChip_instance);
370
402
fapi2::TargetType type = static_cast <fapi2::TargetType>(targetData >> 16 );
371
403
372
404
// sbe returns the target instance based on processor scope,
@@ -392,30 +424,36 @@ inline fapi2::ffdc_t getFfdcData(sbeFfdc_t& i_sbeFfdc,
392
424
}
393
425
}
394
426
}
395
- // For Odyssey, target data will be in format:
396
- // 0:7 = log target type
397
- // 8:47 = reserved
398
- // 48:63 = instance
427
+ // For Odyssey, target data will be in format of sbe_target_info, defined above.
399
428
else
400
429
{
401
- // Pull log target type and instance out of the target data.
402
- LogTargetType l_log_type = static_cast <fapi2::LogTargetType>(targetData >> 56 );
403
- uint16_t instance = static_cast <uint16_t >(targetData & 0xFFFF );
404
- // Convert log target type to TargetType
405
- TargetType l_type = logToTargetType (l_log_type);
430
+ sbe_target_info poztargetData = { .value = targetData };
406
431
407
- uint16_t fapi_pos = convertSbeTargInstanceToFapiPos (l_type,
408
- instance,
409
- i_sbeChipTargetType,
410
- i_sbeChip_instance);
411
-
412
- if ( fapi_pos == INVALID_FAPI_POS )
432
+ if (poztargetData.logtargetType != LOG_TARGET_TYPE_MULTICAST)
413
433
{
414
- invalid_data = true ;
434
+ // Convert log target type to TargetType
435
+ TargetType l_type = logToTargetType (static_cast <fapi2::LogTargetType>(poztargetData.logtargetType ));
436
+
437
+ uint16_t fapi_pos = convertSbeTargInstanceToFapiPos (l_type,
438
+ poztargetData.instanceID ,
439
+ i_sbeChipTargetType,
440
+ i_sbeChip_instance);
441
+
442
+ if ( fapi_pos == INVALID_FAPI_POS )
443
+ {
444
+ invalid_data = true ;
445
+ }
446
+ else
447
+ {
448
+ l_ffdc.ptr () = static_cast <void *>(getTarget<TARGET_TYPE_ALL>(l_type, fapi_pos));
449
+ }
415
450
}
416
451
else
417
452
{
418
- l_ffdc.ptr () = static_cast <void *>(getTarget<TARGET_TYPE_ALL>(l_type, fapi_pos));
453
+ // TARGET TYPE MULTICAST
454
+ // TODO : getTarget has to be enhanced to create the MULTICAST target
455
+ // from the multicast group and multicast ID.
456
+ invalid_data = true ;
419
457
}
420
458
421
459
}
0 commit comments