/* Sets a general-purpose fuse bit-field with the appropriate erase and write operations.  */
void flashcalw_set_gp_fuse_bitfield(uint32_t pos, uint32_t width, uint64_t value)
/* Sets a general-purpose fuse bit-field with the appropriate erase and write operations.  */
void flashcalw_set_gp_fuse_bitfield(uint32_t pos, uint32_t width, uint64_t value)
{
	uint32_t error_status = 0;
	uint32_t gp_fuse_bit;
	pos &= 0x3F;
	width = Min(width, 64);
	for (gp_fuse_bit = pos; gp_fuse_bit < pos + width;
			gp_fuse_bit++, value >>= 1) {
		flashcalw_set_gp_fuse_bit(gp_fuse_bit, value & 0x01);
		error_status |= flashcalw_error_status;
	}
	flashcalw_error_status = error_status;
}