aboutsummaryrefslogtreecommitdiffstats
path: root/include/nvgpu/xve.h
diff options
context:
space:
mode:
authorJoshua Bakita <bakitajoshua@gmail.com>2024-09-25 16:09:09 -0400
committerJoshua Bakita <bakitajoshua@gmail.com>2024-09-25 16:09:09 -0400
commitf347fde22f1297e4f022600d201780d5ead78114 (patch)
tree76be305d6187003a1e0486ff6e91efb1062ae118 /include/nvgpu/xve.h
parent8340d234d78a7d0f46c11a584de538148b78b7cb (diff)
Delete no-longer-needed nvgpu headersHEADmasterjbakita-wip
The dependency on these was removed in commit 8340d234.
Diffstat (limited to 'include/nvgpu/xve.h')
-rw-r--r--include/nvgpu/xve.h68
1 files changed, 0 insertions, 68 deletions
diff --git a/include/nvgpu/xve.h b/include/nvgpu/xve.h
deleted file mode 100644
index 2d0d698..0000000
--- a/include/nvgpu/xve.h
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22#ifndef NVGPU_XVE_H
23#define NVGPU_XVE_H
24
25#include <nvgpu/types.h>
26#include <nvgpu/log2.h>
27
28/*
29 * For the available speeds bitmap.
30 */
31#define GPU_XVE_SPEED_2P5 (1 << 0)
32#define GPU_XVE_SPEED_5P0 (1 << 1)
33#define GPU_XVE_SPEED_8P0 (1 << 2)
34#define GPU_XVE_NR_SPEEDS 3
35
36#define GPU_XVE_SPEED_MASK (GPU_XVE_SPEED_2P5 | \
37 GPU_XVE_SPEED_5P0 | \
38 GPU_XVE_SPEED_8P0)
39
40/*
41 * The HW uses a 2 bit field where speed is defined by a number:
42 *
43 * NV_XVE_LINK_CONTROL_STATUS_LINK_SPEED_2P5 = 1
44 * NV_XVE_LINK_CONTROL_STATUS_LINK_SPEED_5P0 = 2
45 * NV_XVE_LINK_CONTROL_STATUS_LINK_SPEED_8P0 = 3
46 *
47 * This isn't ideal for a bitmap with available speeds. So the external
48 * APIs think about speeds as a bit in a bitmap and this function converts
49 * from those bits to the actual HW speed setting.
50 *
51 * @speed_bit must have only 1 bit set and must be one of the 3 available
52 * HW speeds. Not all chips support all speeds so use available_speeds() to
53 * determine what a given chip supports.
54 */
55static inline const char *xve_speed_to_str(u32 speed)
56{
57 if (!speed || !is_power_of_2(speed) ||
58 !(speed & GPU_XVE_SPEED_MASK)) {
59 return "Unknown ???";
60 }
61
62 return speed & GPU_XVE_SPEED_2P5 ? "Gen1" :
63 speed & GPU_XVE_SPEED_5P0 ? "Gen2" :
64 speed & GPU_XVE_SPEED_8P0 ? "Gen3" :
65 "Unknown ???";
66}
67
68#endif /* NVGPU_XVE_H */