Skip to content

Commit

Permalink
hw/nvram: always set the ESP32-C3 eFuse status to ready/success
Browse files Browse the repository at this point in the history
  • Loading branch information
o-marshmallow committed Oct 19, 2023
1 parent 9f1e6f1 commit 2e51514
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions hw/nvram/esp32c3_efuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@

#define EFUSE_DEBUG 0


#define EFUSE_DEFAULT_FILENAME "qemu_efuses.bin"

/**
* @brief Specify the delay, in us of a a write or read operation, this will only be used to simulate
* the delay the real efuses actually take on real hardware.
Expand Down Expand Up @@ -310,7 +307,7 @@ static void esp32c3_efuse_write(void *opaque, hwaddr addr,
uint32_t *content_32 = (uint32_t*) content_8;

#if EFUSE_DEBUG
info_report("[EFUSE] Writing to 0x%08lx = 0x%08lx (size: %d)\n", addr, value, size);
info_report("[EFUSE] Writing to 0x%08lx = 0x%08lx (size: %d)", addr, value, size);
#endif

/* Check if the programming cmd block is being written */
Expand Down Expand Up @@ -376,7 +373,7 @@ static void esp32c3_efuse_write(void *opaque, hwaddr addr,
case offsetof(ESP32C3EfuseRegs, dbg_erase_all):
{
#if EFUSE_DEBUG
info_report("[EFUSE] erasing all efuses!\n");
info_report("[EFUSE] erasing all efuses!");
#endif
uint32_t size = offsetof(ESP32C3EfuseRegs, rd_repeat_err0) - offsetof(ESP32C3EfuseRegs, rd_wr_dis);
memset(&s->efuses.rd_wr_dis, 0, size);
Expand Down Expand Up @@ -474,6 +471,9 @@ static void esp32c3_efuse_realize(DeviceState *dev, Error **errp)
esp32c3_efuse_reset((DeviceState*) s);
}

/* State machine is ready */
s->efuses.status.state = 1;

return;
error:
error_setg(errp, "%s: %s", __func__, error_msg);
Expand Down

0 comments on commit 2e51514

Please sign in to comment.