diff options
author | Mahantesh Kumbar <mkumbar@nvidia.com> | 2016-06-17 04:38:07 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-06-21 18:20:49 -0400 |
commit | 10b75f9cdd2184e9728b7d38dd037330d1c20704 (patch) | |
tree | 4a601a0689b078faf7da747a353a287dc072a529 /drivers/gpu | |
parent | 601a5f8ed22154cb93ecb8865cbcfdeb32e3292b (diff) |
gpu: nvgpu: update get_netlist_name ops declaration
-update get_netlist_name ops declaration to support
to load GPU FW based on GPU-ARCH
-"GAxxx" string used to get size for "gm204/" or
"gm206/" which will added to NETIMAGE path like
"gm204/NETC_img.bin"
Change-Id: I5bfa13df014533a885c4328d3c767e51c29f9255
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1166783
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.h | 13 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c | 2 |
4 files changed, 16 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index e639ace4..74ffab61 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -449,7 +449,7 @@ struct gpu_ops { | |||
449 | u8 value); | 449 | u8 value); |
450 | } pmu_ver; | 450 | } pmu_ver; |
451 | struct { | 451 | struct { |
452 | int (*get_netlist_name)(int index, char *name); | 452 | int (*get_netlist_name)(struct gk20a *g, int index, char *name); |
453 | bool (*is_fw_defined)(void); | 453 | bool (*is_fw_defined)(void); |
454 | bool use_dma_for_fw_bootstrap; | 454 | bool use_dma_for_fw_bootstrap; |
455 | } gr_ctx; | 455 | } gr_ctx; |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c index a01e43c7..5029db8d 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c | |||
@@ -61,7 +61,7 @@ static int gr_gk20a_alloc_load_netlist_aiv(u32 *src, u32 len, | |||
61 | return 0; | 61 | return 0; |
62 | } | 62 | } |
63 | 63 | ||
64 | static int gr_gk20a_get_netlist_name(int index, char *name) | 64 | static int gr_gk20a_get_netlist_name(struct gk20a *g, int index, char *name) |
65 | { | 65 | { |
66 | switch (index) { | 66 | switch (index) { |
67 | #ifdef GK20A_NETLIST_IMAGE_FW_NAME | 67 | #ifdef GK20A_NETLIST_IMAGE_FW_NAME |
@@ -130,7 +130,7 @@ static int gr_gk20a_init_ctx_vars_fw(struct gk20a *g, struct gr_gk20a *gr) | |||
130 | } | 130 | } |
131 | 131 | ||
132 | for (; net < max; net++) { | 132 | for (; net < max; net++) { |
133 | if (g->ops.gr_ctx.get_netlist_name(net, name) != 0) { | 133 | if (g->ops.gr_ctx.get_netlist_name(g, net, name) != 0) { |
134 | gk20a_warn(d, "invalid netlist index %d", net); | 134 | gk20a_warn(d, "invalid netlist index %d", net); |
135 | continue; | 135 | continue; |
136 | } | 136 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.h index d413942a..b0e4c4c2 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.h | |||
@@ -28,6 +28,17 @@ | |||
28 | #define GK20A_NETLIST_IMAGE_C "NETC_img.bin" | 28 | #define GK20A_NETLIST_IMAGE_C "NETC_img.bin" |
29 | #define GK20A_NETLIST_IMAGE_D "NETD_img.bin" | 29 | #define GK20A_NETLIST_IMAGE_D "NETD_img.bin" |
30 | 30 | ||
31 | /* | ||
32 | * Need to support multiple ARCH in same GPU family | ||
33 | * then need to provide path like ARCH/NETIMAGE to | ||
34 | * point to correct netimage within GPU family, | ||
35 | * Example, gm20x can support gm204 or gm206,so path | ||
36 | * for netimage is gm204/NETC_img.bin, and '/' char | ||
37 | * will inserted at null terminator char of "GAxxx" | ||
38 | * to get complete path like gm204/NETC_img.bin | ||
39 | */ | ||
40 | #define GPU_ARCH "GAxxx" | ||
41 | |||
31 | union __max_name { | 42 | union __max_name { |
32 | #ifdef GK20A_NETLIST_IMAGE_A | 43 | #ifdef GK20A_NETLIST_IMAGE_A |
33 | char __name_a[sizeof(GK20A_NETLIST_IMAGE_A)]; | 44 | char __name_a[sizeof(GK20A_NETLIST_IMAGE_A)]; |
@@ -43,7 +54,7 @@ union __max_name { | |||
43 | #endif | 54 | #endif |
44 | }; | 55 | }; |
45 | 56 | ||
46 | #define MAX_NETLIST_NAME sizeof(union __max_name) | 57 | #define MAX_NETLIST_NAME (sizeof(GPU_ARCH) + sizeof(union __max_name)) |
47 | 58 | ||
48 | /* index for emulation netlists */ | 59 | /* index for emulation netlists */ |
49 | #define NETLIST_FINAL -1 | 60 | #define NETLIST_FINAL -1 |
diff --git a/drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c index 01cc1f16..e22acbe3 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include "gk20a/gk20a.h" | 22 | #include "gk20a/gk20a.h" |
23 | #include "gr_ctx_gm20b.h" | 23 | #include "gr_ctx_gm20b.h" |
24 | 24 | ||
25 | static int gr_gm20b_get_netlist_name(int index, char *name) | 25 | static int gr_gm20b_get_netlist_name(struct gk20a *g, int index, char *name) |
26 | { | 26 | { |
27 | switch (index) { | 27 | switch (index) { |
28 | #ifdef GM20B_NETLIST_IMAGE_FW_NAME | 28 | #ifdef GM20B_NETLIST_IMAGE_FW_NAME |