mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: gp10b: Implement L2 query
Bug 1567274 Change-Id: I0b8eaebc0949e70f6d8bfbb101048a3d95bec5e3 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/602858 Reviewed-by: Automatic_Commit_Validation_User
This commit is contained in:
committed by
Deepak Nibade
parent
68ad020887
commit
7918de1c1b
@@ -11,6 +11,7 @@ ccflags-$(CONFIG_GK20A) += -Wno-multichar
|
||||
obj-$(CONFIG_GK20A) += \
|
||||
gr_gp10b.o \
|
||||
mc_gp10b.o \
|
||||
ltc_gp10b.o \
|
||||
hal_gp10b.o
|
||||
|
||||
obj-$(CONFIG_TEGRA_GK20A) += platform_gp10b_tegra.o
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
|
||||
#include "gp10b/gr_gp10b.h"
|
||||
#include "gp10b/mc_gp10b.h"
|
||||
#include "gp10b/ltc_gp10b.h"
|
||||
|
||||
#include "gm20b/gr_gm20b.h"
|
||||
#include "gm20b/ltc_gm20b.h"
|
||||
#include "gm20b/fb_gm20b.h"
|
||||
#include "gm20b/gm20b_gating_reglist.h"
|
||||
#include "gm20b/fifo_gm20b.h"
|
||||
@@ -89,9 +89,8 @@ int gp10b_init_hal(struct gk20a *g)
|
||||
|
||||
*gops = gp10b_ops;
|
||||
gp10b_init_mc(gops);
|
||||
gm20b_init_ltc(gops);
|
||||
gp10b_init_gr(gops);
|
||||
gm20b_init_ltc(gops);
|
||||
gp10b_init_ltc(gops);
|
||||
gm20b_init_fb(gops);
|
||||
gm20b_init_fifo(gops);
|
||||
gm20b_init_gr_ctx(gops);
|
||||
|
||||
@@ -494,4 +494,16 @@ static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_clean_pending_f(void)
|
||||
{
|
||||
return 0x1;
|
||||
}
|
||||
static inline u32 ltc_ltc0_lts0_tstg_info_1_r(void)
|
||||
{
|
||||
return 0x0014058c;
|
||||
}
|
||||
static inline u32 ltc_ltc0_lts0_tstg_info_1_slice_size_in_kb_v(u32 r)
|
||||
{
|
||||
return (r >> 0) & 0xffff;
|
||||
}
|
||||
static inline u32 ltc_ltc0_lts0_tstg_info_1_slices_per_l2_v(u32 r)
|
||||
{
|
||||
return (r >> 16) & 0x1f;
|
||||
}
|
||||
#endif
|
||||
|
||||
47
drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
Normal file
47
drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
Normal file
@@ -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 <linux/types.h>
|
||||
|
||||
#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;
|
||||
}
|
||||
19
drivers/gpu/nvgpu/gp10b/ltc_gp10b.h
Normal file
19
drivers/gpu/nvgpu/gp10b/ltc_gp10b.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef LTC_GP10B_H
|
||||
#define LTC_GP10B_H
|
||||
struct gpu_ops;
|
||||
|
||||
void gp10b_init_ltc(struct gpu_ops *gops);
|
||||
#endif
|
||||
Reference in New Issue
Block a user