summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/clk/clk_prog.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/clk/clk_prog.c')
-rw-r--r--drivers/gpu/nvgpu/clk/clk_prog.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_prog.c b/drivers/gpu/nvgpu/clk/clk_prog.c
index 5966d64a..ae8f8e01 100644
--- a/drivers/gpu/nvgpu/clk/clk_prog.c
+++ b/drivers/gpu/nvgpu/clk/clk_prog.c
@@ -34,14 +34,14 @@
34#include "ctrl/ctrlvolt.h" 34#include "ctrl/ctrlvolt.h"
35 35
36static struct clk_prog *construct_clk_prog(struct gk20a *g, void *pargs); 36static struct clk_prog *construct_clk_prog(struct gk20a *g, void *pargs);
37static u32 devinit_get_clk_prog_table(struct gk20a *g, 37static int devinit_get_clk_prog_table(struct gk20a *g,
38 struct clk_progs *pprogobjs); 38 struct clk_progs *pprogobjs);
39static vf_flatten vfflatten_prog_1x_master; 39static vf_flatten vfflatten_prog_1x_master;
40static vf_lookup vflookup_prog_1x_master; 40static vf_lookup vflookup_prog_1x_master;
41static get_fpoints getfpoints_prog_1x_master; 41static get_fpoints getfpoints_prog_1x_master;
42static get_slaveclk getslaveclk_prog_1x_master; 42static get_slaveclk getslaveclk_prog_1x_master;
43 43
44static u32 _clk_progs_pmudatainit(struct gk20a *g, 44static int _clk_progs_pmudatainit(struct gk20a *g,
45 struct boardobjgrp *pboardobjgrp, 45 struct boardobjgrp *pboardobjgrp,
46 struct nv_pmu_boardobjgrp_super *pboardobjgrppmu) 46 struct nv_pmu_boardobjgrp_super *pboardobjgrppmu)
47{ 47{
@@ -64,7 +64,7 @@ done:
64 return status; 64 return status;
65} 65}
66 66
67static u32 _clk_progs_pmudata_instget(struct gk20a *g, 67static int _clk_progs_pmudata_instget(struct gk20a *g,
68 struct nv_pmu_boardobjgrp *pmuboardobjgrp, 68 struct nv_pmu_boardobjgrp *pmuboardobjgrp,
69 struct nv_pmu_boardobj **ppboardobjpmudata, 69 struct nv_pmu_boardobj **ppboardobjpmudata,
70 u8 idx) 70 u8 idx)
@@ -86,9 +86,9 @@ static u32 _clk_progs_pmudata_instget(struct gk20a *g,
86 return 0; 86 return 0;
87} 87}
88 88
89u32 clk_prog_sw_setup(struct gk20a *g) 89int clk_prog_sw_setup(struct gk20a *g)
90{ 90{
91 u32 status; 91 int status;
92 struct boardobjgrp *pboardobjgrp = NULL; 92 struct boardobjgrp *pboardobjgrp = NULL;
93 struct clk_progs *pclkprogobjs; 93 struct clk_progs *pclkprogobjs;
94 94
@@ -136,9 +136,9 @@ done:
136 return status; 136 return status;
137} 137}
138 138
139u32 clk_prog_pmu_setup(struct gk20a *g) 139int clk_prog_pmu_setup(struct gk20a *g)
140{ 140{
141 u32 status; 141 int status;
142 struct boardobjgrp *pboardobjgrp = NULL; 142 struct boardobjgrp *pboardobjgrp = NULL;
143 143
144 nvgpu_log_info(g, " "); 144 nvgpu_log_info(g, " ");
@@ -155,10 +155,10 @@ u32 clk_prog_pmu_setup(struct gk20a *g)
155 return status; 155 return status;
156} 156}
157 157
158static u32 devinit_get_clk_prog_table(struct gk20a *g, 158static int devinit_get_clk_prog_table(struct gk20a *g,
159 struct clk_progs *pclkprogobjs) 159 struct clk_progs *pclkprogobjs)
160{ 160{
161 u32 status = 0; 161 int status = 0;
162 u8 *clkprogs_tbl_ptr = NULL; 162 u8 *clkprogs_tbl_ptr = NULL;
163 struct vbios_clock_programming_table_1x_header header = { 0 }; 163 struct vbios_clock_programming_table_1x_header header = { 0 };
164 struct vbios_clock_programming_table_1x_entry prog = { 0 }; 164 struct vbios_clock_programming_table_1x_entry prog = { 0 };
@@ -379,11 +379,11 @@ done:
379 return status; 379 return status;
380} 380}
381 381
382static u32 _clk_prog_pmudatainit_super(struct gk20a *g, 382static int _clk_prog_pmudatainit_super(struct gk20a *g,
383 struct boardobj *board_obj_ptr, 383 struct boardobj *board_obj_ptr,
384 struct nv_pmu_boardobj *ppmudata) 384 struct nv_pmu_boardobj *ppmudata)
385{ 385{
386 u32 status = 0; 386 int status = 0;
387 387
388 nvgpu_log_info(g, " "); 388 nvgpu_log_info(g, " ");
389 389
@@ -391,11 +391,11 @@ static u32 _clk_prog_pmudatainit_super(struct gk20a *g,
391 return status; 391 return status;
392} 392}
393 393
394static u32 _clk_prog_pmudatainit_1x(struct gk20a *g, 394static int _clk_prog_pmudatainit_1x(struct gk20a *g,
395 struct boardobj *board_obj_ptr, 395 struct boardobj *board_obj_ptr,
396 struct nv_pmu_boardobj *ppmudata) 396 struct nv_pmu_boardobj *ppmudata)
397{ 397{
398 u32 status = 0; 398 int status = 0;
399 struct clk_prog_1x *pclk_prog_1x; 399 struct clk_prog_1x *pclk_prog_1x;
400 struct nv_pmu_clk_clk_prog_1x_boardobj_set *pset; 400 struct nv_pmu_clk_clk_prog_1x_boardobj_set *pset;
401 401
@@ -418,11 +418,11 @@ static u32 _clk_prog_pmudatainit_1x(struct gk20a *g,
418 return status; 418 return status;
419} 419}
420 420
421static u32 _clk_prog_pmudatainit_1x_master(struct gk20a *g, 421static int _clk_prog_pmudatainit_1x_master(struct gk20a *g,
422 struct boardobj *board_obj_ptr, 422 struct boardobj *board_obj_ptr,
423 struct nv_pmu_boardobj *ppmudata) 423 struct nv_pmu_boardobj *ppmudata)
424{ 424{
425 u32 status = 0; 425 int status = 0;
426 struct clk_prog_1x_master *pclk_prog_1x_master; 426 struct clk_prog_1x_master *pclk_prog_1x_master;
427 struct nv_pmu_clk_clk_prog_1x_master_boardobj_set *pset; 427 struct nv_pmu_clk_clk_prog_1x_master_boardobj_set *pset;
428 u32 vfsize = sizeof(struct ctrl_clk_clk_prog_1x_master_vf_entry) * 428 u32 vfsize = sizeof(struct ctrl_clk_clk_prog_1x_master_vf_entry) *
@@ -449,11 +449,11 @@ static u32 _clk_prog_pmudatainit_1x_master(struct gk20a *g,
449 return status; 449 return status;
450} 450}
451 451
452static u32 _clk_prog_pmudatainit_1x_master_ratio(struct gk20a *g, 452static int _clk_prog_pmudatainit_1x_master_ratio(struct gk20a *g,
453 struct boardobj *board_obj_ptr, 453 struct boardobj *board_obj_ptr,
454 struct nv_pmu_boardobj *ppmudata) 454 struct nv_pmu_boardobj *ppmudata)
455{ 455{
456 u32 status = 0; 456 int status = 0;
457 struct clk_prog_1x_master_ratio *pclk_prog_1x_master_ratio; 457 struct clk_prog_1x_master_ratio *pclk_prog_1x_master_ratio;
458 struct nv_pmu_clk_clk_prog_1x_master_ratio_boardobj_set *pset; 458 struct nv_pmu_clk_clk_prog_1x_master_ratio_boardobj_set *pset;
459 u32 slavesize = sizeof(struct ctrl_clk_clk_prog_1x_master_ratio_slave_entry) * 459 u32 slavesize = sizeof(struct ctrl_clk_clk_prog_1x_master_ratio_slave_entry) *
@@ -478,11 +478,11 @@ static u32 _clk_prog_pmudatainit_1x_master_ratio(struct gk20a *g,
478 return status; 478 return status;
479} 479}
480 480
481static u32 _clk_prog_pmudatainit_1x_master_table(struct gk20a *g, 481static int _clk_prog_pmudatainit_1x_master_table(struct gk20a *g,
482 struct boardobj *board_obj_ptr, 482 struct boardobj *board_obj_ptr,
483 struct nv_pmu_boardobj *ppmudata) 483 struct nv_pmu_boardobj *ppmudata)
484{ 484{
485 u32 status = 0; 485 int status = 0;
486 struct clk_prog_1x_master_table *pclk_prog_1x_master_table; 486 struct clk_prog_1x_master_table *pclk_prog_1x_master_table;
487 struct nv_pmu_clk_clk_prog_1x_master_table_boardobj_set *pset; 487 struct nv_pmu_clk_clk_prog_1x_master_table_boardobj_set *pset;
488 u32 slavesize = sizeof(struct ctrl_clk_clk_prog_1x_master_ratio_slave_entry) * 488 u32 slavesize = sizeof(struct ctrl_clk_clk_prog_1x_master_ratio_slave_entry) *
@@ -538,12 +538,12 @@ done:
538 return status; 538 return status;
539} 539}
540 540
541static u32 clk_prog_construct_super(struct gk20a *g, 541static int clk_prog_construct_super(struct gk20a *g,
542 struct boardobj **ppboardobj, 542 struct boardobj **ppboardobj,
543 u16 size, void *pargs) 543 u16 size, void *pargs)
544{ 544{
545 struct clk_prog *pclkprog; 545 struct clk_prog *pclkprog;
546 u32 status = 0; 546 int status = 0;
547 547
548 status = boardobj_construct_super(g, ppboardobj, 548 status = boardobj_construct_super(g, ppboardobj,
549 size, pargs); 549 size, pargs);
@@ -559,7 +559,7 @@ static u32 clk_prog_construct_super(struct gk20a *g,
559} 559}
560 560
561 561
562static u32 clk_prog_construct_1x(struct gk20a *g, 562static int clk_prog_construct_1x(struct gk20a *g,
563 struct boardobj **ppboardobj, 563 struct boardobj **ppboardobj,
564 u16 size, void *pargs) 564 u16 size, void *pargs)
565{ 565{
@@ -567,7 +567,7 @@ static u32 clk_prog_construct_1x(struct gk20a *g,
567 struct clk_prog_1x *pclkprog; 567 struct clk_prog_1x *pclkprog;
568 struct clk_prog_1x *ptmpprog = 568 struct clk_prog_1x *ptmpprog =
569 (struct clk_prog_1x *)pargs; 569 (struct clk_prog_1x *)pargs;
570 u32 status = 0; 570 int status = 0;
571 571
572 nvgpu_log_info(g, " "); 572 nvgpu_log_info(g, " ");
573 ptmpobj->type_mask |= BIT(CTRL_CLK_CLK_PROG_TYPE_1X); 573 ptmpobj->type_mask |= BIT(CTRL_CLK_CLK_PROG_TYPE_1X);
@@ -588,7 +588,7 @@ static u32 clk_prog_construct_1x(struct gk20a *g,
588 return status; 588 return status;
589} 589}
590 590
591static u32 clk_prog_construct_1x_master(struct gk20a *g, 591static int clk_prog_construct_1x_master(struct gk20a *g,
592 struct boardobj **ppboardobj, 592 struct boardobj **ppboardobj,
593 u16 size, void *pargs) 593 u16 size, void *pargs)
594{ 594{
@@ -596,7 +596,7 @@ static u32 clk_prog_construct_1x_master(struct gk20a *g,
596 struct clk_prog_1x_master *pclkprog; 596 struct clk_prog_1x_master *pclkprog;
597 struct clk_prog_1x_master *ptmpprog = 597 struct clk_prog_1x_master *ptmpprog =
598 (struct clk_prog_1x_master *)pargs; 598 (struct clk_prog_1x_master *)pargs;
599 u32 status = 0; 599 int status = 0;
600 u32 vfsize = sizeof(struct ctrl_clk_clk_prog_1x_master_vf_entry) * 600 u32 vfsize = sizeof(struct ctrl_clk_clk_prog_1x_master_vf_entry) *
601 g->clk_pmu.clk_progobjs.vf_entry_count; 601 g->clk_pmu.clk_progobjs.vf_entry_count;
602 u8 railidx; 602 u8 railidx;
@@ -645,7 +645,7 @@ static u32 clk_prog_construct_1x_master(struct gk20a *g,
645 return status; 645 return status;
646} 646}
647 647
648static u32 clk_prog_construct_1x_master_ratio(struct gk20a *g, 648static int clk_prog_construct_1x_master_ratio(struct gk20a *g,
649 struct boardobj **ppboardobj, 649 struct boardobj **ppboardobj,
650 u16 size, void *pargs) 650 u16 size, void *pargs)
651{ 651{
@@ -653,7 +653,7 @@ static u32 clk_prog_construct_1x_master_ratio(struct gk20a *g,
653 struct clk_prog_1x_master_ratio *pclkprog; 653 struct clk_prog_1x_master_ratio *pclkprog;
654 struct clk_prog_1x_master_ratio *ptmpprog = 654 struct clk_prog_1x_master_ratio *ptmpprog =
655 (struct clk_prog_1x_master_ratio *)pargs; 655 (struct clk_prog_1x_master_ratio *)pargs;
656 u32 status = 0; 656 int status = 0;
657 u32 slavesize = sizeof(struct ctrl_clk_clk_prog_1x_master_ratio_slave_entry) * 657 u32 slavesize = sizeof(struct ctrl_clk_clk_prog_1x_master_ratio_slave_entry) *
658 g->clk_pmu.clk_progobjs.slave_entry_count; 658 g->clk_pmu.clk_progobjs.slave_entry_count;
659 659
@@ -687,7 +687,7 @@ static u32 clk_prog_construct_1x_master_ratio(struct gk20a *g,
687 return status; 687 return status;
688} 688}
689 689
690static u32 clk_prog_construct_1x_master_table(struct gk20a *g, 690static int clk_prog_construct_1x_master_table(struct gk20a *g,
691 struct boardobj **ppboardobj, 691 struct boardobj **ppboardobj,
692 u16 size, void *pargs) 692 u16 size, void *pargs)
693{ 693{
@@ -695,7 +695,7 @@ static u32 clk_prog_construct_1x_master_table(struct gk20a *g,
695 struct clk_prog_1x_master_table *pclkprog; 695 struct clk_prog_1x_master_table *pclkprog;
696 struct clk_prog_1x_master_table *ptmpprog = 696 struct clk_prog_1x_master_table *ptmpprog =
697 (struct clk_prog_1x_master_table *)pargs; 697 (struct clk_prog_1x_master_table *)pargs;
698 u32 status = 0; 698 int status = 0;
699 u32 slavesize = sizeof(struct ctrl_clk_clk_prog_1x_master_ratio_slave_entry) * 699 u32 slavesize = sizeof(struct ctrl_clk_clk_prog_1x_master_ratio_slave_entry) *
700 g->clk_pmu.clk_progobjs.slave_entry_count; 700 g->clk_pmu.clk_progobjs.slave_entry_count;
701 701
@@ -741,7 +741,7 @@ exit:
741static struct clk_prog *construct_clk_prog(struct gk20a *g, void *pargs) 741static struct clk_prog *construct_clk_prog(struct gk20a *g, void *pargs)
742{ 742{
743 struct boardobj *board_obj_ptr = NULL; 743 struct boardobj *board_obj_ptr = NULL;
744 u32 status; 744 int status;
745 745
746 nvgpu_log_info(g, " type - %x", BOARDOBJ_GET_TYPE(pargs)); 746 nvgpu_log_info(g, " type - %x", BOARDOBJ_GET_TYPE(pargs));
747 switch (BOARDOBJ_GET_TYPE(pargs)) { 747 switch (BOARDOBJ_GET_TYPE(pargs)) {