diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/flcn_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/flcn_gk20a.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/flcn_gk20a.c b/drivers/gpu/nvgpu/gk20a/flcn_gk20a.c new file mode 100644 index 00000000..404718d0 --- /dev/null +++ b/drivers/gpu/nvgpu/gk20a/flcn_gk20a.c | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | */ | ||
13 | #include "gk20a/gk20a.h" | ||
14 | |||
15 | static void gk20a_falcon_ops(struct nvgpu_falcon *flcn) | ||
16 | { | ||
17 | struct nvgpu_falcon_ops *flcn_ops = &flcn->flcn_ops; | ||
18 | struct nvgpu_falcon_version_ops *flcn_vops = &flcn->flcn_vops; | ||
19 | |||
20 | flcn_ops->reset = NULL; | ||
21 | flcn_ops->enable_irq = NULL; | ||
22 | flcn_ops->fbif_transcfg = NULL; | ||
23 | flcn_ops->read_hwcfg = NULL; | ||
24 | flcn_ops->write_hwcfg = NULL; | ||
25 | flcn_ops->copy_from_dmem = NULL; | ||
26 | flcn_ops->copy_to_dmem = NULL; | ||
27 | flcn_ops->dma_copy = NULL; | ||
28 | flcn_ops->mailbox_read = NULL; | ||
29 | flcn_ops->mailbox_write = NULL; | ||
30 | flcn_ops->get_unit_status = NULL; | ||
31 | flcn_ops->dump_falcon_stats = NULL; | ||
32 | |||
33 | flcn_vops->start_cpu_secure = NULL; | ||
34 | flcn_vops->write_dmatrfbase = NULL; | ||
35 | } | ||
36 | |||
37 | void gk20a_falcon_hal_sw_init(struct nvgpu_falcon *flcn) | ||
38 | { | ||
39 | struct gk20a *g = flcn->g; | ||
40 | |||
41 | |||
42 | switch (flcn->flcn_id) { | ||
43 | case FALCON_ID_PMU: | ||
44 | flcn->flcn_base = FALCON_PWR_BASE; | ||
45 | break; | ||
46 | case FALCON_ID_SEC2: | ||
47 | flcn->flcn_base = FALCON_SEC_BASE; | ||
48 | break; | ||
49 | case FALCON_ID_FECS: | ||
50 | flcn->flcn_base = FALCON_FECS_BASE; | ||
51 | break; | ||
52 | case FALCON_ID_GPCCS: | ||
53 | flcn->flcn_base = FALCON_GPCCS_BASE; | ||
54 | break; | ||
55 | default: | ||
56 | nvgpu_err(g, "Invalid flcn request"); | ||
57 | break; | ||
58 | } | ||
59 | |||
60 | nvgpu_mutex_init(&flcn->copy_lock); | ||
61 | |||
62 | gk20a_falcon_ops(flcn); | ||
63 | } | ||
64 | |||
65 | void gk20a_falcon_init_hal(struct gpu_ops *gops) | ||
66 | { | ||
67 | gops->falcon.falcon_hal_sw_init = gk20a_falcon_hal_sw_init; | ||
68 | } | ||