From 66f876a747bfc601f9d0be8e21d85a4c610a449a Mon Sep 17 00:00:00 2001 From: Irene Date: Tue, 27 Sep 2022 11:03:49 +0800 Subject: [PATCH] fby3.5: rf: Fixed CXL Update Issue The last version of OpenBmc did not support the sector_end flag, so previous bic firmware only assumed the fixed size per file. This submission will use sector_end to determine the end sector of the image for ensuring transmission successfully. Test result: The host could connect the CXL controller directly, and it does not need to do AC_cycle. Signed-off-by: Irene --- meta-facebook/yv35-rf/src/lib/plat_spi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meta-facebook/yv35-rf/src/lib/plat_spi.c b/meta-facebook/yv35-rf/src/lib/plat_spi.c index 79c9d5a22f..33bb9bdeb9 100644 --- a/meta-facebook/yv35-rf/src/lib/plat_spi.c +++ b/meta-facebook/yv35-rf/src/lib/plat_spi.c @@ -79,7 +79,6 @@ static bool control_flash_power(int power_state) uint8_t fw_update_cxl(uint32_t offset, uint16_t msg_len, uint8_t *msg_buf, bool sector_end) { uint8_t ret = FWUPDATE_UPDATE_FAIL; - bool last = ((offset + msg_len) == CXL_UPDATE_MAX_OFFSET); if (offset > CXL_UPDATE_MAX_OFFSET) { return FWUPDATE_OVER_LENGTH; @@ -98,7 +97,7 @@ uint8_t fw_update_cxl(uint32_t offset, uint16_t msg_len, uint8_t *msg_buf, bool ret = fw_update(offset, msg_len, msg_buf, sector_end, DEVSPI_SPI1_CS0); - if (last || ret != FWUPDATE_SUCCESS) { + if (sector_end || ret != FWUPDATE_SUCCESS) { control_flash_power(POWER_OFF); switch_cxl_spi_mux(CXL_FLASH_TO_CXL); }