mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
- 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>
52 lines
1.3 KiB
C
52 lines
1.3 KiB
C
/*
|
|
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms and conditions of the GNU General Public License,
|
|
* version 2, as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*/
|
|
#include <nvgpu/lock.h>
|
|
#include <nvgpu/timers.h>
|
|
#include <nvgpu/falcon.h>
|
|
|
|
#include "gk20a/gk20a.h"
|
|
|
|
void nvgpu_flcn_sw_init(struct gk20a *g, u32 flcn_id)
|
|
{
|
|
struct nvgpu_falcon *flcn = NULL;
|
|
struct gpu_ops *gops = &g->ops;
|
|
|
|
switch (flcn_id) {
|
|
case FALCON_ID_PMU:
|
|
flcn = &g->pmu_flcn;
|
|
flcn->flcn_id = flcn_id;
|
|
break;
|
|
case FALCON_ID_SEC2:
|
|
flcn = &g->sec2_flcn;
|
|
flcn->flcn_id = flcn_id;
|
|
break;
|
|
case FALCON_ID_FECS:
|
|
flcn = &g->fecs_flcn;
|
|
flcn->flcn_id = flcn_id;
|
|
break;
|
|
case FALCON_ID_GPCCS:
|
|
flcn = &g->gpccs_flcn;
|
|
flcn->flcn_id = flcn_id;
|
|
break;
|
|
default:
|
|
nvgpu_err(g, "Invalid/Unsupported falcon ID %x", flcn->flcn_id);
|
|
break;
|
|
};
|
|
|
|
/* call to HAL method to assign flcn base & ops to selected falcon */
|
|
if (flcn) {
|
|
flcn->g = g;
|
|
gops->falcon.falcon_hal_sw_init(flcn);
|
|
}
|
|
}
|