From: "Heiko Stübner" <heiko@sntech.de>
To: u-boot@lists.denx.de
Subject: [PATCH 1/2] rockchip: spl: do full dram_init instead of only probing
Date: Fri, 15 May 2020 12:33:09 +0200 [thread overview]
Message-ID: <2422168.pZi6jCUGdf@diego> (raw)
In-Reply-To: <063b214f-1058-6d80-f783-c54488901ebd@rock-chips.com>
Hi Kever,
Am Freitag, 15. Mai 2020, 04:07:41 CEST schrieb Kever Yang:
>
> On 2020/5/12 ??6:34, Heiko Stuebner wrote:
> > From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> >
> > Parts of later SPL may need RAM information as well, so do full
> > dram_init() call, which includes the existing dram probing but also
> > initializes the ram information in gd.
>
> NAK.
>
> I would prefer to use DM interface and leave the decision of ram
> initialization to the ram driver.
With CONFIG_SPL_RAM, we get dram_init from mach-rockchip/sdram.c
not some board-specific variant and the in the code change below you
can see that it is guarded by such a defined(CONFIG_SPL_RAM).
That dram_init() function does only:
- uclass_get_device(UCLASS_RAM, 0, &dev);
- ram_get_info(dev, &ram);
- gd->ram_size = ram.size;
So the only difference between the old code and my change is that it
will store information about usable ram in the gd struct, so that other
parts of the SPL can access it - and we of course keep using the DM
interface as before ;-) .
Heiko
> > All Rockchip SoCs use a TPL+SPL combination now, so that's ok for all
> > of them.
> Still not all of the board use the combination.
> >
> > Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> > Change-Id: I2c7496f2d88d65a9f80f74d2139bf307bb4b442b
>
> Please remove the Change-Id next time.
>
> Thanks,
>
> - Kever
>
> > ---
> > arch/arm/mach-rockchip/spl.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c
> > index 0b76af6080..0eda2c3485 100644
> > --- a/arch/arm/mach-rockchip/spl.c
> > +++ b/arch/arm/mach-rockchip/spl.c
> > @@ -135,13 +135,15 @@ void board_init_f(ulong dummy)
> > /* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */
> > timer_init();
> > #endif
> > -#if !defined(CONFIG_TPL) || defined(CONFIG_SPL_OS_BOOT)
> > +#if !defined(CONFIG_TPL) || defined(CONFIG_SPL_RAM)
> > debug("\nspl:init dram\n");
> > - ret = uclass_get_device(UCLASS_RAM, 0, &dev);
> > + ret = dram_init();
> > if (ret) {
> > printf("DRAM init failed: %d\n", ret);
> > return;
> > }
> > + gd->ram_top = gd->ram_base + get_effective_memsize();
> > + gd->ram_top = board_get_usable_ram_top(gd->ram_size);
> > #endif
> > preloader_console_init();
> > }
>
>
>
prev parent reply other threads:[~2020-05-15 10:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-12 10:34 [PATCH 1/2] rockchip: spl: do full dram_init instead of only probing Heiko Stuebner
2020-05-12 10:34 ` [PATCH 2/2] spl: add fixed memory node in target fdt also when loading ATF Heiko Stuebner
2020-05-15 2:10 ` Kever Yang
2020-05-15 2:07 ` [PATCH 1/2] rockchip: spl: do full dram_init instead of only probing Kever Yang
2020-05-15 10:33 ` Heiko Stübner [this message]
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=2422168.pZi6jCUGdf@diego \
--to=heiko@sntech.de \
--cc=u-boot@lists.denx.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