diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-02-09 11:17:47 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-02-17 16:46:32 -0500 |
commit | 53465def649b813987ca0d4a7ced744305204b82 (patch) | |
tree | cdff16681cb0442de3b1a8bd151b2a38c0bc5311 /drivers/gpu/nvgpu/pmgr | |
parent | 29a79e6b80c6a0da489d8b0a470c86e2fec9c355 (diff) |
gpu: nvgpu: Generalize BIOS code
Most of BIOS parsing code is not specific to any particular GPU. Move
most of the code to generic files, and leave only chip specific parts
dealing with microcontroller boot into chip specific files.
As most of the parsing is generic, they do not need to be called via
HALs so remove the HALs and change the calls into direct function
calls.
All definitions meant to be used outside BIOS code itself are now in
<nvgpu/bios.h>
Change-Id: Id48e94c74511d6e95645e90e5bba5c12ef8da45d
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1302222
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/pmgr')
-rw-r--r-- | drivers/gpu/nvgpu/pmgr/pmgrpmu.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/pmgr/pwrdev.c | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/pmgr/pwrmonitor.c | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/pmgr/pwrpolicy.c | 8 |
4 files changed, 9 insertions, 16 deletions
diff --git a/drivers/gpu/nvgpu/pmgr/pmgrpmu.c b/drivers/gpu/nvgpu/pmgr/pmgrpmu.c index 53241734..28fe943e 100644 --- a/drivers/gpu/nvgpu/pmgr/pmgrpmu.c +++ b/drivers/gpu/nvgpu/pmgr/pmgrpmu.c | |||
@@ -13,7 +13,6 @@ | |||
13 | 13 | ||
14 | #include "gk20a/gk20a.h" | 14 | #include "gk20a/gk20a.h" |
15 | #include "pwrdev.h" | 15 | #include "pwrdev.h" |
16 | #include "include/bios.h" | ||
17 | #include "boardobj/boardobjgrp.h" | 16 | #include "boardobj/boardobjgrp.h" |
18 | #include "boardobj/boardobjgrp_e32.h" | 17 | #include "boardobj/boardobjgrp_e32.h" |
19 | #include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h> | 18 | #include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h> |
diff --git a/drivers/gpu/nvgpu/pmgr/pwrdev.c b/drivers/gpu/nvgpu/pmgr/pwrdev.c index e831126b..0f87ad26 100644 --- a/drivers/gpu/nvgpu/pmgr/pwrdev.c +++ b/drivers/gpu/nvgpu/pmgr/pwrdev.c | |||
@@ -11,9 +11,10 @@ | |||
11 | * more details. | 11 | * more details. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <nvgpu/bios.h> | ||
15 | |||
14 | #include "gk20a/gk20a.h" | 16 | #include "gk20a/gk20a.h" |
15 | #include "pwrdev.h" | 17 | #include "pwrdev.h" |
16 | #include "include/bios.h" | ||
17 | #include "boardobj/boardobjgrp.h" | 18 | #include "boardobj/boardobjgrp.h" |
18 | #include "boardobj/boardobjgrp_e32.h" | 19 | #include "boardobj/boardobjgrp_e32.h" |
19 | #include "gm206/bios_gm206.h" | 20 | #include "gm206/bios_gm206.h" |
@@ -138,10 +139,7 @@ static u32 devinit_get_pwr_device_table(struct gk20a *g, | |||
138 | 139 | ||
139 | gk20a_dbg_info(""); | 140 | gk20a_dbg_info(""); |
140 | 141 | ||
141 | if (!g->ops.bios.get_perf_table_ptrs) | 142 | pwr_device_table_ptr = (u8 *)nvgpu_bios_get_perf_table_ptrs(g, |
142 | return -EINVAL; | ||
143 | |||
144 | pwr_device_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, | ||
145 | g->bios.perf_token, POWER_SENSORS_TABLE); | 143 | g->bios.perf_token, POWER_SENSORS_TABLE); |
146 | if (pwr_device_table_ptr == NULL) { | 144 | if (pwr_device_table_ptr == NULL) { |
147 | status = -EINVAL; | 145 | status = -EINVAL; |
diff --git a/drivers/gpu/nvgpu/pmgr/pwrmonitor.c b/drivers/gpu/nvgpu/pmgr/pwrmonitor.c index ab2460eb..685aa71a 100644 --- a/drivers/gpu/nvgpu/pmgr/pwrmonitor.c +++ b/drivers/gpu/nvgpu/pmgr/pwrmonitor.c | |||
@@ -11,9 +11,10 @@ | |||
11 | * more details. | 11 | * more details. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <nvgpu/bios.h> | ||
15 | |||
14 | #include "gk20a/gk20a.h" | 16 | #include "gk20a/gk20a.h" |
15 | #include "pwrdev.h" | 17 | #include "pwrdev.h" |
16 | #include "include/bios.h" | ||
17 | #include "boardobj/boardobjgrp.h" | 18 | #include "boardobj/boardobjgrp.h" |
18 | #include "boardobj/boardobjgrp_e32.h" | 19 | #include "boardobj/boardobjgrp_e32.h" |
19 | #include "gm206/bios_gm206.h" | 20 | #include "gm206/bios_gm206.h" |
@@ -185,10 +186,7 @@ static u32 devinit_get_pwr_topology_table(struct gk20a *g, | |||
185 | 186 | ||
186 | gk20a_dbg_info(""); | 187 | gk20a_dbg_info(""); |
187 | 188 | ||
188 | if (!g->ops.bios.get_perf_table_ptrs) | 189 | pwr_topology_table_ptr = (u8 *)nvgpu_bios_get_perf_table_ptrs(g, |
189 | return -EINVAL; | ||
190 | |||
191 | pwr_topology_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, | ||
192 | g->bios.perf_token, POWER_TOPOLOGY_TABLE); | 190 | g->bios.perf_token, POWER_TOPOLOGY_TABLE); |
193 | if (pwr_topology_table_ptr == NULL) { | 191 | if (pwr_topology_table_ptr == NULL) { |
194 | status = -EINVAL; | 192 | status = -EINVAL; |
diff --git a/drivers/gpu/nvgpu/pmgr/pwrpolicy.c b/drivers/gpu/nvgpu/pmgr/pwrpolicy.c index d19f9a1c..4c007337 100644 --- a/drivers/gpu/nvgpu/pmgr/pwrpolicy.c +++ b/drivers/gpu/nvgpu/pmgr/pwrpolicy.c | |||
@@ -11,9 +11,10 @@ | |||
11 | * more details. | 11 | * more details. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <nvgpu/bios.h> | ||
15 | |||
14 | #include "gk20a/gk20a.h" | 16 | #include "gk20a/gk20a.h" |
15 | #include "pwrpolicy.h" | 17 | #include "pwrpolicy.h" |
16 | #include "include/bios.h" | ||
17 | #include "boardobj/boardobjgrp.h" | 18 | #include "boardobj/boardobjgrp.h" |
18 | #include "boardobj/boardobjgrp_e32.h" | 19 | #include "boardobj/boardobjgrp_e32.h" |
19 | #include "gm206/bios_gm206.h" | 20 | #include "gm206/bios_gm206.h" |
@@ -521,10 +522,7 @@ static u32 devinit_get_pwr_policy_table(struct gk20a *g, | |||
521 | 522 | ||
522 | gk20a_dbg_info(""); | 523 | gk20a_dbg_info(""); |
523 | 524 | ||
524 | if (!g->ops.bios.get_perf_table_ptrs) | 525 | ptr = (u8 *)nvgpu_bios_get_perf_table_ptrs(g, |
525 | return -EINVAL; | ||
526 | |||
527 | ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, | ||
528 | g->bios.perf_token, POWER_CAPPING_TABLE); | 526 | g->bios.perf_token, POWER_CAPPING_TABLE); |
529 | if (ptr == NULL) { | 527 | if (ptr == NULL) { |
530 | status = -EINVAL; | 528 | status = -EINVAL; |