linux/drivers/net/wireless/silabs/wfx/fwio.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Firmware loading.
 *
 * Copyright (c) 2017-2020, Silicon Laboratories, Inc.
 * Copyright (c) 2010, ST-Ericsson
 */
#include <linux/firmware.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/bitfield.h>

#include "fwio.h"
#include "wfx.h"
#include "hwio.h"

/* Addresses below are in SRAM area */
#define WFX_DNLD_FIFO
#define DNLD_BLOCK_SIZE
#define DNLD_FIFO_SIZE
/* Download Control Area (DCA) */
#define WFX_DCA_IMAGE_SIZE
#define WFX_DCA_PUT
#define WFX_DCA_GET
#define WFX_DCA_HOST_STATUS
#define HOST_READY
#define HOST_INFO_READ
#define HOST_UPLOAD_PENDING
#define HOST_UPLOAD_COMPLETE
#define HOST_OK_TO_JUMP
#define WFX_DCA_NCP_STATUS
#define NCP_NOT_READY
#define NCP_READY
#define NCP_INFO_READY
#define NCP_DOWNLOAD_PENDING
#define NCP_DOWNLOAD_COMPLETE
#define NCP_AUTH_OK
#define NCP_AUTH_FAIL
#define NCP_PUB_KEY_RDY
#define WFX_DCA_FW_SIGNATURE
#define FW_SIGNATURE_SIZE
#define WFX_DCA_FW_HASH
#define FW_HASH_SIZE
#define WFX_DCA_FW_VERSION
#define FW_VERSION_SIZE
#define WFX_DCA_RESERVED
#define DCA_RESERVED_SIZE
#define WFX_STATUS_INFO
#define WFX_BOOTLOADER_LABEL
#define BOOTLOADER_LABEL_SIZE
#define WFX_PTE_INFO
#define PTE_INFO_KEYSET_IDX
#define PTE_INFO_SIZE
#define WFX_ERR_INFO
#define ERR_INVALID_SEC_TYPE
#define ERR_SIG_VERIF_FAILED
#define ERR_AES_CTRL_KEY
#define ERR_ECC_PUB_KEY
#define ERR_MAC_KEY

#define DCA_TIMEOUT
#define WAKEUP_TIMEOUT

static const char * const fwio_errors[] =;

/* request_firmware() allocate data using vmalloc(). It is not compatible with underlying hardware
 * that use DMA. Function below detect this case and allocate a bounce buffer if necessary.
 *
 * Notice that, in doubt, you can enable CONFIG_DEBUG_SG to ask kernel to detect this problem at
 * runtime  (else, kernel silently fail).
 *
 * NOTE: it may also be possible to use 'pages' from struct firmware and avoid bounce buffer
 */
static int wfx_sram_write_dma_safe(struct wfx_dev *wdev, u32 addr, const u8 *buf, size_t len)
{}

static int get_firmware(struct wfx_dev *wdev, u32 keyset_chip,
			const struct firmware **fw, int *file_offset)
{}

static int wait_ncp_status(struct wfx_dev *wdev, u32 status)
{}

static int upload_firmware(struct wfx_dev *wdev, const u8 *data, size_t len)
{}

static void print_boot_status(struct wfx_dev *wdev)
{}

static int load_firmware_secure(struct wfx_dev *wdev)
{}

static int init_gpr(struct wfx_dev *wdev)
{}

int wfx_init_device(struct wfx_dev *wdev)
{}