All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 04/10] arm: socfpga: Update dram_init_banksize() for Stratix10
Date: Tue, 12 Mar 2019 11:45:36 +0100	[thread overview]
Message-ID: <700cafdc-5ced-cff7-4af7-8520aa062028@denx.de> (raw)
In-Reply-To: <1552379474-12867-5-git-send-email-ley.foon.tan@intel.com>

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@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 ?

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2019-03-12 10:45 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12  8:31 [U-Boot] [PATCH 00/10] Update Stratix 10 SDRAM driver Ley Foon Tan
2019-03-12  8:31 ` [U-Boot] [PATCH 01/10] ddr: altera: stratix10: Move SDRAM size check to " Ley Foon Tan
2019-03-12 10:41   ` Marek Vasut
2019-03-19  3:26     ` Ley Foon Tan
2019-03-19  8:55       ` Marek Vasut
2019-03-19  9:46         ` Ley Foon Tan
2019-03-19  9:47           ` Marek Vasut
2019-03-20  1:30             ` Ley Foon Tan
2019-03-20  9:41               ` Marek Vasut
2019-03-21  5:59                 ` Ley Foon Tan
2019-03-12  8:31 ` [U-Boot] [PATCH 02/10] arm: socfpga: Add sdram_s10.h to sdram.h Ley Foon Tan
2019-03-12  8:31 ` [U-Boot] [PATCH 03/10] ddr: altera: s10: Add multiple memory banks support Ley Foon Tan
2019-03-12 10:44   ` Marek Vasut
2019-03-12 14:05     ` Westergreen, Dalon
2019-03-13  7:28       ` Ley Foon Tan
2019-03-13  9:14         ` Marek Vasut
2019-03-12  8:31 ` [U-Boot] [PATCH 04/10] arm: socfpga: Update dram_init_banksize() for Stratix10 Ley Foon Tan
2019-03-12 10:45   ` Marek Vasut [this message]
2019-03-12 14:25     ` Westergreen, Dalon
2019-03-12  8:31 ` [U-Boot] [PATCH 05/10] board: altera: Stratix10: Add board_get_usable_ram_top() Ley Foon Tan
2019-03-12 10:46   ` Marek Vasut
2019-03-12 14:33     ` Westergreen, Dalon
2019-03-12 14:40       ` Marek Vasut
2019-03-19  3:27         ` Ley Foon Tan
2019-03-12  8:31 ` [U-Boot] [PATCH 06/10] board: altera: Stratix10: Add ft_board_setup() Ley Foon Tan
2019-03-12 10:47   ` Marek Vasut
2019-03-19  3:28     ` Ley Foon Tan
2019-03-12  8:31 ` [U-Boot] [PATCH 07/10] arm: socfpga: Enable OF_BOARD_SETUP for Stratix 10 Ley Foon Tan
2019-03-12  8:31 ` [U-Boot] [PATCH 08/10] configs: stratix10: Change CONFIG_NR_DRAM_BANKS to 2 Ley Foon Tan
2019-03-12  8:31 ` [U-Boot] [PATCH 09/10] arm: socfpga: stratix10: Add cpu_has_been_warmreset() Ley Foon Tan
2019-03-12  8:31 ` [U-Boot] [PATCH 10/10] ddr: altera: Stratix10: Add ECC memory scrubbing Ley Foon Tan
2019-03-12 10:49   ` Marek Vasut
2019-03-19  3:14     ` Ley Foon Tan
2019-03-19  8:57       ` Marek Vasut
2019-03-19  9:49         ` Ley Foon Tan
2019-03-19 12:20           ` Marek Vasut
2019-03-12 11:08 ` [U-Boot] [PATCH 00/10] Update Stratix 10 SDRAM driver Simon Goldschmidt
2019-03-13 18:17   ` Ley Foon Tan
2019-03-14  8:23     ` Simon Goldschmidt

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=700cafdc-5ced-cff7-4af7-8520aa062028@denx.de \
    --to=marex@denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.