Lines Matching +full:step +full:- +full:up

1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (C) 2019-2020 Linaro Limited */
12 #include "xhci-trace.h"
13 #include "xhci-pci.h"
54 const u32 *fw, size_t step, bool rom) in renesas_fw_download_image() argument
68 * The hardware does alternate between two 32-bit pages. in renesas_fw_download_image()
73 data0_or_data1 = (step & 1) == 1; in renesas_fw_download_image()
75 /* step+1. Read "Set DATAX" and confirm it is cleared. */ in renesas_fw_download_image()
79 dev_err(&dev->dev, "Read Status failed: %d\n", in renesas_fw_download_image()
89 dev_err(&dev->dev, "Timeout for Set DATAX step: %zd\n", step); in renesas_fw_download_image()
90 return -ETIMEDOUT; in renesas_fw_download_image()
94 * step+2. Write FW data to "DATAX". in renesas_fw_download_image()
99 (__force u32)cpu_to_le32(fw[step])); in renesas_fw_download_image()
101 dev_err(&dev->dev, "Write to DATAX failed: %d\n", in renesas_fw_download_image()
108 /* step+3. Set "Set DATAX". */ in renesas_fw_download_image()
111 dev_err(&dev->dev, "Write config for DATAX failed: %d\n", in renesas_fw_download_image()
131 * The bootrom chips of the big brother have sizes up to 64k, let's in renesas_fw_verify()
135 pr_err("firmware is size %zd is not (4k - 64k).", in renesas_fw_verify()
137 return -EINVAL; in renesas_fw_verify()
143 return -EINVAL; in renesas_fw_verify()
150 return -EINVAL; in renesas_fw_verify()
171 dev_dbg(&pdev->dev, "External ROM exists\n"); in renesas_check_rom()
191 dev_dbg(&pdev->dev, "Found ROM version: %x\n", version); in renesas_check_rom_state()
202 dev_dbg(&pdev->dev, "ROM exists\n"); in renesas_check_rom_state()
214 dev_err(&pdev->dev, "Invalid ROM.."); in renesas_check_rom_state()
219 return -EIO; in renesas_check_rom_state()
247 * to give up. in renesas_fw_check_running()
250 dev_dbg(&pdev->dev, "FW Download Lock is engaged."); in renesas_fw_check_running()
255 dev_err(&pdev->dev, in renesas_fw_check_running()
256 "FW Download Lock is set and FW is not ready. Giving Up."); in renesas_fw_check_running()
257 return -EIO; in renesas_fw_check_running()
262 * with it and it can't be reset, we have to give up too... and in renesas_fw_check_running()
266 dev_err(&pdev->dev, in renesas_fw_check_running()
267 "FW Download Enable is stale. Giving Up (poweroff/reboot needed)."); in renesas_fw_check_running()
268 return -EIO; in renesas_fw_check_running()
274 dev_dbg(&pdev->dev, "FW is not ready/loaded yet."); in renesas_fw_check_running()
280 dev_dbg(&pdev->dev, "FW is ready."); in renesas_fw_check_running()
284 dev_err(&pdev->dev, in renesas_fw_check_running()
285 "hardware is in an error state. Giving up (poweroff/reboot needed)."); in renesas_fw_check_running()
286 return -ENODEV; in renesas_fw_check_running()
289 dev_err(&pdev->dev, in renesas_fw_check_running()
290 "hardware is in an invalid state %lx. Giving up (poweroff/reboot needed).", in renesas_fw_check_running()
292 return -EINVAL; in renesas_fw_check_running()
299 const u32 *fw_data = (const u32 *)fw->data; in renesas_fw_download()
319 /* 1 - 10 follow one step after the other. */ in renesas_fw_download()
320 for (i = 0; i < fw->size / 4; i++) { in renesas_fw_download()
323 dev_err(&pdev->dev, in renesas_fw_download()
324 "Firmware Download Step %zd failed at position %zd bytes with (%d).", in renesas_fw_download()
346 dev_warn(&pdev->dev, "Final Firmware Download step timed out."); in renesas_fw_download()
367 /* Timed out / Error - let's see if we can fix this */ in renesas_fw_download()
371 * we shouldn't end up here. in renesas_fw_download()
378 dev_err(&pdev->dev, "FW Load timedout"); in renesas_fw_download()
379 return -ETIMEDOUT; in renesas_fw_download()
394 dev_dbg(&pdev->dev, "Performing ROM Erase...\n"); in renesas_rom_erase()
398 dev_err(&pdev->dev, "ROM erase, magic word write failed: %d\n", in renesas_rom_erase()
405 dev_err(&pdev->dev, "ROM status read failed: %d\n", in renesas_rom_erase()
412 dev_err(&pdev->dev, "ROM erase set word write failed\n"); in renesas_rom_erase()
430 dev_dbg(&pdev->dev, "Chip erase timedout: %x\n", status); in renesas_rom_erase()
432 dev_dbg(&pdev->dev, "ROM Erase... Done success\n"); in renesas_rom_erase()
437 const u32 *fw_data = (const u32 *)fw->data; in renesas_setup_rom()
459 dev_err(&pdev->dev, in renesas_setup_rom()
465 for (i = 0; i < fw->size / 4; i++) { in renesas_setup_rom()
468 dev_err(&pdev->dev, in renesas_setup_rom()
469 "ROM Download Step %d failed at position %d bytes with (%d)\n", in renesas_setup_rom()
489 dev_err(&pdev->dev, "Final Firmware ROM Download step timed out\n"); in renesas_setup_rom()
504 dev_err(&pdev->dev, "Read ROM status failed:%d\n", in renesas_setup_rom()
510 dev_dbg(&pdev->dev, "Download ROM success\n"); in renesas_setup_rom()
516 dev_err(&pdev->dev, in renesas_setup_rom()
521 dev_dbg(&pdev->dev, "Download to external ROM succeeded\n"); in renesas_setup_rom()
523 /* Last step set Reload */ in renesas_setup_rom()
527 dev_err(&pdev->dev, "Set ROM execute failed: %d\n", in renesas_setup_rom()
545 dev_err(&pdev->dev, "ROM Exec timed out: %x\n", status); in renesas_setup_rom()
570 dev_dbg(&pdev->dev, in renesas_load_fw()
573 dev_dbg(&pdev->dev, in renesas_load_fw()
583 dev_err(&pdev->dev, "firmware failed to download (%d).", err); in renesas_load_fw()
591 (struct xhci_driver_data *)id->driver_data; in renesas_xhci_check_request_fw()
592 const char *fw_name = driver_data->firmware; in renesas_xhci_check_request_fw()
605 err = request_firmware(&fw, fw_name, &pdev->dev); in renesas_xhci_check_request_fw()
608 dev_err(&pdev->dev, "request_firmware failed: %d\n", err); in renesas_xhci_check_request_fw()
612 err = renesas_fw_verify(fw->data, fw->size); in renesas_xhci_check_request_fw()