Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rtm presence detection #202

Merged
merged 3 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
matrix:
build-flags:
- { flags: -DBOARD=afc -DVERSION=3.1 -DBOARD_RTM=8sfp }
- { flags: -DBOARD=afc -DVERSION=4.0}
- { flags: -DBOARD=afc -DVERSION=4.0 -DDEBUG_PROBE=jlink -DOPENOCD_TRANSPORT=swd }
- { flags: -DBOARD=afc -DVERSION=4.0 -DDEBUG_PROBE=cmsis-dap -DOPENOCD_TRANSPORT=swd }
- { flags: -DBOARD=afc -DVERSION=4.0 -DDEBUG_PROBE=digilent_jtag_hs3 -DOPENOCD_TRANSPORT=jtag }
- { flags: -DBOARD=afc -DVERSION=4.0 -DDEBUG_PROBE=xvc -DOPENOCD_TRANSPORT=jtag -DXVC_HOST=host -DXVC_PORT=0000}
- { flags: -DBOARD=afc -DVERSION=4.0 -DBOARD_RTM=lamp}
- { flags: -DBOARD=afc -DVERSION=4.0 -DBOARD_RTM=lamp -DDEBUG_PROBE=jlink -DOPENOCD_TRANSPORT=swd }
- { flags: -DBOARD=afc -DVERSION=4.0 -DBOARD_RTM=lamp -DDEBUG_PROBE=cmsis-dap -DOPENOCD_TRANSPORT=swd }
- { flags: -DBOARD=afc -DVERSION=4.0 -DBOARD_RTM=lamp -DDEBUG_PROBE=digilent_jtag_hs3 -DOPENOCD_TRANSPORT=jtag }
- { flags: -DBOARD=afc -DVERSION=4.0 -DBOARD_RTM=lamp -DDEBUG_PROBE=xvc -DOPENOCD_TRANSPORT=jtag -DXVC_HOST=host -DXVC_PORT=0000}
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion modules/rtm.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void rtm_manage_init( void );
/**
* @brief Check RTM Presence
*
* This function is used to detect the RTM Board presence
* This task use some GPIO pins to detect the RTM Board presence
*
* @return None
*/
Expand Down
6 changes: 6 additions & 0 deletions port/board/afc-v4/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ set(TARGET_MODULES
"IDT_8V54816"
"HPM"
"SYSUTILS"
"RTM"
)

if (NOT DISABLE_WATCHDOG)
Expand All @@ -47,6 +48,11 @@ if (";${TARGET_MODULES};" MATCHES ";PAYLOAD;")
set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_PAYLOAD")
endif()

if (";${TARGET_MODULES};" MATCHES ";RTM;")
set(PROJ_SRCS ${PROJ_SRCS} ${BOARD_PATH}/rtm.c)
set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_RTM")
endif()

if (";${TARGET_MODULES};" MATCHES ";ADC;")
set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_ADC")
endif()
Expand Down
7 changes: 4 additions & 3 deletions port/board/afc-v4/payload.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ extern enum {
#define PAYLOAD_MESSAGE_WARM_RST (1 << 1)
#define PAYLOAD_MESSAGE_REBOOT (1 << 2)
#define PAYLOAD_MESSAGE_QUIESCE (1 << 3)
#define PAYLOAD_MESSAGE_DCDC_PGOOD (1 << 4)
#define PAYLOAD_MESSAGE_DCDC_PGOODn (1 << 5)
#define PAYLOAD_MESSAGE_CLOCK_CONFIG (1 << 6)
#define PAYLOAD_MESSAGE_RTM_ENABLE (1 << 4)
#define PAYLOAD_MESSAGE_DCDC_PGOOD (1 << 5)
#define PAYLOAD_MESSAGE_DCDC_PGOODn (1 << 6)
#define PAYLOAD_MESSAGE_CLOCK_CONFIG (1 << 7)
/**
* @}
*/
Expand Down
10 changes: 9 additions & 1 deletion port/board/rtm-8sfp/rtm_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,15 @@ bool rtm_compatibility_check( void )

if (multirec_hdr[8] == 0x30) {
z3rec_found = true;
break;

/* According to Plataform Management FRU Information Storage Definition v1.0, pg 19
* multirec_hdr[1] >> 7 == 1 indicates the end of list, and for this reason, the loop
* should only break if this condition is satisfied to ensure that we have passed
* through all multirecord area.
*/
if ((multirec_hdr[1] >> 7) == 1) {
break;
}
}
/* Advance the offset pointer, adding the record length field to it */
multirec_off += multirec_hdr[2]+5;
Expand Down
11 changes: 10 additions & 1 deletion port/board/rtm-lamp/rtm_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,18 @@ bool rtm_compatibility_check( void )
/* Read Multirecord header */
fru_read( i, multirec_hdr, multirec_off, 10 );


if (multirec_hdr[8] == 0x30) {
z3rec_found = true;
break;

/* According to Plataform Management FRU Information Storage Definition v1.0, pg 19
* multirec_hdr[1] >> 7 == 1 indicates the end of list, and for this reason, the loop
* should only break if this condition is satisfied to ensure that we have passed
* through all multirecord area.
*/
if ((multirec_hdr[1] >> 7) == 1) {
break;
}
}
/* Advance the offset pointer, adding the record length field to it */
multirec_off += multirec_hdr[2]+5;
Expand Down
Loading