[U-Boot] [PATCH 04/10] arm: socfpga: Update dram_init_banksize() for Stratix10

Westergreen, Dalon dalon.westergreen at intel.com
Tue Mar 12 14:25:46 UTC 2019


On Tue, 2019-03-12 at 11:45 +0100, Marek Vasut wrote:
> On 3/12/19 9:31 AM, Ley Foon Tan wrote:
> > Setup bi_dram struct based on returned from setup_memory_banks().
> > 
> > Signed-off-by: Ley Foon Tan <ley.foon.tan at intel.com>
> > ---
> >  arch/arm/mach-socfpga/board.c | 16 +++++++++++++++-
> >  1 file changed, 15 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c
> > index 7c8c05cc31..a0e9917e47 100644
> > --- a/arch/arm/mach-socfpga/board.c
> > +++ b/arch/arm/mach-socfpga/board.c
> > @@ -12,6 +12,7 @@
> >  #include <asm/arch/clock_manager.h>
> >  #include <asm/arch/misc.h>
> >  #include <asm/io.h>
> > +#include <asm/arch/sdram.h>
> >  
> >  #include <usb.h>
> >  #include <usb/dwc2_udc.h>
> > @@ -48,8 +49,21 @@ int board_init(void)
> >  
> >  int dram_init_banksize(void)
> >  {
> > -	fdtdec_setup_memory_banksize();
> > +#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10) &&
> > defined(CONFIG_ALTERA_SDRAM)
> > +	phys_addr_t bank_start[CONFIG_NR_DRAM_BANKS];
> > +	phys_size_t bank_size[CONFIG_NR_DRAM_BANKS];
> > +	int bank;
> > +
> > +	gd->ram_size = sdram_calculate_size();
> > +	setup_memory_banks(bank_start, bank_size);
> >  
> > +	for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) {
> > +		gd->bd->bi_dram[bank].start = bank_start[bank];
> > +		gd->bd->bi_dram[bank].size = bank_size[bank];
> > +	}
> > +#else
> > +	fdtdec_setup_memory_banksize();
> > +#endif
> >  	return 0;
> >  }
> 
> Split this out into separate file if this really needs to be different,
> but can't you somehow use fdtdec_setup_memory_size() on S10 and then
> apply sanity checking instead ?
> 
yes, this can be done with fdtdec_setup_memory_size.

--dalon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3282 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190312/e8c39d02/attachment.bin>


More information about the U-Boot mailing list