Lines Matching +full:firmware +full:- +full:initialized
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Firmware loading.
5 * Copyright (c) 2017-2020, Silicon Laboratories, Inc.
6 * Copyright (c) 2010, ST-Ericsson
8 #include <linux/firmware.h>
67 [ERR_AES_CTRL_KEY] = "AES control key not initialized",
68 [ERR_ECC_PUB_KEY] = "ECC public key not initialized",
69 [ERR_MAC_KEY] = "MAC key not initialized",
78 * NOTE: it may also be possible to use 'pages' from struct firmware and avoid bounce buffer
88 return -ENOMEM; in wfx_sram_write_dma_safe()
99 const struct firmware **fw, int *file_offset) in get_firmware()
107 wdev->pdata.file_fw, keyset_chip); in get_firmware()
108 ret = firmware_request_nowarn(fw, filename, wdev->dev); in get_firmware()
110 dev_info(wdev->dev, "can't load %s, falling back to %s.sec\n", in get_firmware()
111 filename, wdev->pdata.file_fw); in get_firmware()
112 snprintf(filename, sizeof(filename), "%s.sec", wdev->pdata.file_fw); in get_firmware()
113 ret = request_firmware(fw, filename, wdev->dev); in get_firmware()
115 dev_err(wdev->dev, "can't load %s\n", filename); in get_firmware()
121 data = (*fw)->data; in get_firmware()
123 /* Legacy firmware format */ in get_firmware()
130 dev_err(wdev->dev, "%s corrupted\n", filename); in get_firmware()
133 return -EINVAL; in get_firmware()
137 dev_err(wdev->dev, "firmware keyset is incompatible with chip (file: 0x%02X, chip: 0x%02X)\n", in get_firmware()
141 return -ENODEV; in get_firmware()
143 wdev->keyset = keyset_file; in get_firmware()
157 return -EIO; in wait_ncp_status()
162 return -ETIMEDOUT; in wait_ncp_status()
165 dev_dbg(wdev->dev, "chip answer after %lldus\n", ktime_us_delta(now, start)); in wait_ncp_status()
167 dev_dbg(wdev->dev, "chip answer immediately\n"); in wait_ncp_status()
178 dev_err(wdev->dev, "firmware size is not aligned. Buffer overrun will occur\n"); in upload_firmware()
179 return -EIO; in upload_firmware()
186 if (offs + DNLD_BLOCK_SIZE - bytes_done < DNLD_FIFO_SIZE) in upload_firmware()
189 return -ETIMEDOUT; in upload_firmware()
195 dev_dbg(wdev->dev, "answer after %lldus\n", ktime_us_delta(now, start)); in upload_firmware()
220 dev_info(wdev->dev, "secure boot: %s\n", fwio_errors[reg]); in print_boot_status()
222 dev_info(wdev->dev, "secure boot: Error %#02x\n", reg); in print_boot_status()
227 const struct firmware *fw = NULL; in load_firmware_secure()
237 return -ENOMEM; in load_firmware_secure()
246 dev_dbg(wdev->dev, "bootloader: \"%s\"\n", buf); in load_firmware_secure()
261 wfx_sram_write_dma_safe(wdev, WFX_DCA_FW_SIGNATURE, fw->data + fw_offset, in load_firmware_secure()
263 wfx_sram_write_dma_safe(wdev, WFX_DCA_FW_HASH, fw->data + fw_offset + FW_SIGNATURE_SIZE, in load_firmware_secure()
265 wfx_sram_reg_write(wdev, WFX_DCA_IMAGE_SIZE, fw->size - header_size); in load_firmware_secure()
272 ret = upload_firmware(wdev, fw->data + header_size, fw->size - header_size); in load_firmware_secure()
275 dev_dbg(wdev->dev, "firmware load after %lldus\n", in load_firmware_secure()
313 dev_dbg(wdev->dev, " index %02x: %08x\n", gpr_init[i].index, gpr_init[i].value); in init_gpr()
327 if (wdev->pdata.use_rising_clk) in wfx_init_device()
331 …dev_err(wdev->dev, "bus returned an error during first write access. Host configuration error?\n"); in wfx_init_device()
332 return -EIO; in wfx_init_device()
337 dev_err(wdev->dev, "bus returned an error during first read access. Bus configuration error?\n"); in wfx_init_device()
338 return -EIO; in wfx_init_device()
341 dev_err(wdev->dev, "chip mute. Bus configuration error or chip wasn't reset?\n"); in wfx_init_device()
342 return -EIO; in wfx_init_device()
344 dev_dbg(wdev->dev, "initial config register value: %08x\n", reg); in wfx_init_device()
348 dev_err(wdev->dev, "bad hardware revision number: %d\n", hw_revision); in wfx_init_device()
349 return -ENODEV; in wfx_init_device()
353 dev_notice(wdev->dev, "development hardware detected\n"); in wfx_init_device()
363 return -EIO; in wfx_init_device()
371 dev_err(wdev->dev, "chip didn't wake up. Chip wasn't reset?\n"); in wfx_init_device()
372 return -ETIMEDOUT; in wfx_init_device()
375 dev_dbg(wdev->dev, "chip wake up after %lldus\n", ktime_us_delta(now, start)); in wfx_init_device()