diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2018-05-25 17:25:01 -0400 |
---|---|---|
committer | Tejal Kudav <tkudav@nvidia.com> | 2018-06-14 09:44:07 -0400 |
commit | dec8625b88d1430f4bf3eac37954fbb732de3f1a (patch) | |
tree | a90171ea9fbd53c8690f8338af54befad3d624ef /drivers/gpu/nvgpu/common/bus | |
parent | d4dfa63e6c324430ad2cac4fabb73a95858b2573 (diff) |
gpu: nvgpu: Move SW scratch register read to bus
SW scratch register is in bus register range. Move query of that
register to bus HAL from bios.
JIRA NVGPU-588
Change-Id: I69f35af3d5f8da3550eb68fe7d060a3ec48ce275
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1730898
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/bus')
-rw-r--r-- | drivers/gpu/nvgpu/common/bus/bus_gv100.c | 39 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/bus/bus_gv100.h | 33 |
2 files changed, 72 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/bus/bus_gv100.c b/drivers/gpu/nvgpu/common/bus/bus_gv100.c new file mode 100644 index 00000000..2aa15e67 --- /dev/null +++ b/drivers/gpu/nvgpu/common/bus/bus_gv100.c | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * Copyright (c) 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 | |||
23 | #include <nvgpu/timers.h> | ||
24 | #include <nvgpu/mm.h> | ||
25 | |||
26 | #include "bus_gv100.h" | ||
27 | #include "gk20a/gk20a.h" | ||
28 | |||
29 | #include <nvgpu/hw/gv100/hw_bus_gv100.h> | ||
30 | |||
31 | u32 gv100_bus_read_sw_scratch(struct gk20a *g, u32 index) | ||
32 | { | ||
33 | return gk20a_readl(g, bus_sw_scratch_r(index)); | ||
34 | } | ||
35 | |||
36 | void gv100_bus_write_sw_scratch(struct gk20a *g, u32 index, u32 val) | ||
37 | { | ||
38 | gk20a_writel(g, bus_sw_scratch_r(index), val); | ||
39 | } | ||
diff --git a/drivers/gpu/nvgpu/common/bus/bus_gv100.h b/drivers/gpu/nvgpu/common/bus/bus_gv100.h new file mode 100644 index 00000000..b6b608da --- /dev/null +++ b/drivers/gpu/nvgpu/common/bus/bus_gv100.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * Copyright (c) 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 | |||
23 | #ifndef NVGPU_GV100_BUS | ||
24 | #define NVGPU_GV100_BUS | ||
25 | |||
26 | #include <nvgpu/types.h> | ||
27 | |||
28 | struct gk20a; | ||
29 | |||
30 | u32 gv100_bus_read_sw_scratch(struct gk20a *g, u32 index); | ||
31 | void gv100_bus_write_sw_scratch(struct gk20a *g, u32 index, u32 val); | ||
32 | |||
33 | #endif | ||