[U-Boot] When to create a SoC directory for ARM

Scott Wood
2013-09-26T01:10:13Z

On Wed, 2013-09-25 at 20:04 -0500, sun york-R58495 wrote:
> On Sep 25, 2013, at 4:52 PM, Scott Wood wrote:
>
> > On Wed, 2013-09-25 at 16:30 -0700, York Sun wrote:
> >> Dear Wolfgang,
> >>
> >> I failed to find the guideline, here is my question. Pardon me if this
> >> is a dump question as I am still new to ARM.
> >>
> >> As David Feng post his patch set to add ARMv8 support, I am trying to
> >> enable it for Freescale implementation. Let's name it as LS2 for this
> >> discussion. I am thinking to reuse as much as possible for existing
> >> codes, which include copying some header files from powerpc partially. I
> >> noticed the SoC field in boards.cfg file and I am wondering how to use
> >> it effectively. I want to put LS2 specific headers to
> >> arch/arm/include/asm/arch-ls2. Do I need to copy all files from
> >> arch/arm/include/asm/arch-armv8/? There aren't many but I see mmu.h is
> >> included in start.S. I have been searching case like this in ARMv7 but
> >> didn't see shared header file (maybe I missed it). Please advise.
> >
> > LS2 is (or perhaps more accurately, contains) an implementation of
> > ARMv8, so you should be using arch-armv8 rather than copying it.
>
> True. But I guess LS2 won't be the only "LS" Freescale is going to
> make. Where is the best place to put the header file for chassis
> related registers, like CCSR we have for mpc8xxx.

Anything that isn't deeply tied to the ARM architecture should probably
just go in include/.

> I am thinking the
> best place is arch/arm/include/asm/ls2 (or a better name). Like other
> ARMv7 variants, I am thinking to put ls2 under arch/arm/cpu/armv8/ as
> well, to host LS-specific code.

Likewise, if it's specifically tied to armv8 it should go in
arch/arm/include/asm/arch-armv8, but I'm not sure what would be tied to
both armv8 and ls2. Most likely anything LS-specific that needs to go
under arch/arm/ should go somewhere like arch/arm/include/asm/ls/
(similar to arch/arm/include/asm/imx-common).

-Scott