From mboxrd@z Thu Jan 1 00:00:00 1970 From: Westergreen, Dalon Date: Tue, 12 Mar 2019 14:25:46 +0000 Subject: [U-Boot] [PATCH 04/10] arm: socfpga: Update dram_init_banksize() for Stratix10 In-Reply-To: <700cafdc-5ced-cff7-4af7-8520aa062028@denx.de> References: <1552379474-12867-1-git-send-email-ley.foon.tan@intel.com> <1552379474-12867-5-git-send-email-ley.foon.tan@intel.com> <700cafdc-5ced-cff7-4af7-8520aa062028@denx.de> Message-ID: <0bb15c98ad8eaf432773aebe2a257a5baa17e255.camel@intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > > --- > > 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 > > #include > > #include > > +#include > > > > #include > > #include > > @@ -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: