From 7918de1c1b05ae126f830588de1cac533ef1c0cf Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 13 Nov 2014 13:30:52 +0200 Subject: gpu: nvgpu: gp10b: Implement L2 query Bug 1567274 Change-Id: I0b8eaebc0949e70f6d8bfbb101048a3d95bec5e3 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/602858 Reviewed-by: Automatic_Commit_Validation_User --- drivers/gpu/nvgpu/gp10b/ltc_gp10b.c | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 drivers/gpu/nvgpu/gp10b/ltc_gp10b.c (limited to 'drivers/gpu/nvgpu/gp10b/ltc_gp10b.c') diff --git a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c new file mode 100644 index 00000000..9f5c16ba --- /dev/null +++ b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c @@ -0,0 +1,47 @@ +/* + * GP10B L2 + * + * Copyright (c) 2014, 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 + +#include "gk20a/gk20a.h" +#include "gm20b/ltc_gm20b.h" +#include "hw_ltc_gp10b.h" + +static int gp10b_determine_L2_size_bytes(struct gk20a *g) +{ + u32 tmp; + int ret; + + gk20a_dbg_fn(""); + + tmp = gk20a_readl(g, ltc_ltc0_lts0_tstg_info_1_r()); + + ret = g->ltc_count * + ltc_ltc0_lts0_tstg_info_1_slice_size_in_kb_v(tmp) * + ltc_ltc0_lts0_tstg_info_1_slices_per_l2_v(tmp); + + gk20a_dbg(gpu_dbg_info, "L2 size: %d\n", ret); + + gk20a_dbg_fn("done"); + + return ret; +} + +void gp10b_init_ltc(struct gpu_ops *gops) +{ + gm20b_init_ltc(gops); + + gops->ltc.determine_L2_size_bytes = gp10b_determine_L2_size_bytes; +} -- cgit v1.2.2