diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/falcon')
-rw-r--r-- | drivers/gpu/nvgpu/common/falcon/falcon.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/falcon/falcon.c b/drivers/gpu/nvgpu/common/falcon/falcon.c new file mode 100644 index 00000000..ac1b390f --- /dev/null +++ b/drivers/gpu/nvgpu/common/falcon/falcon.c | |||
@@ -0,0 +1,51 @@ | |||
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 <nvgpu/lock.h> | ||
14 | #include <nvgpu/timers.h> | ||
15 | #include <nvgpu/falcon.h> | ||
16 | |||
17 | #include "gk20a/gk20a.h" | ||
18 | |||
19 | void nvgpu_flcn_sw_init(struct gk20a *g, u32 flcn_id) | ||
20 | { | ||
21 | struct nvgpu_falcon *flcn = NULL; | ||
22 | struct gpu_ops *gops = &g->ops; | ||
23 | |||
24 | switch (flcn_id) { | ||
25 | case FALCON_ID_PMU: | ||
26 | flcn = &g->pmu_flcn; | ||
27 | flcn->flcn_id = flcn_id; | ||
28 | break; | ||
29 | case FALCON_ID_SEC2: | ||
30 | flcn = &g->sec2_flcn; | ||
31 | flcn->flcn_id = flcn_id; | ||
32 | break; | ||
33 | case FALCON_ID_FECS: | ||
34 | flcn = &g->fecs_flcn; | ||
35 | flcn->flcn_id = flcn_id; | ||
36 | break; | ||
37 | case FALCON_ID_GPCCS: | ||
38 | flcn = &g->gpccs_flcn; | ||
39 | flcn->flcn_id = flcn_id; | ||
40 | break; | ||
41 | default: | ||
42 | nvgpu_err(g, "Invalid/Unsupported falcon ID %x", flcn->flcn_id); | ||
43 | break; | ||
44 | }; | ||
45 | |||
46 | /* call to HAL method to assign flcn base & ops to selected falcon */ | ||
47 | if (flcn) { | ||
48 | flcn->g = g; | ||
49 | gops->falcon.falcon_hal_sw_init(flcn); | ||
50 | } | ||
51 | } | ||