Skip to content

Commit 130fc56

Browse files
committed
Support dumping more memory pages: SFF8472(A0h & A2h), SFF8436 & SFF8636(Lower Page 00h, Upper Page 00h - 03h), CMIS(Lower Memory, Page 00h - 04h.)
1 parent 00fd837 commit 130fc56

File tree

3 files changed

+38
-13
lines changed

3 files changed

+38
-13
lines changed

drivers/src/bf_qsfp/bf_sfp_comm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ bool bf_sfp_get_dom_support (int port)
184184
*/
185185
bool bf_sfp_is_present (int port)
186186
{
187-
if (port < 0 || port > bf_plt_max_sfp) {
187+
if (port > bf_plt_max_sfp) {
188188
return false;
189189
}
190190
return bf_sfp_info_arr[port].present;
@@ -603,7 +603,7 @@ int bf_sfp_update_cache (int port)
603603

604604
static bf_sfp_info_t *bf_sfp_get_info (int port)
605605
{
606-
if (port < 0 || port > bf_plt_max_sfp) {
606+
if (port > bf_plt_max_sfp) {
607607
return NULL;
608608
}
609609

platforms/asterfusion-bf/include/bf_mav_led.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ typedef void (*led_convert_fun_ptr) (bf_led_condition_t,
6767
/* Light on/off LOC LED */
6868
int bf_pltfm_location_led_set (int on_off);
6969

70-
/* Light on/off LOC LED */
71-
int bf_pltfm_location_led_set (int on_off);
72-
7370
#ifdef INC_PLTFM_UCLI
7471
ucli_node_t *bf_pltfm_led_ucli_node_create (
7572
ucli_node_t *m);

platforms/asterfusion-bf/src/platform_mgr/platform_health_mntr.c

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ static void bf_pltfm_onlp_mntr_transceiver()
410410
int module;
411411
int max_sfp_modules;
412412
int max_qsfp_modules;
413-
uint8_t buf[MAX_QSFP_PAGE_SIZE * 4] = {0};
413+
uint8_t buf[MAX_QSFP_PAGE_SIZE * 6] = {0};
414414
uint32_t flags = bf_pltfm_mgr_ctx()->flags;
415415

416416
struct qsfp_ctx_t *qsfp, *qsfp_ctx;
@@ -491,6 +491,14 @@ static void bf_pltfm_onlp_mntr_transceiver()
491491
}
492492
}
493493

494+
495+
/* Providing limited memory pages should be enough since
496+
the claim is only for DDM information.
497+
SFF8436 & SFF8636: LP00h + UP(00-03)h, 128 * 5
498+
CMIS: LM + P(00-04)h, 128 * 6
499+
Thus we need a buffer of at least size 128 * 6.
500+
By SunZheng, 2025/04/11.
501+
*/
494502
if (bf_qsfp_get_cached_info (i,
495503
QSFP_PAGE0_LOWER, buf)) {
496504
continue;
@@ -500,13 +508,33 @@ static void bf_pltfm_onlp_mntr_transceiver()
500508
buf + MAX_QSFP_PAGE_SIZE)) {
501509
continue;
502510
}
503-
#if 0
504-
if (bf_qsfp_is_cmis (i)) {
511+
if (bf_qsfp_get_cached_info (
512+
i, QSFP_PAGE1,
513+
buf + MAX_QSFP_PAGE_SIZE * 2)) {
505514
continue;
506515
}
507-
#endif
508-
onlp_save (path, (char *)buf,
509-
MAX_QSFP_PAGE_SIZE * 2);
516+
if (bf_qsfp_get_cached_info (
517+
i, QSFP_PAGE2,
518+
buf + MAX_QSFP_PAGE_SIZE * 3)) {
519+
continue;
520+
}
521+
if (bf_qsfp_get_cached_info (
522+
i, QSFP_PAGE3,
523+
buf + MAX_QSFP_PAGE_SIZE * 4)) {
524+
continue;
525+
}
526+
if (bf_qsfp_is_cmis (i)) {
527+
if (bf_qsfp_get_cached_info (
528+
i, QSFP_PAGE4,
529+
buf + MAX_QSFP_PAGE_SIZE * 5)) {
530+
continue;
531+
}
532+
onlp_save (path, (char *)buf,
533+
MAX_QSFP_PAGE_SIZE * 6);
534+
} else {
535+
onlp_save (path, (char *)buf,
536+
MAX_QSFP_PAGE_SIZE * 5);
537+
}
510538
}
511539
sprintf (path, ONLP_LOG_QSFP_PRES_PATH,
512540
"presence");
@@ -573,12 +601,12 @@ static void bf_pltfm_onlp_mntr_transceiver()
573601
continue;
574602
}
575603
if (bf_sfp_get_cached_info (i, 1,
576-
buf + 2 * MAX_QSFP_PAGE_SIZE) ) {
604+
buf + MAX_QSFP_PAGE_SIZE) ) {
577605
continue;
578606
}
579607
/* $ hexdump /var/asterfusion/qsfp_10_eeprom is helpful. */
580608
onlp_save (path, (char *)buf,
581-
MAX_QSFP_PAGE_SIZE * 4);
609+
MAX_QSFP_PAGE_SIZE * 2);
582610
}
583611
sprintf (path, ONLP_LOG_SFP_PRES_PATH,
584612
"presence");

0 commit comments

Comments
 (0)