2021-03-03 10:58:07 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <soc/dramc_common.h>
|
|
|
|
#include <soc/dramc_param.h>
|
|
|
|
#include <soc/emi.h>
|
|
|
|
|
|
|
|
struct dramc_param *dramc_params;
|
|
|
|
|
|
|
|
bool is_dvfs_enabled(void)
|
|
|
|
{
|
|
|
|
dramc_info("dram_init: config_dvfs: %d\n",
|
|
|
|
dramc_params->dramc_datas.ddr_info.config_dvfs);
|
|
|
|
return !!(dramc_params->dramc_datas.ddr_info.config_dvfs);
|
|
|
|
}
|
|
|
|
|
|
|
|
u32 get_ddr_geometry(void)
|
|
|
|
{
|
|
|
|
dramc_info("dram_init: ddr_geometry: %d\n",
|
2021-04-12 05:03:57 +02:00
|
|
|
dramc_params->dramc_datas.ddr_info.sdram.ddr_geometry);
|
|
|
|
return dramc_params->dramc_datas.ddr_info.sdram.ddr_geometry;
|
2021-03-03 10:58:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
u32 get_ddr_type(void)
|
|
|
|
{
|
|
|
|
dramc_info("dram_init: ddr_type: %d\n",
|
2021-04-12 05:03:57 +02:00
|
|
|
dramc_params->dramc_datas.ddr_info.sdram.ddr_type);
|
|
|
|
return dramc_params->dramc_datas.ddr_info.sdram.ddr_type;
|
2021-03-03 10:58:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void init_dram_by_params(struct dramc_param *dparam)
|
|
|
|
{
|
|
|
|
dramc_params = dparam;
|
|
|
|
mt_set_emi(dramc_params);
|
|
|
|
}
|