forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/drivers/crypto/qat/qat_dh895xcc/adf_dh895xcc_hw_data.c
....@@ -1,62 +1,18 @@
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 */
473 #include <adf_accel_devices.h>
484 #include <adf_pf2vf_msg.h>
495 #include <adf_common_drv.h>
506 #include "adf_dh895xcc_hw_data.h"
517
528 /* 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[] = {
5410 0x12222AAA, 0x11666666, 0x12222AAA, 0x11666666,
5511 0x12222AAA, 0x11222222, 0x12222AAA, 0x11222222,
5612 0x00000000, 0x00000000, 0x00000000, 0x00000000
5713 };
5814
59
-static const uint32_t thrd_to_arb_map_sku6[] = {
15
+static const u32 thrd_to_arb_map_sku6[] = {
6016 0x12222AAA, 0x11666666, 0x12222AAA, 0x11666666,
6117 0x12222AAA, 0x11222222, 0x12222AAA, 0x11222222,
6218 0x12222AAA, 0x11222222, 0x12222AAA, 0x11222222
....@@ -68,20 +24,20 @@
6824 .instances = 0
6925 };
7026
71
-static uint32_t get_accel_mask(uint32_t fuse)
27
+static u32 get_accel_mask(u32 fuse)
7228 {
7329 return (~fuse) >> ADF_DH895XCC_ACCELERATORS_REG_OFFSET &
7430 ADF_DH895XCC_ACCELERATORS_MASK;
7531 }
7632
77
-static uint32_t get_ae_mask(uint32_t fuse)
33
+static u32 get_ae_mask(u32 fuse)
7834 {
7935 return (~fuse) & ADF_DH895XCC_ACCELENGINES_MASK;
8036 }
8137
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)
8339 {
84
- uint32_t i, ctr = 0;
40
+ u32 i, ctr = 0;
8541
8642 if (!self || !self->accel_mask)
8743 return 0;
....@@ -93,9 +49,9 @@
9349 return ctr;
9450 }
9551
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)
9753 {
98
- uint32_t i, ctr = 0;
54
+ u32 i, ctr = 0;
9955
10056 if (!self || !self->ae_mask)
10157 return 0;
....@@ -107,17 +63,17 @@
10763 return ctr;
10864 }
10965
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)
11167 {
11268 return ADF_DH895XCC_PMISC_BAR;
11369 }
11470
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)
11672 {
11773 return ADF_DH895XCC_ETR_BAR;
11874 }
11975
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)
12177 {
12278 return ADF_DH895XCC_SRAM_BAR;
12379 }
....@@ -161,12 +117,12 @@
161117 }
162118 }
163119
164
-static uint32_t get_pf2vf_offset(uint32_t i)
120
+static u32 get_pf2vf_offset(u32 i)
165121 {
166122 return ADF_DH895XCC_PF2VF_OFFSET(i);
167123 }
168124
169
-static uint32_t get_vintmsk_offset(uint32_t i)
125
+static u32 get_vintmsk_offset(u32 i)
170126 {
171127 return ADF_DH895XCC_VINTMSK_OFFSET(i);
172128 }