Lines Matching +full:- +full:- +full:retry +full:- +full:failed

4  * SPDX-License-Identifier: Apache-2.0
28 /* EEPROM Execute Register - Transfer size bit position */
31 /* EEPROM Execute Register - Commands */
37 /* EEPROM Execute Register - Address mask */
84 regs->execute = temp; in eeprom_xec_execute_reg_set()
96 *destination_ptr = regs->buffer[count]; in eeprom_xec_data_buffer_read()
112 regs->buffer[count] = *source_ptr; in eeprom_xec_data_buffer_write()
128 LOG_ERR("XEC EEPROM retry count exceeded"); in eeprom_xec_wait_transfer_compl()
133 sts = XEC_EEPROM_STS_TRANSFER_COMPL & regs->status; in eeprom_xec_wait_transfer_compl()
140 regs->status = XEC_EEPROM_STS_TRANSFER_COMPL; in eeprom_xec_wait_transfer_compl()
151 LOG_ERR("XEC EEPROM retry count exceeded"); in eeprom_xec_wait_write_compl()
155 regs->buffer[0] = 0; in eeprom_xec_wait_write_compl()
158 regs->execute = XEC_EEPROM_EXC_CMD_READ_STS; in eeprom_xec_wait_write_compl()
162 sts = regs->buffer[0] & (XEC_EEPROM_STS_BYTE_WIP | in eeprom_xec_wait_write_compl()
195 rem_bytes = (XEC_EEPROM_PAGE_SIZE - sz); in eeprom_xec_data_write_32_bytes()
209 len = (len - rem_bytes); in eeprom_xec_data_write_32_bytes()
227 const struct eeprom_xec_config *config = dev->config; in eeprom_xec_read()
228 struct eeprom_xec_data * const data = dev->data; in eeprom_xec_read()
229 struct eeprom_xec_regs * const regs = config->regs; in eeprom_xec_read()
238 if ((offset + len) > config->size) { in eeprom_xec_read()
240 return -EINVAL; in eeprom_xec_read()
243 k_mutex_lock(&data->lock_mtx, K_FOREVER); in eeprom_xec_read()
248 if ((len-chunk_idx) < XEC_EEPROM_TRANSFER_SIZE_READ) { in eeprom_xec_read()
249 chunk_size = (len-chunk_idx); in eeprom_xec_read()
255 k_mutex_unlock(&data->lock_mtx); in eeprom_xec_read()
263 const struct eeprom_xec_config *config = dev->config; in eeprom_xec_write()
264 struct eeprom_xec_data * const data = dev->data; in eeprom_xec_write()
265 struct eeprom_xec_regs * const regs = config->regs; in eeprom_xec_write()
274 if ((offset + len) > config->size) { in eeprom_xec_write()
276 return -EINVAL; in eeprom_xec_write()
279 k_mutex_lock(&data->lock_mtx, K_FOREVER); in eeprom_xec_write()
284 if ((len-chunk_idx) < XEC_EEPROM_TRANSFER_SIZE_WRITE) { in eeprom_xec_write()
285 chunk_size = (len-chunk_idx); in eeprom_xec_write()
292 k_mutex_unlock(&data->lock_mtx); in eeprom_xec_write()
299 const struct eeprom_xec_config *config = dev->config; in eeprom_xec_size()
301 return config->size; in eeprom_xec_size()
307 const struct eeprom_xec_config *const devcfg = dev->config; in eeprom_xec_pm_action()
308 struct eeprom_xec_regs * const regs = devcfg->regs; in eeprom_xec_pm_action()
313 ret = pinctrl_apply_state(devcfg->pcfg, PINCTRL_STATE_DEFAULT); in eeprom_xec_pm_action()
315 LOG_ERR("XEC EEPROM pinctrl setup failed (%d)", ret); in eeprom_xec_pm_action()
318 regs->mode |= XEC_EEPROM_MODE_ACTIVATE; in eeprom_xec_pm_action()
322 regs->mode &= (~XEC_EEPROM_MODE_ACTIVATE); in eeprom_xec_pm_action()
323 ret = pinctrl_apply_state(devcfg->pcfg, PINCTRL_STATE_SLEEP); in eeprom_xec_pm_action()
324 /* pinctrl-1 does not exist. */ in eeprom_xec_pm_action()
325 if (ret == -ENOENT) { in eeprom_xec_pm_action()
330 ret = -ENOTSUP; in eeprom_xec_pm_action()
339 const struct eeprom_xec_config *config = dev->config; in eeprom_xec_init()
340 struct eeprom_xec_data * const data = dev->data; in eeprom_xec_init()
341 struct eeprom_xec_regs * const regs = config->regs; in eeprom_xec_init()
343 k_mutex_init(&data->lock_mtx); in eeprom_xec_init()
345 int ret = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); in eeprom_xec_init()
348 LOG_ERR("XEC EEPROM pinctrl init failed (%d)", ret); in eeprom_xec_init()
352 regs->mode |= XEC_EEPROM_MODE_ACTIVATE; in eeprom_xec_init()