.. | .. |
---|
1 | 1 | /****************************************************************************** |
---|
2 | 2 | * |
---|
| 3 | + * This file is provided under a dual BSD/GPLv2 license. When using or |
---|
| 4 | + * redistributing this file, you may do so under either license. |
---|
| 5 | + * |
---|
| 6 | + * GPL LICENSE SUMMARY |
---|
| 7 | + * |
---|
3 | 8 | * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. |
---|
4 | 9 | * Copyright(c) 2015 - 2016 Intel Deutschland GmbH |
---|
5 | | - * |
---|
6 | | - * Portions of this file are derived from the ipw3945 project. |
---|
| 10 | + * Copyright(C) 2018 - 2019 Intel Corporation |
---|
7 | 11 | * |
---|
8 | 12 | * This program is free software; you can redistribute it and/or modify it |
---|
9 | 13 | * under the terms of version 2 of the GNU General Public License as |
---|
.. | .. |
---|
14 | 18 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
15 | 19 | * more details. |
---|
16 | 20 | * |
---|
17 | | - * You should have received a copy of the GNU General Public License along with |
---|
18 | | - * this program; if not, write to the Free Software Foundation, Inc., |
---|
19 | | - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA |
---|
20 | | - * |
---|
21 | 21 | * The full GNU General Public License is included in this distribution in the |
---|
22 | | - * file called LICENSE. |
---|
| 22 | + * file called COPYING. |
---|
23 | 23 | * |
---|
24 | 24 | * Contact Information: |
---|
25 | 25 | * Intel Linux Wireless <linuxwifi@intel.com> |
---|
26 | 26 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
---|
| 27 | + * |
---|
| 28 | + * BSD LICENSE |
---|
| 29 | + * |
---|
| 30 | + * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. |
---|
| 31 | + * Copyright(c) 2015 - 2016 Intel Deutschland GmbH |
---|
| 32 | + * Copyright (C) 2018 - 2019 Intel Corporation |
---|
| 33 | + * All rights reserved. |
---|
| 34 | + * |
---|
| 35 | + * Redistribution and use in source and binary forms, with or without |
---|
| 36 | + * modification, are permitted provided that the following conditions |
---|
| 37 | + * are met: |
---|
| 38 | + * |
---|
| 39 | + * * Redistributions of source code must retain the above copyright |
---|
| 40 | + * notice, this list of conditions and the following disclaimer. |
---|
| 41 | + * * Redistributions in binary form must reproduce the above copyright |
---|
| 42 | + * notice, this list of conditions and the following disclaimer in |
---|
| 43 | + * the documentation and/or other materials provided with the |
---|
| 44 | + * distribution. |
---|
| 45 | + * * Neither the name Intel Corporation nor the names of its |
---|
| 46 | + * contributors may be used to endorse or promote products derived |
---|
| 47 | + * from this software without specific prior written permission. |
---|
| 48 | + * |
---|
| 49 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
---|
| 50 | + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
---|
| 51 | + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
---|
| 52 | + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
---|
| 53 | + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
---|
| 54 | + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
---|
| 55 | + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
---|
| 56 | + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
---|
| 57 | + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
---|
| 58 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
---|
| 59 | + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
27 | 60 | * |
---|
28 | 61 | *****************************************************************************/ |
---|
29 | 62 | #include <linux/delay.h> |
---|
.. | .. |
---|
241 | 274 | |
---|
242 | 275 | void iwl_force_nmi(struct iwl_trans *trans) |
---|
243 | 276 | { |
---|
244 | | - if (trans->cfg->device_family < IWL_DEVICE_FAMILY_9000) |
---|
| 277 | + if (trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_9000) |
---|
245 | 278 | iwl_write_prph(trans, DEVICE_SET_NMI_REG, |
---|
246 | 279 | DEVICE_SET_NMI_VAL_DRV); |
---|
| 280 | + else if (trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210) |
---|
| 281 | + iwl_write_umac_prph(trans, UREG_NIC_SET_NMI_DRIVER, |
---|
| 282 | + UREG_NIC_SET_NMI_DRIVER_NMI_FROM_DRIVER_MSK); |
---|
247 | 283 | else |
---|
248 | | - iwl_write_prph(trans, UREG_NIC_SET_NMI_DRIVER, |
---|
249 | | - UREG_NIC_SET_NMI_DRIVER_NMI_FROM_DRIVER_MSK); |
---|
| 284 | + iwl_write_umac_prph(trans, UREG_DOORBELL_TO_ISR6, |
---|
| 285 | + UREG_DOORBELL_TO_ISR6_NMI_BIT); |
---|
250 | 286 | } |
---|
251 | 287 | IWL_EXPORT_SYMBOL(iwl_force_nmi); |
---|
252 | 288 | |
---|
.. | .. |
---|
392 | 428 | FH_TSSR_TX_ERROR_REG |
---|
393 | 429 | }; |
---|
394 | 430 | |
---|
395 | | - if (trans->cfg->mq_rx_supported) |
---|
| 431 | + if (trans->trans_cfg->mq_rx_supported) |
---|
396 | 432 | return iwl_dump_rfh(trans, buf); |
---|
397 | 433 | |
---|
398 | 434 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
---|
.. | .. |
---|
425 | 461 | |
---|
426 | 462 | return 0; |
---|
427 | 463 | } |
---|
| 464 | + |
---|
| 465 | +int iwl_finish_nic_init(struct iwl_trans *trans, |
---|
| 466 | + const struct iwl_cfg_trans_params *cfg_trans) |
---|
| 467 | +{ |
---|
| 468 | + int err; |
---|
| 469 | + |
---|
| 470 | + if (cfg_trans->bisr_workaround) { |
---|
| 471 | + /* ensure the TOP FSM isn't still in previous reset */ |
---|
| 472 | + mdelay(2); |
---|
| 473 | + } |
---|
| 474 | + |
---|
| 475 | + /* |
---|
| 476 | + * Set "initialization complete" bit to move adapter from |
---|
| 477 | + * D0U* --> D0A* (powered-up active) state. |
---|
| 478 | + */ |
---|
| 479 | + iwl_set_bit(trans, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); |
---|
| 480 | + |
---|
| 481 | + if (cfg_trans->device_family == IWL_DEVICE_FAMILY_8000) |
---|
| 482 | + udelay(2); |
---|
| 483 | + |
---|
| 484 | + /* |
---|
| 485 | + * Wait for clock stabilization; once stabilized, access to |
---|
| 486 | + * device-internal resources is supported, e.g. iwl_write_prph() |
---|
| 487 | + * and accesses to uCode SRAM. |
---|
| 488 | + */ |
---|
| 489 | + err = iwl_poll_bit(trans, CSR_GP_CNTRL, |
---|
| 490 | + CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, |
---|
| 491 | + CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, |
---|
| 492 | + 25000); |
---|
| 493 | + if (err < 0) |
---|
| 494 | + IWL_DEBUG_INFO(trans, "Failed to wake NIC\n"); |
---|
| 495 | + |
---|
| 496 | + if (cfg_trans->bisr_workaround) { |
---|
| 497 | + /* ensure BISR shift has finished */ |
---|
| 498 | + udelay(200); |
---|
| 499 | + } |
---|
| 500 | + |
---|
| 501 | + return err < 0 ? err : 0; |
---|
| 502 | +} |
---|
| 503 | +IWL_EXPORT_SYMBOL(iwl_finish_nic_init); |
---|