All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ley Foon Tan <lftan.linux@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 06/10] board: altera: Stratix10: Add ft_board_setup()
Date: Tue, 19 Mar 2019 11:28:19 +0800	[thread overview]
Message-ID: <CAFiDJ59soJuTD-CuVBv9=AS7BzB_R3THb2-NKFGsP36Dr906bA@mail.gmail.com> (raw)
In-Reply-To: <3f01ed4b-04b2-f37a-408a-2cff2abb46d7@denx.de>

On Tue, Mar 12, 2019 at 7:03 PM Marek Vasut <marex@denx.de> wrote:
>
> On 3/12/19 9:31 AM, Ley Foon Tan wrote:
> > Add ft_board_setup() function to setup memory banks before
> > boot to Linux.
>
> Shouldn't bootm/booti be doing just that already ?
Don't need this if we use fdtdec_setup_memory_banksize().

>
> > Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
> > ---
> >  board/altera/stratix10-socdk/socfpga.c | 25 +++++++++++++++++++++++++
> >  1 file changed, 25 insertions(+)
> >
> > diff --git a/board/altera/stratix10-socdk/socfpga.c b/board/altera/stratix10-socdk/socfpga.c
> > index 99c10d313c..ca6e0e9085 100644
> > --- a/board/altera/stratix10-socdk/socfpga.c
> > +++ b/board/altera/stratix10-socdk/socfpga.c
> > @@ -5,6 +5,7 @@
> >   */
> >
> >  #include <common.h>
> > +#include <fdt_support.h>
> >  #include <asm/arch/sdram.h>
> >  #include <linux/sizes.h>
> >
> > @@ -17,3 +18,27 @@ ulong board_get_usable_ram_top(ulong total_size)
> >               return sdram_calculate_size();
> >  }
> >  #endif
> > +
> > +#ifdef CONFIG_OF_BOARD_SETUP
> > +int ft_board_setup(void *blob, bd_t *bd)
> > +{
> > +     int ret = 0;
> > +#ifdef CONFIG_OF_LIBFDT
> > +     int bank;
> > +     int actual_bank = 0;
> > +     u64 start[CONFIG_NR_DRAM_BANKS];
> > +     u64 size[CONFIG_NR_DRAM_BANKS];
> > +
> > +     for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) {
> > +             if (bd->bi_dram[bank].size) {
> > +                     start[actual_bank] = bd->bi_dram[bank].start;
> > +                     size[actual_bank++] = bd->bi_dram[bank].size;
> > +             }
> > +     }
> > +
> > +     ret = fdt_fixup_memory_banks(blob, start, size, actual_bank);
> > +#endif /* CONFIG_OF_LIBFDT */
> > +
> > +     return ret;
> > +}
> > +#endif
> >
Regards
Ley Foon

  reply	other threads:[~2019-03-19  3:28 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
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 [this message]
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='CAFiDJ59soJuTD-CuVBv9=AS7BzB_R3THb2-NKFGsP36Dr906bA@mail.gmail.com' \
    --to=lftan.linux@gmail.com \
    --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.