From: Jonas Karlman <jonas@kwiboo.se>
To: Quentin Schulz <u-boot@0leil.net>,
Kever Yang <kever.yang@rock-chips.com>,
Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
u-boot@lists.u-boot-project.org, Jonas Karlman <jonas@kwiboo.se>
Subject: [PATCH 1/9] ram: rockchip: rk3568: Simplify get_info() ops
Date: Tue, 4 Aug 2026 10:57:10 +0000 [thread overview]
Message-ID: <20260804105721.2402406-2-jonas@kwiboo.se> (raw)
In-Reply-To: <20260804105721.2402406-1-jonas@kwiboo.se>
The PMUGRF base address is fixed and known at compile time. However,
the base address is read from DT at runtime in this driver, delaying
reading the two HW regs to determine RAM size by several ms.
Change to use a constant for the PMUGRF base address to speed up reading
RAM size and simplify the driver by removing use of probe and private
data. The driver list entry name is also renamed to match the
compatible, for possible use with OF_PLATDATA.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
drivers/ram/rockchip/sdram_rk3568.c | 29 +++++------------------------
1 file changed, 5 insertions(+), 24 deletions(-)
diff --git a/drivers/ram/rockchip/sdram_rk3568.c b/drivers/ram/rockchip/sdram_rk3568.c
index a252d5c70106..d768b849a0f7 100644
--- a/drivers/ram/rockchip/sdram_rk3568.c
+++ b/drivers/ram/rockchip/sdram_rk3568.c
@@ -3,36 +3,19 @@
* (C) Copyright 2021 Rockchip Electronics Co., Ltd.
*/
-#include <config.h>
#include <dm.h>
#include <ram.h>
-#include <syscon.h>
-#include <asm/arch-rockchip/clock.h>
#include <asm/arch-rockchip/grf_rk3568.h>
#include <asm/arch-rockchip/sdram.h>
-struct dram_info {
- struct ram_info info;
- struct rk3568_pmugrf *pmugrf;
-};
-
-static int rk3568_dmc_probe(struct udevice *dev)
-{
- struct dram_info *priv = dev_get_priv(dev);
-
- priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF);
- priv->info.base = CFG_SYS_SDRAM_BASE;
- priv->info.size =
- rockchip_sdram_size((phys_addr_t)&priv->pmugrf->pmu_os_reg2);
-
- return 0;
-}
+#define PMUGRF_BASE 0xfdc20000
static int rk3568_dmc_get_info(struct udevice *dev, struct ram_info *info)
{
- struct dram_info *priv = dev_get_priv(dev);
+ static struct rk3568_pmugrf * const pmugrf = (void *)PMUGRF_BASE;
- *info = priv->info;
+ info->base = CFG_SYS_SDRAM_BASE;
+ info->size = rockchip_sdram_size((phys_addr_t)&pmugrf->pmu_os_reg2);
return 0;
}
@@ -46,11 +29,9 @@ static const struct udevice_id rk3568_dmc_ids[] = {
{ }
};
-U_BOOT_DRIVER(dmc_rk3568) = {
+U_BOOT_DRIVER(rockchip_rk3568_dmc) = {
.name = "rockchip_rk3568_dmc",
.id = UCLASS_RAM,
.of_match = rk3568_dmc_ids,
.ops = &rk3568_dmc_ops,
- .probe = rk3568_dmc_probe,
- .priv_auto = sizeof(struct dram_info),
};
--
2.54.0
next prev parent reply other threads:[~2026-08-04 10:57 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 10:57 [PATCH 0/9] rockchip: Remove unneeded syscon driver for RK35xx Jonas Karlman
2026-08-04 10:57 ` Jonas Karlman [this message]
2026-08-04 10:57 ` [PATCH 2/9] ram: rockchip: rk3588: Simplify get_info() ops Jonas Karlman
2026-08-04 10:57 ` [PATCH 3/9] video: rockchip: dw_mipi_dsi: Get GRF base address from phandle Jonas Karlman
2026-08-04 10:57 ` [PATCH 4/9] rockchip: rk3568: Remove unneeded syscon driver Jonas Karlman
2026-08-04 10:57 ` [PATCH 5/9] rockchip: rk3588: " Jonas Karlman
2026-08-04 10:57 ` [PATCH 6/9] rockchip: rk3576: " Jonas Karlman
2026-08-04 10:57 ` [PATCH 7/9] rockchip: rk3528: " Jonas Karlman
2026-08-04 10:57 ` [PATCH 8/9] rockchip: rk3506: " Jonas Karlman
2026-08-04 10:57 ` [PATCH 9/9] rockchip: include: Remove unused ROCKCHIP_SYSCON_x enum values Jonas Karlman
2026-08-04 19:19 ` [PATCH 0/9] rockchip: Remove unneeded syscon driver for RK35xx Simon Glass
2026-08-04 19:57 ` Jonas Karlman
2026-08-07 19:46 ` Simon Glass
-- strict thread matches above, loose matches on Subject: below --
2026-07-30 13:29 [PATCH v3 00/12] doc: clean up README.rockchip Johan Jonker
2026-07-30 13:32 ` [PATCH v3 01/12] rockchip: scripts: remove rkmux.py Johan Jonker
2026-07-30 15:43 ` Quentin Schulz
2026-07-30 13:33 ` [PATCH v3 02/12] rockchip: doc: change TPL phrase Johan Jonker
2026-07-30 15:54 ` Quentin Schulz via U-Boot
2026-07-30 13:33 ` [PATCH v3 03/12] rockchip: doc: add BootROM mode text Johan Jonker
2026-07-31 7:47 ` Jonas Karlman
2026-07-30 13:33 ` [PATCH v3 04/12] rockchip: doc: remove TODO Johan Jonker
2026-07-30 13:34 ` [PATCH v3 05/12] rockchip: doc: add more building instructions Johan Jonker
2026-07-30 13:34 ` [PATCH v3 06/12] rockchip: doc: add more eMMC program examples Johan Jonker
2026-07-31 8:20 ` Jonas Karlman
2026-07-30 13:34 ` [PATCH v3 07/12] rockchip: doc: add boot medium layout text Johan Jonker
2026-07-31 8:32 ` Jonas Karlman
[not found] ` <jonas@kwiboo.se>
2026-07-31 15:10 ` Stefan Monnier
2026-07-31 18:01 ` Jonas Karlman
2026-08-04 15:38 ` [PATCH 1/9] ram: rockchip: rk3568: Simplify get_info() ops Stefan Monnier
2026-08-04 18:53 ` Jonas Karlman
2026-07-30 13:35 ` [PATCH v3 08/12] rockchip: tools: add comment section to rksd.c Johan Jonker
2026-07-31 8:41 ` Jonas Karlman
2026-07-30 13:35 ` [PATCH v3 09/12] rockchip: tools: add comment section to rkspi.c Johan Jonker
2026-07-31 8:51 ` Jonas Karlman
2026-07-30 13:35 ` [PATCH v3 10/12] rockchip: tools: add comment section to rkimage.c Johan Jonker
2026-07-30 13:36 ` [PATCH v3 11/12] rockchip: doc: rockusb: remove refer to README.rockchip Johan Jonker
2026-07-30 13:36 ` [PATCH v3 12/12] rockchip: doc: remove README.rockchip Johan Jonker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260804105721.2402406-2-jonas@kwiboo.se \
--to=jonas@kwiboo.se \
--cc=ilias.apalodimas@linaro.org \
--cc=kever.yang@rock-chips.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@0leil.net \
--cc=u-boot@lists.u-boot-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox