1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2021 Rockchip Electronics Co., Ltd.
10 #include <asm/arch-rockchip/clock.h>
11 #include <asm/arch-rockchip/grf_rk3568.h>
12 #include <asm/arch-rockchip/sdram.h>
16 struct rk3568_pmugrf *pmugrf;
19 static int rk3568_dmc_probe(struct udevice *dev)
21 struct dram_info *priv = dev_get_priv(dev);
23 priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF);
24 priv->info.base = CFG_SYS_SDRAM_BASE;
26 rockchip_sdram_size((phys_addr_t)&priv->pmugrf->pmu_os_reg2);
31 static int rk3568_dmc_get_info(struct udevice *dev, struct ram_info *info)
33 struct dram_info *priv = dev_get_priv(dev);
40 static struct ram_ops rk3568_dmc_ops = {
41 .get_info = rk3568_dmc_get_info,
44 static const struct udevice_id rk3568_dmc_ids[] = {
45 { .compatible = "rockchip,rk3568-dmc" },
49 U_BOOT_DRIVER(dmc_rk3568) = {
50 .name = "rockchip_rk3568_dmc",
52 .of_match = rk3568_dmc_ids,
53 .ops = &rk3568_dmc_ops,
54 .probe = rk3568_dmc_probe,
55 .priv_auto = sizeof(struct dram_info),