Lines Matching +full:silicon +full:- +full:id

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Firmware I/O code for mac80211 ST-Ericsson CW1200 drivers
5 * Copyright (c) 2010, ST-Ericsson
9 * ST-Ericsson UMAC CW1200 driver which is
10 * Copyright (c) 2010, ST-Ericsson
26 int hw_type = -1; in cw1200_get_hw_type()
93 switch (priv->hw_revision) { in cw1200_load_firmware_cw1200()
96 if (!priv->sdd_path) in cw1200_load_firmware_cw1200()
97 priv->sdd_path = SDD_FILE_10; in cw1200_load_firmware_cw1200()
101 if (!priv->sdd_path) in cw1200_load_firmware_cw1200()
102 priv->sdd_path = SDD_FILE_11; in cw1200_load_firmware_cw1200()
106 if (!priv->sdd_path) in cw1200_load_firmware_cw1200()
107 priv->sdd_path = SDD_FILE_20; in cw1200_load_firmware_cw1200()
111 if (!priv->sdd_path) in cw1200_load_firmware_cw1200()
112 priv->sdd_path = SDD_FILE_22; in cw1200_load_firmware_cw1200()
116 if (!priv->sdd_path) in cw1200_load_firmware_cw1200()
117 priv->sdd_path = SDD_FILE_CW1X60; in cw1200_load_firmware_cw1200()
120 pr_err("Invalid silicon revision %d.\n", priv->hw_revision); in cw1200_load_firmware_cw1200()
121 return -EINVAL; in cw1200_load_firmware_cw1200()
145 ret = request_firmware(&firmware, fw_path, priv->pdev); in cw1200_load_firmware_cw1200()
154 ret = -ENOMEM; in cw1200_load_firmware_cw1200()
168 ret = -ETIMEDOUT; in cw1200_load_firmware_cw1200()
173 num_blocks = (firmware->size - 1) / DOWNLOAD_BLOCK_SIZE + 1; in cw1200_load_firmware_cw1200()
176 val32 = firmware->size; /* Explicit cast from size_t to u32 */ in cw1200_load_firmware_cw1200()
188 ret = -EIO; in cw1200_load_firmware_cw1200()
192 /* loop until put - get <= 24K */ in cw1200_load_firmware_cw1200()
195 if ((put - get) <= in cw1200_load_firmware_cw1200()
196 (DOWNLOAD_FIFO_SIZE - DOWNLOAD_BLOCK_SIZE)) in cw1200_load_firmware_cw1200()
201 if ((put - get) > (DOWNLOAD_FIFO_SIZE - DOWNLOAD_BLOCK_SIZE)) { in cw1200_load_firmware_cw1200()
203 ret = -ETIMEDOUT; in cw1200_load_firmware_cw1200()
208 tx_size = block_size = min_t(size_t, firmware->size - put, in cw1200_load_firmware_cw1200()
211 memcpy(buf, &firmware->data[put], block_size); in cw1200_load_firmware_cw1200()
214 DOWNLOAD_BLOCK_SIZE - block_size); in cw1200_load_firmware_cw1200()
221 (put & (DOWNLOAD_FIFO_SIZE - 1))), in cw1200_load_firmware_cw1200()
225 put & (DOWNLOAD_FIFO_SIZE - 1)); in cw1200_load_firmware_cw1200()
243 ret = -ETIMEDOUT; in cw1200_load_firmware_cw1200()
267 switch (priv->hw_type) { in config_reg_read()
289 switch (priv->hw_type) { in config_reg_write()
308 int major_revision = -1; in cw1200_load_firmware()
319 ret = -EIO; in cw1200_load_firmware()
328 priv->hw_type = ret; in cw1200_load_firmware()
332 cw1200_dpll_from_clk(priv->hw_refclk)); in cw1200_load_firmware()
347 if (val32 != cw1200_dpll_from_clk(priv->hw_refclk)) { in cw1200_load_firmware()
349 cw1200_dpll_from_clk(priv->hw_refclk), val32); in cw1200_load_firmware()
350 ret = -EIO; in cw1200_load_firmware()
385 ret = -ETIMEDOUT; in cw1200_load_firmware()
394 pr_err("HW detection: can't read CUT ID.\n"); in cw1200_load_firmware()
400 pr_info("CW1x00 Cut 1.1 silicon detected.\n"); in cw1200_load_firmware()
401 priv->hw_revision = CW1200_HW_REV_CUT11; in cw1200_load_firmware()
404 pr_info("CW1x00 Cut 1.0 silicon detected.\n"); in cw1200_load_firmware()
405 priv->hw_revision = CW1200_HW_REV_CUT10; in cw1200_load_firmware()
409 /* According to ST-E, CUT<2.0 has busted BA TID0-3. in cw1200_load_firmware()
412 priv->ba_rx_tid_mask = 0; in cw1200_load_firmware()
413 priv->ba_tx_tid_mask = 0; in cw1200_load_firmware()
419 pr_err("(1) HW detection: can't read CUT ID\n"); in cw1200_load_firmware()
424 pr_err("(2) HW detection: can't read CUT ID.\n"); in cw1200_load_firmware()
430 pr_err("(3) HW detection: can't read CUT ID.\n"); in cw1200_load_firmware()
437 pr_info("CW1x00 Cut 2.2 silicon detected.\n"); in cw1200_load_firmware()
438 priv->hw_revision = CW1200_HW_REV_CUT22; in cw1200_load_firmware()
440 pr_info("CW1x00 Cut 2.0 silicon detected.\n"); in cw1200_load_firmware()
441 priv->hw_revision = CW1200_HW_REV_CUT20; in cw1200_load_firmware()
446 pr_info("CW1x60 silicon detected.\n"); in cw1200_load_firmware()
447 priv->hw_revision = CW1X60_HW_REV; in cw1200_load_firmware()
450 pr_err("Unsupported silicon major revision %d.\n", in cw1200_load_firmware()
452 ret = -ENOTSUPP; in cw1200_load_firmware()
465 ret = -EINVAL; in cw1200_load_firmware()
469 switch (priv->hw_type) { in cw1200_load_firmware()
471 if (priv->hw_revision == CW1X60_HW_REV) { in cw1200_load_firmware()
473 ret = -ENOTSUPP; in cw1200_load_firmware()
480 priv->hw_type); in cw1200_load_firmware()
481 ret = -ENOTSUPP; in cw1200_load_firmware()
490 priv->hwbus_ops->lock(priv->hwbus_priv); in cw1200_load_firmware()
492 priv->hwbus_ops->unlock(priv->hwbus_priv); in cw1200_load_firmware()
519 priv->hwbus_ops->lock(priv->hwbus_priv); in cw1200_load_firmware()
521 priv->hwbus_ops->unlock(priv->hwbus_priv); in cw1200_load_firmware()