summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c59
1 files changed, 0 insertions, 59 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 39ff605b..5eab4ba0 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -1585,65 +1585,6 @@ void gk20a_reset(struct gk20a *g, u32 units)
1585 gk20a_enable(g, units); 1585 gk20a_enable(g, units);
1586} 1586}
1587 1587
1588static u32 gk20a_determine_L2_size_bytes(struct gk20a *g)
1589{
1590 const u32 gpuid = GK20A_GPUID(g->gpu_characteristics.arch,
1591 g->gpu_characteristics.impl);
1592 u32 lts_per_ltc;
1593 u32 ways;
1594 u32 sets;
1595 u32 bytes_per_line;
1596 u32 active_ltcs;
1597 u32 cache_size;
1598
1599 u32 tmp;
1600 u32 active_sets_value;
1601
1602 tmp = gk20a_readl(g, ltc_ltc0_lts0_tstg_cfg1_r());
1603 ways = hweight32(ltc_ltc0_lts0_tstg_cfg1_active_ways_v(tmp));
1604
1605 active_sets_value = ltc_ltc0_lts0_tstg_cfg1_active_sets_v(tmp);
1606 if (active_sets_value == ltc_ltc0_lts0_tstg_cfg1_active_sets_all_v()) {
1607 sets = 64;
1608 } else if (active_sets_value ==
1609 ltc_ltc0_lts0_tstg_cfg1_active_sets_half_v()) {
1610 sets = 32;
1611 } else if (active_sets_value ==
1612 ltc_ltc0_lts0_tstg_cfg1_active_sets_quarter_v()) {
1613 sets = 16;
1614 } else {
1615 dev_err(dev_from_gk20a(g),
1616 "Unknown constant %u for active sets",
1617 (unsigned)active_sets_value);
1618 sets = 0;
1619 }
1620
1621 active_ltcs = g->gr.num_fbps;
1622
1623 /* chip-specific values */
1624 switch (gpuid) {
1625 case GK20A_GPUID_GK20A:
1626 lts_per_ltc = 1;
1627 bytes_per_line = 128;
1628 break;
1629
1630 case GK20A_GPUID_GM20B:
1631 lts_per_ltc = 2;
1632 bytes_per_line = 128;
1633 break;
1634
1635 default:
1636 dev_err(dev_from_gk20a(g), "Unknown GPU id 0x%02x\n",
1637 (unsigned)gpuid);
1638 lts_per_ltc = 0;
1639 bytes_per_line = 0;
1640 }
1641
1642 cache_size = active_ltcs * lts_per_ltc * ways * sets * bytes_per_line;
1643
1644 return cache_size;
1645}
1646
1647int gk20a_init_gpu_characteristics(struct gk20a *g) 1588int gk20a_init_gpu_characteristics(struct gk20a *g)
1648{ 1589{
1649 struct nvhost_gpu_characteristics *gpu = &g->gpu_characteristics; 1590 struct nvhost_gpu_characteristics *gpu = &g->gpu_characteristics;