+// SPDX-License-Identifier: GPL-2.0
/*
* (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
- *
- * SPDX-License-Identifier: GPL-2.0
*/
#include <common.h>
#include <asm/arch/sdram.h>
#include <asm/arch/sdram_common.h>
-DECLARE_GLOBAL_DATA_PTR;
-
struct dram_info {
struct ram_info info;
struct clk ddr_clk;
tmp = get_timer(0);
do {
if (get_timer(tmp) > timeout_ms) {
- error("%s: POWER_UP_START did not complete in %ld ms\n",
+ pr_err("%s: POWER_UP_START did not complete in %ld ms\n",
__func__, timeout_ms);
return -ETIME;
}
tmp = get_timer(0);
do {
if (get_timer(tmp) > timeout_ms) {
- error("%s: DFI init did not complete within %ld ms\n",
+ pr_err("%s: DFI init did not complete within %ld ms\n",
__func__, timeout_ms);
return -ETIME;
}
u32 tfaw_as_ps;
if (params->ddr_speed_bin != DDR3_1600K) {
- error("%s: unimplemented DDR3 speed bin %d\n",
+ pr_err("%s: unimplemented DDR3 speed bin %d\n",
__func__, params->ddr_speed_bin);
return -1;
}
tmp = get_timer(0);
do {
if (get_timer(tmp) > timeout_ms) {
- error("%s: did not complete within %ld ms\n",
+ pr_err("%s: did not complete within %ld ms\n",
__func__, timeout_ms);
return -ETIME;
}
}
if (col == 8) {
- error("%s: col detect error\n", __func__);
+ pr_err("%s: col detect error\n", __func__);
return -EINVAL;
}
}
if (row == 11) {
- error("%s: row detect error\n", __func__);
+ pr_err("%s: row detect error\n", __func__);
return -EINVAL;
}
}
}
- error("%s: ddrconf (NIU config) not found\n", __func__);
+ pr_err("%s: ddrconf (NIU config) not found\n", __func__);
return -EINVAL;
}
{
struct rk3368_sdram_params *plat = dev_get_platdata(dev);
struct dtd_rockchip_rk3368_dmc *of_plat = &plat->of_plat;
- int ret;
plat->ddr_freq = of_plat->rockchip_ddr_frequency;
plat->ddr_speed_bin = of_plat->rockchip_ddr_speed_bin;
plat->memory_schedule = of_plat->rockchip_memory_schedule;
- ret = regmap_init_mem_platdata(dev, of_plat->reg,
- ARRAY_SIZE(of_plat->reg) / 2,
- &plat->map);
- if (ret)
- return ret;
-
return 0;
}
#endif
debug("%s: pmugrf=%p\n", __func__, priv->pmugrf);
#ifdef CONFIG_TPL_BUILD
- pctl = regmap_get_range(plat->map, 0);
- ddrphy = regmap_get_range(plat->map, 1);
+ pctl = (struct rk3368_ddr_pctl *)plat->of_plat.reg[0];
+ ddrphy = (struct rk3368_ddrphy *)plat->of_plat.reg[2];
msch = syscon_get_first_range(ROCKCHIP_SYSCON_MSCH);
grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);