Lines Matching refs:zldev

31  * @zldev: zl3073x device structure
41 zl3073x_flash_download(struct zl3073x_dev *zldev, const char *component,
50 dev_dbg(zldev->dev, "Downloading %zu bytes to device memory at 0x%0x\n",
57 rc = zl3073x_write_hwreg(zldev, addr,
78 zl3073x_devlink_flash_notify(zldev, "Downloading image",
83 zl3073x_devlink_flash_notify(zldev, "Downloading image", component,
86 dev_dbg(zldev->dev, "%zu bytes downloaded to device memory\n", size);
93 * @zldev: zl3073x device structure
102 zl3073x_flash_error_check(struct zl3073x_dev *zldev,
108 rc = zl3073x_read_u32(zldev, ZL_REG_ERROR_COUNT, &count);
114 rc = zl3073x_read_u32(zldev, ZL_REG_ERROR_CAUSE, &cause);
128 * @zldev: zl3073x device structure
134 zl3073x_flash_wait_ready(struct zl3073x_dev *zldev, unsigned int timeout_ms)
140 dev_dbg(zldev->dev, "Waiting for flashing to be ready\n");
154 rc = zl3073x_read_u8(zldev, ZL_REG_WRITE_FLASH, &value);
171 * @zldev: zl3073x device structure
178 zl3073x_flash_cmd_wait(struct zl3073x_dev *zldev, u32 operation,
186 dev_dbg(zldev->dev, "Sending flash command: 0x%x\n", operation);
188 rc = zl3073x_flash_wait_ready(zldev, ZL_FLASH_PHASE1_TIMEOUT_MS);
193 rc = zl3073x_read_u8(zldev, ZL_REG_WRITE_FLASH, &value);
199 rc = zl3073x_write_u8(zldev, ZL_REG_WRITE_FLASH, value);
204 rc = zl3073x_flash_wait_ready(zldev, ZL_FLASH_PHASE2_TIMEOUT_MS);
208 return zl3073x_flash_error_check(zldev, extack);
213 * @zldev: zl3073x device structure
222 zl3073x_flash_get_sector_size(struct zl3073x_dev *zldev, size_t *sector_size)
227 rc = zl3073x_read_u8(zldev, ZL_REG_FLASH_INFO, &flash_info);
248 * @zldev: zl3073x device structure
265 zl3073x_flash_block(struct zl3073x_dev *zldev, const char *component,
272 rc = zl3073x_flash_download(zldev, component, addr, data, size, extack);
277 rc = zl3073x_write_u32(zldev, ZL_REG_IMAGE_START_ADDR, addr);
282 rc = zl3073x_write_u32(zldev, ZL_REG_IMAGE_SIZE, size);
287 rc = zl3073x_write_u32(zldev, ZL_REG_FLASH_INDEX_WRITE, page);
292 rc = zl3073x_write_u32(zldev, ZL_REG_FILL_PATTERN, U32_MAX);
296 zl3073x_devlink_flash_notify(zldev, "Flashing image", component, 0,
299 dev_dbg(zldev->dev, "Flashing %zu bytes to page %u\n", size, page);
302 rc = zl3073x_flash_cmd_wait(zldev, operation, extack);
306 zl3073x_devlink_flash_notify(zldev, "Flashing image", component, size,
314 * @zldev: zl3073x device structure
330 int zl3073x_flash_sectors(struct zl3073x_dev *zldev, const char *component,
341 rc = zl3073x_flash_get_sector_size(zldev, &sector_size);
365 rc = zl3073x_flash_block(zldev, comp_str,
376 zl3073x_devlink_flash_notify(zldev,
385 * @zldev: zl3073x device structure
398 int zl3073x_flash_page(struct zl3073x_dev *zldev, const char *component,
405 rc = zl3073x_flash_block(zldev, component, ZL_WRITE_FLASH_OP_PAGE, page,
408 zl3073x_devlink_flash_notify(zldev,
417 * @zldev: zl3073x device structure
428 int zl3073x_flash_page_copy(struct zl3073x_dev *zldev, const char *component,
435 rc = zl3073x_write_u32(zldev, ZL_REG_FLASH_INDEX_READ, src_page);
440 rc = zl3073x_write_u32(zldev, ZL_REG_FLASH_INDEX_WRITE, dst_page);
445 rc = zl3073x_flash_cmd_wait(zldev, ZL_WRITE_FLASH_OP_COPY_PAGE, extack);
455 * @zldev: zl3073x device structure
460 zl3073x_flash_mode_verify(struct zl3073x_dev *zldev)
466 rc = zl3073x_read_u32(zldev, ZL_REG_FLASH_HASH, &hash);
470 rc = zl3073x_read_u8(zldev, ZL_REG_FLASH_FAMILY, &family);
474 rc = zl3073x_read_u8(zldev, ZL_REG_FLASH_RELEASE, &release);
478 dev_dbg(zldev->dev,
487 zl3073x_flash_host_ctrl_enable(struct zl3073x_dev *zldev)
493 rc = zl3073x_read_u8(zldev, ZL_REG_HOST_CONTROL, &host_ctrl);
499 return zl3073x_write_u8(zldev, ZL_REG_HOST_CONTROL, host_ctrl);
504 * @zldev: zl3073x device structure
527 int zl3073x_flash_mode_enter(struct zl3073x_dev *zldev, const void *util_ptr,
551 zl3073x_devlink_flash_notify(zldev, "Prepare flash mode", "utility",
555 rc = zl3073x_write_hwreg_seq(zldev, pre_seq, ARRAY_SIZE(pre_seq));
562 rc = zl3073x_flash_download(zldev, "utility", 0x20000000, util_ptr,
570 rc = zl3073x_write_hwreg_seq(zldev, post_seq, ARRAY_SIZE(post_seq));
577 rc = zl3073x_flash_mode_verify(zldev);
584 rc = zl3073x_flash_host_ctrl_enable(zldev);
590 zl3073x_devlink_flash_notify(zldev, "Flash mode enabled", "utility",
596 zl3073x_flash_mode_leave(zldev, extack);
603 * @zldev: zl3073x device structure
617 int zl3073x_flash_mode_leave(struct zl3073x_dev *zldev,
628 zl3073x_devlink_flash_notify(zldev, "Leaving flash mode", "utility",
632 rc = zl3073x_read_u8(zldev, ZL_REG_RESET_STATUS, &reset_status);
640 rc = zl3073x_write_u8(zldev, ZL_REG_RESET_STATUS, reset_status);
647 zl3073x_write_hwreg_seq(zldev, fw_reset_seq, ARRAY_SIZE(fw_reset_seq));
653 rc = zl3073x_read_u8(zldev, ZL_REG_RESET_STATUS, &reset_status);
659 dev_err(zldev->dev,