From fbe5373d3dd779ab3df06c90a556627043f797f3 Mon Sep 17 00:00:00 2001 From: Gustavo de Souza dos Reis Date: Thu, 22 Feb 2024 14:42:21 -0300 Subject: [PATCH 1/3] Correctly check Zone3 compatibility between AFCv4 and RTM-Lamp --- port/board/rtm-lamp/rtm_user.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/port/board/rtm-lamp/rtm_user.c b/port/board/rtm-lamp/rtm_user.c index 6c62910a4..a8bb16add 100644 --- a/port/board/rtm-lamp/rtm_user.c +++ b/port/board/rtm-lamp/rtm_user.c @@ -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; From fb5c3384f6fc47c73d8d650a14a294a7c2d6e0c0 Mon Sep 17 00:00:00 2001 From: Gustavo de Souza dos Reis Date: Thu, 22 Feb 2024 14:43:12 -0300 Subject: [PATCH 2/3] Correctly check Zone3 compatibility between AFCv3 and RTM-8SFP --- port/board/rtm-8sfp/rtm_user.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/port/board/rtm-8sfp/rtm_user.c b/port/board/rtm-8sfp/rtm_user.c index 43ded24fa..7fb7169f0 100644 --- a/port/board/rtm-8sfp/rtm_user.c +++ b/port/board/rtm-8sfp/rtm_user.c @@ -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; From e3c838af6b8574f8d3663e97472b6bfc726de50b Mon Sep 17 00:00:00 2001 From: Gustavo de Souza dos Reis Date: Thu, 22 Feb 2024 14:44:25 -0300 Subject: [PATCH 3/3] Add support to RTM-Lamp with AFCv4 --- .github/workflows/build.yml | 10 +++++----- modules/rtm.h | 2 +- port/board/afc-v4/CMakeLists.txt | 6 ++++++ port/board/afc-v4/payload.h | 7 ++++--- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3064c010..70d31d052 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: diff --git a/modules/rtm.h b/modules/rtm.h index 01e4ded4a..b990d0f4e 100644 --- a/modules/rtm.h +++ b/modules/rtm.h @@ -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 */ diff --git a/port/board/afc-v4/CMakeLists.txt b/port/board/afc-v4/CMakeLists.txt index 5837e8201..26dc10af2 100644 --- a/port/board/afc-v4/CMakeLists.txt +++ b/port/board/afc-v4/CMakeLists.txt @@ -28,6 +28,7 @@ set(TARGET_MODULES "IDT_8V54816" "HPM" "SYSUTILS" + "RTM" ) if (NOT DISABLE_WATCHDOG) @@ -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() diff --git a/port/board/afc-v4/payload.h b/port/board/afc-v4/payload.h index 5ec6dca3b..1523a1aba 100644 --- a/port/board/afc-v4/payload.h +++ b/port/board/afc-v4/payload.h @@ -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) /** * @} */