diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gm206/bios_gm206.c')
-rw-r--r-- | drivers/gpu/nvgpu/gm206/bios_gm206.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/drivers/gpu/nvgpu/gm206/bios_gm206.c b/drivers/gpu/nvgpu/gm206/bios_gm206.c index be089f2f..14610120 100644 --- a/drivers/gpu/nvgpu/gm206/bios_gm206.c +++ b/drivers/gpu/nvgpu/gm206/bios_gm206.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <nvgpu/nvgpu_common.h> | 18 | #include <nvgpu/nvgpu_common.h> |
19 | #include <nvgpu/timers.h> | 19 | #include <nvgpu/timers.h> |
20 | #include <nvgpu/firmware.h> | 20 | #include <nvgpu/firmware.h> |
21 | #include <nvgpu/falcon.h> | ||
21 | 22 | ||
22 | #include "gk20a/gk20a.h" | 23 | #include "gk20a/gk20a.h" |
23 | #include "gk20a/platform_gk20a.h" | 24 | #include "gk20a/platform_gk20a.h" |
@@ -39,40 +40,8 @@ | |||
39 | static void upload_code(struct gk20a *g, u32 dst, | 40 | static void upload_code(struct gk20a *g, u32 dst, |
40 | u8 *src, u32 size, u8 port, bool sec) | 41 | u8 *src, u32 size, u8 port, bool sec) |
41 | { | 42 | { |
42 | u32 i, words; | 43 | nvgpu_flcn_copy_to_imem(g->pmu.flcn, dst, src, size, port, sec, |
43 | u32 *src_u32 = (u32 *)src; | 44 | dst >> 8); |
44 | u32 blk; | ||
45 | u32 tag = 0; | ||
46 | |||
47 | gk20a_dbg_info("upload %d bytes to %x", size, dst); | ||
48 | |||
49 | words = size >> 2; | ||
50 | |||
51 | blk = dst >> 8; | ||
52 | tag = blk; | ||
53 | |||
54 | gk20a_dbg_info("upload %d words to %x block %d", | ||
55 | words, dst, blk); | ||
56 | |||
57 | gk20a_writel(g, pwr_falcon_imemc_r(port), | ||
58 | pwr_falcon_imemc_offs_f(dst >> 2) | | ||
59 | pwr_falcon_imemc_blk_f(blk) | | ||
60 | pwr_falcon_imemc_aincw_f(1) | | ||
61 | sec << 28); | ||
62 | |||
63 | for (i = 0; i < words; i++) { | ||
64 | if (i % 64 == 0) { | ||
65 | gk20a_writel(g, 0x10a188, tag); | ||
66 | tag++; | ||
67 | } | ||
68 | |||
69 | gk20a_writel(g, pwr_falcon_imemd_r(port), src_u32[i]); | ||
70 | } | ||
71 | |||
72 | while (i % 64) { | ||
73 | gk20a_writel(g, pwr_falcon_imemd_r(port), 0); | ||
74 | i++; | ||
75 | } | ||
76 | } | 45 | } |
77 | 46 | ||
78 | static void upload_data(struct gk20a *g, u32 dst, u8 *src, u32 size, u8 port) | 47 | static void upload_data(struct gk20a *g, u32 dst, u8 *src, u32 size, u8 port) |