[PATCH 1/2] IPQ40xx: Add DRAM detection & FDT fixup

Robert Marko robert.marko at sartura.hr
Fri Aug 7 13:35:17 CEST 2020


On Tue, Aug 4, 2020 at 3:45 PM Tom Rini <trini at konsulko.com> wrote:
>
> On Tue, Aug 04, 2020 at 01:20:56PM +0200, Robert Marko wrote:
> > On Mon, Aug 3, 2020 at 4:39 PM Tom Rini <trini at konsulko.com> wrote:
> > >
> > > On Mon, Aug 03, 2020 at 01:52:19PM +0200, Robert Marko wrote:
> > >
> > > > Fixup the Linux FDT with the detection of onboard DRAM as
> > > > provided by SBL (Secondary boot loader) by reading
> > > > the shared-memory region.
> > > >
> > > > Imported from Snapdragon target.
> > > >
> > > > Signed-off-by: Robert Marko <robert.marko at sartura.hr>
> > > > Cc: Luka Perkov <luka.perkov at sartura.hr>
> > > > ---
> > > >  arch/arm/mach-ipq40xx/Makefile            |  1 +
> > > >  arch/arm/mach-ipq40xx/dram.c              | 99 +++++++++++++++++++++++
> > > >  arch/arm/mach-ipq40xx/include/mach/dram.h | 12 +++
> > > >  3 files changed, 112 insertions(+)
> > > >  create mode 100644 arch/arm/mach-ipq40xx/dram.c
> > > >  create mode 100644 arch/arm/mach-ipq40xx/include/mach/dram.h
> > >
> > > Is this as-is?  If so, we need to figure out something or another to
> > > make sharing the code, rather than copying, possible.  How are these
> > > both grouped in the kernel?  Thanks!
> >
> > Yes, the Snapdragon target uses the identical code.
> > The kernel does not have code for this but rather relies on the
> > bootloader to do it.
>
> Right, but I mean what does the kernel do to avoid copying identical
> code between these two platforms?  I guess the answer is that for
> arch/arm64 everything has been pushed out of arch/arm64/.  So in this
> case, the dram code should get moved to our drivers/ddr/ or drivers/ram/
> depending on which place "dram.c" really belongs best.

Hi, I have been doing some further testing of the DRAM code on multiple boards.
Since it uses SMEM to detect DRAM configuration it's supposed to remove the need
to manually define DRAM size etc.
Unfortunately, what I experienced was that it's not uncommon for
boards to ship with
incorrect DRAM info in SMEM.
So, I have decided to drop this for now as it's not reliable and
manually config DRAM
start, size, etc.

Regards,
Robert
>
> --
> Tom


More information about the U-Boot mailing list