1 // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
3 * (C) Copyright 2019 Rockchip Electronics Co., Ltd.
10 #include <asm/arch-rockchip/clock.h>
11 #include <asm/arch-rockchip/grf_rk3308.h>
12 #include <asm/arch-rockchip/sdram.h>
16 struct rk3308_grf *grf;
19 static int rk3308_dmc_probe(struct udevice *dev)
21 struct dram_info *priv = dev_get_priv(dev);
23 priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
24 priv->info.base = CFG_SYS_SDRAM_BASE;
25 priv->info.size = rockchip_sdram_size((phys_addr_t)&priv->grf->os_reg2);
30 static int rk3308_dmc_get_info(struct udevice *dev, struct ram_info *info)
32 struct dram_info *priv = dev_get_priv(dev);
39 static struct ram_ops rk3308_dmc_ops = {
40 .get_info = rk3308_dmc_get_info,
43 static const struct udevice_id rk3308_dmc_ids[] = {
44 { .compatible = "rockchip,rk3308-dmc" },
48 U_BOOT_DRIVER(dmc_rk3308) = {
49 .name = "rockchip_rk3308_dmc",
51 .of_match = rk3308_dmc_ids,
52 .ops = &rk3308_dmc_ops,
53 .probe = rk3308_dmc_probe,
54 .priv_auto = sizeof(struct dram_info),