[U-Boot] i.MX6 Code Consolidation suggestion/question

Adam Ford aford173 at gmail.com
Wed Mar 13 21:36:13 UTC 2019


On Mon, Feb 25, 2019 at 7:52 AM Fabio Estevam <festevam at gmail.com> wrote:
>
> Hi Adam,
>
> On Mon, Feb 25, 2019 at 10:09 AM Adam Ford <aford173 at gmail.com> wrote:
> >
> > I am looking into the SPL code to boot the imx6_logic board and
> > comparing its board file to other i.MX6 boards.
> >
> > Nearly every board has a virtually identical board_init_f function.
> > Some of the entries are done is slightly different orders, but what
> > happens appears to be the same.  I don't know if there is an advantage
> > to one order or another.
> >
> > We have a common mach-imx/spl.c file and the very end there exisrts an
> > MX6-only ifdef with the dram_init_banksize function in side the ifdef.
> >
> > Any objections to my creating a weak function called board_init_f
> > inside there, then wiping out all the individual board entries that
> > are identical?  For those who have a slightly different variation,
> > they can be left alone.
> >
> > It seems logical to me, but I don't have access to everyone's
> > hardware, so before I do that, I thought I'd ask first.
>
> Yes, this seems like a good idea.

I am using the sabresd board as the model for board_init_f and placing
it into mach-imx/spl.c

I am running into an implicit declaration warning because I we're
going to call spl_dram_init which is in the board file.  I was curious
to know if you had a suggestion on which header file I should use to
define this.  Right now, most boards have spl_dram_init defined as
static, but I will remove the static declaration and add it to
whatever header is most appropriate.

I'll then search the various files and anyone else who has a carbon
copy of this file will be deleted.  Those who do not, will keep theirs
because board_init_f will be defined __weak so the individual board
files can always over write it.

adam
adam
>
> Thanks


More information about the U-Boot mailing list