File drivers/gpu/alga/amd/si/dyn_pm/dyn_pm.c changed (mode: 100644) (index 1daaed2..ac64d0d) |
... |
... |
static void thermal_temp_rng_set(struct pci_dev *dev) |
691 |
691 |
wr32(dev, cg_thermal_ctl, CG_THERMAL_CTL); |
wr32(dev, cg_thermal_ctl, CG_THERMAL_CTL); |
692 |
692 |
} |
} |
693 |
693 |
|
|
|
694 |
|
static void smc_tbls_cpy(struct ctx *ctx, |
|
695 |
|
struct smc_state_tbl *smc_state_tbl, |
|
696 |
|
struct smc_cac_cfg_tbl *smc_cac_cfg_tbl, |
|
697 |
|
struct smc_mc_reg_tbl *smc_mc_reg_tbl, |
|
698 |
|
struct smc_mc_arb_tbl *smc_mc_arb_tbl, |
|
699 |
|
struct smc_eng_pll_tbl *smc_eng_pll_tbl, |
|
700 |
|
struct smc_dte_cfg_tbl *smc_dte_cfg_tbl) |
|
701 |
|
{ |
|
702 |
|
u32 smc_ram_tbl_of; |
|
703 |
|
|
|
704 |
|
/*--------------------------------------------------------------------*/ |
|
705 |
|
|
|
706 |
|
smc_ram_tbl_of = smc_r32(ctx->dev, SMC_FW_HDR_START |
|
707 |
|
+ SMC_FW_HDR_STATE_TBL); |
|
708 |
|
smc_memcpy(ctx->dev, smc_ram_tbl_of, (u8*)smc_state_tbl, |
|
709 |
|
sizeof(*smc_state_tbl)); |
|
710 |
|
|
|
711 |
|
/*--------------------------------------------------------------------*/ |
|
712 |
|
|
|
713 |
|
smc_ram_tbl_of = smc_r32(ctx->dev, SMC_FW_HDR_START |
|
714 |
|
+ SMC_FW_HDR_CAC_CFG_TBL); |
|
715 |
|
smc_memcpy(ctx->dev, smc_ram_tbl_of, (u8*)smc_cac_cfg_tbl, |
|
716 |
|
sizeof(*smc_cac_cfg_tbl)); |
|
717 |
|
|
|
718 |
|
/*--------------------------------------------------------------------*/ |
|
719 |
|
|
|
720 |
|
smc_ram_tbl_of = smc_r32(ctx->dev, SMC_FW_HDR_START |
|
721 |
|
+ SMC_FW_HDR_MC_TBL); |
|
722 |
|
smc_memcpy(ctx->dev, smc_ram_tbl_of, (u8*)smc_mc_reg_tbl, |
|
723 |
|
sizeof(*smc_mc_reg_tbl)); |
|
724 |
|
|
|
725 |
|
/*--------------------------------------------------------------------*/ |
|
726 |
|
|
|
727 |
|
smc_ram_tbl_of = smc_r32(ctx->dev, SMC_FW_HDR_START |
|
728 |
|
+ SMC_FW_HDR_MC_ARB_TBL); |
|
729 |
|
smc_memcpy(ctx->dev, smc_ram_tbl_of, (u8*)smc_mc_arb_tbl, |
|
730 |
|
sizeof(*smc_mc_arb_tbl)); |
|
731 |
|
|
|
732 |
|
/*--------------------------------------------------------------------*/ |
|
733 |
|
|
|
734 |
|
smc_ram_tbl_of = smc_r32(ctx->dev, SMC_FW_HDR_START |
|
735 |
|
+ SMC_FW_HDR_ENG_PLL_TBL); |
|
736 |
|
smc_memcpy(ctx->dev, smc_ram_tbl_of, (u8*)smc_eng_pll_tbl, |
|
737 |
|
sizeof(*smc_eng_pll_tbl)); |
|
738 |
|
|
|
739 |
|
/*--------------------------------------------------------------------*/ |
|
740 |
|
|
|
741 |
|
smc_ram_tbl_of = smc_r32(ctx->dev, SMC_FW_HDR_START |
|
742 |
|
+ SMC_FW_HDR_DTE_CFG_TBL); |
|
743 |
|
smc_memcpy(ctx->dev, smc_ram_tbl_of, (u8*)smc_dte_cfg_tbl, |
|
744 |
|
sizeof(*smc_dte_cfg_tbl)); |
|
745 |
|
|
|
746 |
|
/*--------------------------------------------------------------------*/ |
|
747 |
|
} |
|
748 |
|
|
694 |
749 |
//TODO:must perform the hw ops of si_dpm_setup_asic first |
//TODO:must perform the hw ops of si_dpm_setup_asic first |
695 |
750 |
// rv770_get_memory_type is done via the mc_get_ddr5 |
// rv770_get_memory_type is done via the mc_get_ddr5 |
696 |
751 |
// we save the content of clock registers here, but maybe the wrong place |
// we save the content of clock registers here, but maybe the wrong place |
|
... |
... |
long dyn_pm_ena(struct pci_dev *dev) |
839 |
894 |
} |
} |
840 |
895 |
|
|
841 |
896 |
smc_cac_cfg_tbl_init(ctx, smc_cac_cfg_tbl); |
smc_cac_cfg_tbl_init(ctx, smc_cac_cfg_tbl); |
842 |
|
//TODO:cpy all tables in smc ram |
|
|
897 |
|
smc_tbls_cpy(ctx, smc_state_tbl, smc_cac_cfg_tbl, smc_mc_reg_tbl, |
|
898 |
|
smc_mc_arb_tbl, smc_eng_pll_tbl, smc_dte_cfg_tbl); |
843 |
899 |
|
|
844 |
900 |
smc_sw_regs_init(ctx); |
smc_sw_regs_init(ctx); |
845 |
901 |
|
|
File drivers/gpu/alga/amd/si/smc.c changed (mode: 100644) (index b06e773..721fe26) |
... |
... |
void smc_auto_increment_dis(struct pci_dev *dev) |
102 |
102 |
u32 smc_r32(struct pci_dev *dev, u32 addr) |
u32 smc_r32(struct pci_dev *dev, u32 addr) |
103 |
103 |
{ |
{ |
104 |
104 |
wr32(dev, addr, SMC_IDX); |
wr32(dev, addr, SMC_IDX); |
|
105 |
|
/* XXX: the xRBM does big endian reads from smc ram */ |
105 |
106 |
return rr32(dev, SMC_DATA); |
return rr32(dev, SMC_DATA); |
106 |
107 |
} |
} |
107 |
108 |
|
|
108 |
109 |
void smc_w32(struct pci_dev *dev, u32 val, u32 addr) |
void smc_w32(struct pci_dev *dev, u32 val, u32 addr) |
109 |
110 |
{ |
{ |
110 |
111 |
wr32(dev, addr, SMC_IDX); |
wr32(dev, addr, SMC_IDX); |
|
112 |
|
/* XXX: the xRBM does big endian writes to smc ram */ |
111 |
113 |
wr32(dev, val, SMC_DATA); |
wr32(dev, val, SMC_DATA); |
112 |
114 |
} |
} |
113 |
115 |
|
|