From: Sascha Hauer <s.hauer@pengutronix.de>
To: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>, Ahmad Fatoum <ahmad@a3f.at>
Subject: Re: [PATCH 2/5] ARM: Rockchip: implement memory read out from controller
Date: Mon, 27 Mar 2023 09:32:46 +0200 [thread overview]
Message-ID: <20230327073246.GE19113@pengutronix.de> (raw)
In-Reply-To: <b931ac9b682e0cf5130f428d22b2e3f42544f3a7.camel@pengutronix.de>
On Sun, Mar 26, 2023 at 10:34:55AM +0200, Rouven Czerwinski wrote:
> Hi,
>
> On Fri, 2023-03-24 at 15:03 +0100, Sascha Hauer wrote:
> > From: Ahmad Fatoum <ahmad@a3f.at>
> >
> > Add a driver to read out the amount of memory from the DDR controller.
> > The decoding of the registers has been taken from U-Boot. Currently
> > supported are the RK3399 and the RK3568, but decoding should work on
> > other Rockchip SoCs as well.
> >
> > Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> > arch/arm/mach-rockchip/Makefile | 1 +
> > arch/arm/mach-rockchip/dmc.c | 232 ++++++++++++++++++++++++++++
> > include/linux/sizes.h | 3 +
> > include/mach/rockchip/dmc.h | 86 +++++++++++
> > include/mach/rockchip/rk3399-regs.h | 1 +
> > include/mach/rockchip/rk3568-regs.h | 1 +
> > 6 files changed, 324 insertions(+)
> > create mode 100644 arch/arm/mach-rockchip/dmc.c
> > create mode 100644 include/mach/rockchip/dmc.h
> >
[...]
> > +
> > +resource_size_t rk3568_ram0_size(void)
> > +{
> > + void __iomem *pmugrf = IOMEM(RK3568_PMUGRF_BASE);
> > + u32 sys_reg2, sys_reg3;
> > + resource_size_t size;
> > +
> > + sys_reg2 = readl(pmugrf + RK3568_PMUGRF_OS_REG2);
> > + sys_reg3 = readl(pmugrf + RK3568_PMUGRF_OS_REG3);
> > +
> > + size = rockchip_sdram_size(sys_reg2, sys_reg3);
> > + size = min_t(resource_size_t, SZ_4G - SZ_128M, size);
> this ^
> Should be SZ_256M, The frist memory region for RK356x is from 0x0 to
> 0xf000_0000, not 0xf800_0000. Tested on Radxa CM3 RK3566.
True. Maybe we should better write 0xf0000000, because that's the
address value where the DDR stops.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2023-03-27 7:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-24 14:03 [PATCH 0/5] ARM: Rockchip: Read amount of memory from DDR controller Sascha Hauer
2023-03-24 14:03 ` [PATCH 1/5] ARM: dts: rk356x: Add DMC controller node Sascha Hauer
2023-03-24 14:03 ` [PATCH 2/5] ARM: Rockchip: implement memory read out from controller Sascha Hauer
2023-03-26 8:34 ` Rouven Czerwinski
2023-03-27 7:32 ` Sascha Hauer [this message]
2023-03-24 14:03 ` [PATCH 3/5] ARM: Rockchip: Add rk3568 specific barebox entry function Sascha Hauer
2023-03-26 8:36 ` Rouven Czerwinski
2023-03-27 8:31 ` Sascha Hauer
2023-03-24 14:03 ` [PATCH 4/5] ARM: Rockchip: rk3568: use rk3568_barebox_entry() Sascha Hauer
2023-03-24 14:03 ` [PATCH 5/5] ARM: Rockchip: make bootsource logic generic to all SoCs Sascha Hauer
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=20230327073246.GE19113@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=ahmad@a3f.at \
--cc=barebox@lists.infradead.org \
--cc=r.czerwinski@pengutronix.de \
/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