diff options
author | Mahantesh Kumbar <mkumbar@nvidia.com> | 2017-04-21 07:19:12 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-05-03 02:36:07 -0400 |
commit | f30a685f48768b784fb92652d945f43a289e13c4 (patch) | |
tree | 85f262b0f58901c9d3fe173880c2f1fbd51b6c59 /drivers/gpu/nvgpu/common/falcon/falcon.c | |
parent | 0a141c90af622bf2981fe7abbee9b1657ff1eea6 (diff) |
gpu: nvgpu: interface layer for falcon
- struct nvgpu_falcon to hold properties of falcon controller
- falcon controller interface layer which establish access
to required falcon controller HAL based on struct nvgpu_falcon member
flcn_id & flcn_base parameter.
- each falcon nvgpu_falcon struct initialized during init
with id, base-address along with other properties at HAL.
- Added defines related to flacon controller.
Change-Id: Ia7777c01ecc542150ddd72f8603b7b4475522b58
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1467523
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/falcon/falcon.c')
-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 | } | ||