diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/imx233/debug-imx233.c | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/firmware/target/arm/imx233/debug-imx233.c b/firmware/target/arm/imx233/debug-imx233.c index dc0a9762cc..292cb2e9e2 100644 --- a/firmware/target/arm/imx233/debug-imx233.c +++ b/firmware/target/arm/imx233/debug-imx233.c | |||
@@ -550,17 +550,47 @@ bool dbg_hw_info_pinctrl(void) | |||
550 | } | 550 | } |
551 | } | 551 | } |
552 | 552 | ||
553 | struct | ||
554 | { | ||
555 | const char *name; | ||
556 | volatile uint32_t *addr; | ||
557 | } dbg_ocotp[] = | ||
558 | { | ||
559 | #define E(n,v) { .name = n, .addr = &v } | ||
560 | E("CUST0", HW_OCOTP_CUSTx(0)), E("CUST1", HW_OCOTP_CUSTx(1)), | ||
561 | E("CUST2", HW_OCOTP_CUSTx(2)), E("CUST0", HW_OCOTP_CUSTx(3)), | ||
562 | E("HWCAP0", HW_OCOTP_HWCAPx(0)), E("HWCAP1", HW_OCOTP_HWCAPx(1)), | ||
563 | E("HWCAP2", HW_OCOTP_HWCAPx(2)), E("HWCAP3", HW_OCOTP_HWCAPx(3)), | ||
564 | E("HWCAP4", HW_OCOTP_HWCAPx(4)), E("HWCAP5", HW_OCOTP_HWCAPx(5)), | ||
565 | E("SWCAP", HW_OCOTP_SWCAP), E("CUSTCAP", HW_OCOTP_CUSTCAP), | ||
566 | E("OPS0", HW_OCOTP_OPSx(0)), E("OPS1", HW_OCOTP_OPSx(1)), | ||
567 | E("OPS2", HW_OCOTP_OPSx(2)), E("OPS2", HW_OCOTP_OPSx(3)), | ||
568 | E("UN0", HW_OCOTP_UNx(0)), E("UN1", HW_OCOTP_UNx(1)), | ||
569 | E("UN2", HW_OCOTP_UNx(2)), | ||
570 | E("ROM0", HW_OCOTP_ROMx(0)), E("ROM1", HW_OCOTP_ROMx(1)), | ||
571 | E("ROM2", HW_OCOTP_ROMx(2)), E("ROM3", HW_OCOTP_ROMx(3)), | ||
572 | E("ROM4", HW_OCOTP_ROMx(4)), E("ROM5", HW_OCOTP_ROMx(5)), | ||
573 | E("ROM6", HW_OCOTP_ROMx(6)), E("ROM7", HW_OCOTP_ROMx(7)), | ||
574 | }; | ||
575 | |||
553 | bool dbg_hw_info_ocotp(void) | 576 | bool dbg_hw_info_ocotp(void) |
554 | { | 577 | { |
555 | lcd_setfont(FONT_SYSFIXED); | 578 | lcd_setfont(FONT_SYSFIXED); |
556 | 579 | ||
580 | unsigned top_user = 0; | ||
581 | |||
557 | while(1) | 582 | while(1) |
558 | { | 583 | { |
559 | int button = get_action(CONTEXT_STD, HZ / 10); | 584 | int button = get_action(CONTEXT_STD, HZ / 10); |
560 | switch(button) | 585 | switch(button) |
561 | { | 586 | { |
562 | case ACTION_STD_NEXT: | 587 | case ACTION_STD_NEXT: |
588 | top_user++; | ||
589 | break; | ||
563 | case ACTION_STD_PREV: | 590 | case ACTION_STD_PREV: |
591 | if(top_user > 0) | ||
592 | top_user--; | ||
593 | break; | ||
564 | case ACTION_STD_OK: | 594 | case ACTION_STD_OK: |
565 | case ACTION_STD_MENU: | 595 | case ACTION_STD_MENU: |
566 | lcd_setfont(FONT_UI); | 596 | lcd_setfont(FONT_UI); |
@@ -571,8 +601,21 @@ bool dbg_hw_info_ocotp(void) | |||
571 | } | 601 | } |
572 | 602 | ||
573 | lcd_clear_display(); | 603 | lcd_clear_display(); |
574 | for(int i = 0; i < 4; i++) | 604 | unsigned cur_line = 0; |
575 | lcd_putsf(0, i, "OPS%d=%08x", i, imx233_ocotp_read(&HW_OCOTP_OPSx(i))); | 605 | unsigned last_line = lcd_getheight() / font_get(lcd_getfont())->height; |
606 | unsigned i = 0; | ||
607 | |||
608 | for(i = 0; i < ARRAYLEN(dbg_ocotp); i++) | ||
609 | { | ||
610 | if(i >= top_user && cur_line < last_line) | ||
611 | { | ||
612 | lcd_putsf(0, cur_line, "%s", dbg_ocotp[i].name); | ||
613 | lcd_putsf(8, cur_line++, "%x", imx233_ocotp_read(dbg_ocotp[i].addr)); | ||
614 | } | ||
615 | } | ||
616 | if(i < top_user) | ||
617 | top_user = i - 1; | ||
618 | |||
576 | lcd_update(); | 619 | lcd_update(); |
577 | yield(); | 620 | yield(); |
578 | } | 621 | } |