ram: rockchip: Add rk3576 ddr driver support

Add ddr driver for rk3576 to get the ram capacity.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
Heiko Stuebner
2025-04-15 23:51:20 +02:00
committed by Kever Yang
parent e4225b22ce
commit c0d9ac0b00
2 changed files with 36 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ obj-$(CONFIG_ROCKCHIP_RK3328) = sdram_rk3328.o sdram_pctl_px30.o sdram_phy_px30.
obj-$(CONFIG_ROCKCHIP_RK3399) += sdram_rk3399.o
obj-$(CONFIG_ROCKCHIP_RK3528) += sdram_rk3528.o
obj-$(CONFIG_ROCKCHIP_RK3568) += sdram_rk3568.o
obj-$(CONFIG_ROCKCHIP_RK3576) += sdram_rk3576.o
obj-$(CONFIG_ROCKCHIP_RK3588) += sdram_rk3588.o
obj-$(CONFIG_ROCKCHIP_RV1126) += sdram_rv1126.o sdram_pctl_px30.o
obj-$(CONFIG_ROCKCHIP_SDRAM_COMMON) += sdram_common.o

View File

@@ -0,0 +1,35 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* (C) Copyright 2024 Rockchip Electronics Co., Ltd.
*/
#include <dm.h>
#include <ram.h>
#include <asm/arch-rockchip/sdram.h>
#define PMU1GRF_BASE 0x26026000
#define OS_REG2_REG 0x208
static int rk3576_dmc_get_info(struct udevice *dev, struct ram_info *info)
{
info->base = CFG_SYS_SDRAM_BASE;
info->size = rockchip_sdram_size(PMU1GRF_BASE + OS_REG2_REG);
return 0;
}
static struct ram_ops rk3576_dmc_ops = {
.get_info = rk3576_dmc_get_info,
};
static const struct udevice_id rk3576_dmc_ids[] = {
{ .compatible = "rockchip,rk3576-dmc" },
{ }
};
U_BOOT_DRIVER(rockchip_rk3576_dmc) = {
.name = "rockchip_rk3576_dmc",
.id = UCLASS_RAM,
.of_match = rk3576_dmc_ids,
.ops = &rk3576_dmc_ops,
};