| .. | .. |
|---|
| 1 | | -/* |
|---|
| 2 | | - This file is provided under a dual BSD/GPLv2 license. When using or |
|---|
| 3 | | - redistributing this file, you may do so under either license. |
|---|
| 4 | | - |
|---|
| 5 | | - GPL LICENSE SUMMARY |
|---|
| 6 | | - Copyright(c) 2014 Intel Corporation. |
|---|
| 7 | | - This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - it under the terms of version 2 of the GNU General Public License as |
|---|
| 9 | | - published by the Free Software Foundation. |
|---|
| 10 | | - |
|---|
| 11 | | - This program is distributed in the hope that it will be useful, but |
|---|
| 12 | | - WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 14 | | - General Public License for more details. |
|---|
| 15 | | - |
|---|
| 16 | | - Contact Information: |
|---|
| 17 | | - qat-linux@intel.com |
|---|
| 18 | | - |
|---|
| 19 | | - BSD LICENSE |
|---|
| 20 | | - Copyright(c) 2014 Intel Corporation. |
|---|
| 21 | | - Redistribution and use in source and binary forms, with or without |
|---|
| 22 | | - modification, are permitted provided that the following conditions |
|---|
| 23 | | - are met: |
|---|
| 24 | | - |
|---|
| 25 | | - * Redistributions of source code must retain the above copyright |
|---|
| 26 | | - notice, this list of conditions and the following disclaimer. |
|---|
| 27 | | - * Redistributions in binary form must reproduce the above copyright |
|---|
| 28 | | - notice, this list of conditions and the following disclaimer in |
|---|
| 29 | | - the documentation and/or other materials provided with the |
|---|
| 30 | | - distribution. |
|---|
| 31 | | - * Neither the name of Intel Corporation nor the names of its |
|---|
| 32 | | - contributors may be used to endorse or promote products derived |
|---|
| 33 | | - from this software without specific prior written permission. |
|---|
| 34 | | - |
|---|
| 35 | | - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|---|
| 36 | | - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|---|
| 37 | | - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|---|
| 38 | | - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|---|
| 39 | | - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|---|
| 40 | | - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|---|
| 41 | | - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|---|
| 42 | | - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|---|
| 43 | | - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|---|
| 44 | | - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|---|
| 45 | | - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|---|
| 46 | | -*/ |
|---|
| 1 | +// SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only) |
|---|
| 2 | +/* Copyright(c) 2014 - 2020 Intel Corporation */ |
|---|
| 47 | 3 | #include <adf_accel_devices.h> |
|---|
| 48 | 4 | #include <adf_pf2vf_msg.h> |
|---|
| 49 | 5 | #include <adf_common_drv.h> |
|---|
| 50 | 6 | #include "adf_dh895xcc_hw_data.h" |
|---|
| 51 | 7 | |
|---|
| 52 | 8 | /* Worker thread to service arbiter mappings based on dev SKUs */ |
|---|
| 53 | | -static const uint32_t thrd_to_arb_map_sku4[] = { |
|---|
| 9 | +static const u32 thrd_to_arb_map_sku4[] = { |
|---|
| 54 | 10 | 0x12222AAA, 0x11666666, 0x12222AAA, 0x11666666, |
|---|
| 55 | 11 | 0x12222AAA, 0x11222222, 0x12222AAA, 0x11222222, |
|---|
| 56 | 12 | 0x00000000, 0x00000000, 0x00000000, 0x00000000 |
|---|
| 57 | 13 | }; |
|---|
| 58 | 14 | |
|---|
| 59 | | -static const uint32_t thrd_to_arb_map_sku6[] = { |
|---|
| 15 | +static const u32 thrd_to_arb_map_sku6[] = { |
|---|
| 60 | 16 | 0x12222AAA, 0x11666666, 0x12222AAA, 0x11666666, |
|---|
| 61 | 17 | 0x12222AAA, 0x11222222, 0x12222AAA, 0x11222222, |
|---|
| 62 | 18 | 0x12222AAA, 0x11222222, 0x12222AAA, 0x11222222 |
|---|
| .. | .. |
|---|
| 68 | 24 | .instances = 0 |
|---|
| 69 | 25 | }; |
|---|
| 70 | 26 | |
|---|
| 71 | | -static uint32_t get_accel_mask(uint32_t fuse) |
|---|
| 27 | +static u32 get_accel_mask(u32 fuse) |
|---|
| 72 | 28 | { |
|---|
| 73 | 29 | return (~fuse) >> ADF_DH895XCC_ACCELERATORS_REG_OFFSET & |
|---|
| 74 | 30 | ADF_DH895XCC_ACCELERATORS_MASK; |
|---|
| 75 | 31 | } |
|---|
| 76 | 32 | |
|---|
| 77 | | -static uint32_t get_ae_mask(uint32_t fuse) |
|---|
| 33 | +static u32 get_ae_mask(u32 fuse) |
|---|
| 78 | 34 | { |
|---|
| 79 | 35 | return (~fuse) & ADF_DH895XCC_ACCELENGINES_MASK; |
|---|
| 80 | 36 | } |
|---|
| 81 | 37 | |
|---|
| 82 | | -static uint32_t get_num_accels(struct adf_hw_device_data *self) |
|---|
| 38 | +static u32 get_num_accels(struct adf_hw_device_data *self) |
|---|
| 83 | 39 | { |
|---|
| 84 | | - uint32_t i, ctr = 0; |
|---|
| 40 | + u32 i, ctr = 0; |
|---|
| 85 | 41 | |
|---|
| 86 | 42 | if (!self || !self->accel_mask) |
|---|
| 87 | 43 | return 0; |
|---|
| .. | .. |
|---|
| 93 | 49 | return ctr; |
|---|
| 94 | 50 | } |
|---|
| 95 | 51 | |
|---|
| 96 | | -static uint32_t get_num_aes(struct adf_hw_device_data *self) |
|---|
| 52 | +static u32 get_num_aes(struct adf_hw_device_data *self) |
|---|
| 97 | 53 | { |
|---|
| 98 | | - uint32_t i, ctr = 0; |
|---|
| 54 | + u32 i, ctr = 0; |
|---|
| 99 | 55 | |
|---|
| 100 | 56 | if (!self || !self->ae_mask) |
|---|
| 101 | 57 | return 0; |
|---|
| .. | .. |
|---|
| 107 | 63 | return ctr; |
|---|
| 108 | 64 | } |
|---|
| 109 | 65 | |
|---|
| 110 | | -static uint32_t get_misc_bar_id(struct adf_hw_device_data *self) |
|---|
| 66 | +static u32 get_misc_bar_id(struct adf_hw_device_data *self) |
|---|
| 111 | 67 | { |
|---|
| 112 | 68 | return ADF_DH895XCC_PMISC_BAR; |
|---|
| 113 | 69 | } |
|---|
| 114 | 70 | |
|---|
| 115 | | -static uint32_t get_etr_bar_id(struct adf_hw_device_data *self) |
|---|
| 71 | +static u32 get_etr_bar_id(struct adf_hw_device_data *self) |
|---|
| 116 | 72 | { |
|---|
| 117 | 73 | return ADF_DH895XCC_ETR_BAR; |
|---|
| 118 | 74 | } |
|---|
| 119 | 75 | |
|---|
| 120 | | -static uint32_t get_sram_bar_id(struct adf_hw_device_data *self) |
|---|
| 76 | +static u32 get_sram_bar_id(struct adf_hw_device_data *self) |
|---|
| 121 | 77 | { |
|---|
| 122 | 78 | return ADF_DH895XCC_SRAM_BAR; |
|---|
| 123 | 79 | } |
|---|
| .. | .. |
|---|
| 161 | 117 | } |
|---|
| 162 | 118 | } |
|---|
| 163 | 119 | |
|---|
| 164 | | -static uint32_t get_pf2vf_offset(uint32_t i) |
|---|
| 120 | +static u32 get_pf2vf_offset(u32 i) |
|---|
| 165 | 121 | { |
|---|
| 166 | 122 | return ADF_DH895XCC_PF2VF_OFFSET(i); |
|---|
| 167 | 123 | } |
|---|
| 168 | 124 | |
|---|
| 169 | | -static uint32_t get_vintmsk_offset(uint32_t i) |
|---|
| 125 | +static u32 get_vintmsk_offset(u32 i) |
|---|
| 170 | 126 | { |
|---|
| 171 | 127 | return ADF_DH895XCC_VINTMSK_OFFSET(i); |
|---|
| 172 | 128 | } |
|---|