Patchwork [RFC,2/3] conf/machine: Overhaul tune include files

login
register
mail settings
Submitter Koen Kooi
Date July 12, 2011, 9:30 a.m.
Message ID <E040CBE3-4C88-4768-B056-0588A5566BDA@dominion.thruhere.net>
Download mbox | patch
Permalink /patch/7403/
State New, archived
Headers show

Comments

Koen Kooi - July 12, 2011, 9:30 a.m.
Op 12 jul 2011, om 10:41 heeft Richard Purdie het volgende geschreven:

> On Mon, 2011-07-11 at 19:04 +0200, Koen Kooi wrote:
>> Op 11 jul 2011, om 18:47 heeft Richard Purdie het volgende geschreven:
>>>> Taking armv7a as an example with my angstrom hat on I need the following knobs:
>>>> 
>>>> 1) softp or hardfp calling conventions, resulting in a different package arch (e.g. armv7a vs armv7ahf) (link incompatible)
>>>> 2) neon or not, resulting in a different packagearch (e.g armv7a vs armv7a-vfponly) (link compatible)
>>>> 3) Thumb2 or arm mode, no direct need for different packagearch, they are compatible
>>>> 4) use FPU fw or not (TARGET_PFU) (slightly different from 2.)
>>>> 
>>>> Do you have any examples on how the package arch will look with this patchset?
>>> 
>>> I added in code to differentiate between big and little endian. We can
>>> add in code to add extra options, e.g. in the tune-armv7 case:
>>> 
>>> 
>>> TARGET_CC_ARCH += "${@bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hardfp", "-mfloat-abi=softfp" ,d)}"
>>> 
>>> PACKAGE_EXTRA_ARCHS = "${TUNE_ARCH}${SUFX2} armv4${ENDSUFX}${SUFX2} armv4t${ENDSUFX}${SUFX2} armv5te${ENDSUFX}${SUFX2} armv6${ENDSUFX}${SUFX2} armv7${ENDSUFX}${SUFX2}"
>> 
>> And SUFX2 being 'hf' or '', right? If so, the proposal looks good to me, but I need to digest it some more.
> 
> Correct.
> 
> An updated version of this with a few more pieces filled out is
> available at:
> 
> http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/temp4&id=d2a0bf99fd573221f230bb5253b85166997fac69

If I understand it correctly

	TARGET_FPU_armv7a = "hard"
	TARGET_FPU ?= "soft"

becomes

	TUNE_FEATURES_append_armv7a = " hard"

And

	ARM_FP_ABI = "hardfp"

becomes

	TUNE_FEATURES += "callconvention-hard"

And to maintain the status quo for beagleboard/angstrom:

	TUNE_FEATURES_append_omap3 = " neon"


I would also add something like the following:

regards,

Koen
Richard Purdie - July 12, 2011, 11:25 a.m.
On Tue, 2011-07-12 at 11:30 +0200, Koen Kooi wrote:
> Op 12 jul 2011, om 10:41 heeft Richard Purdie het volgende geschreven:
> > An updated version of this with a few more pieces filled out is
> > available at:
> > 
> > http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/temp4&id=d2a0bf99fd573221f230bb5253b85166997fac69
> 
> If I understand it correctly
> 
> 	TARGET_FPU_armv7a = "hard"
> 	TARGET_FPU ?= "soft"

These actually become the defaults for armv7 since:

meta/conf/machine/include/tune-armv7.inc:

TUNE_FEATURES_tune-armv7 ??= "fpu-hard"

> becomes
> 
> 	TUNE_FEATURES_append_armv7a = " hard"

but the distro can override TUNE_FEATURES_tune-armv7 as required. The
value in question would be "" or "fpu-hard". You'd actually want:

TUNE_FEATURES_tune-armv7_append = "xxx"

or just set it to what you want:

TUNE_FEATURES_tune-armv7 = "fpu-hard neon"

> And
> 
> 	ARM_FP_ABI = "hardfp"
> 
> becomes
> 
> 	TUNE_FEATURES += "callconvention-hard"

Correct.

> And to maintain the status quo for beagleboard/angstrom:
> 
> 	TUNE_FEATURES_append_omap3 = " neon"

There isn't an omap3 tune in there at present but:

meta/conf/machine/include/tune-cortexa8.inc:

TUNE_FEATURES_tune-cortexa8 ??= "hard-fpu neon"

so neon is the default for that platform. I'm imagining that for omap3
we can do something similar.

> I would also add something like the following:
> 
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -166,7 +166,7 @@ python base_eventhandler() {
>          if name.startswith("BuildStarted"):
>                 bb.data.setVar( 'BB_VERSION', bb.__version__, e.data )
> -               statusvars = ['BB_VERSION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TARGET_FPU']
> +               statusvars = ['BB_VERSION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TUNE_FEATURES']
>                 statuslines = ["%-17s = \"%s\"" % (i, bb.data.getVar(i, e.data, 1) or '') for i in statusvars]

Agreed, that is a useful touch and makes that line in the status way
more useful for other architectures too.

> Finally a small nitpick: debian uses 'hf' as hardfloat suffix and I prefer that over '-hfp'.

Easy to change, I have no real preference.

>  Meego calls it armv8, but let's not go there.

Agreed ;-).

Cheers,

Richard

Patch

--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -166,7 +166,7 @@  python base_eventhandler() {
         if name.startswith("BuildStarted"):
                bb.data.setVar( 'BB_VERSION', bb.__version__, e.data )
-               statusvars = ['BB_VERSION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TARGET_FPU']
+               statusvars = ['BB_VERSION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TUNE_FEATURES']
                statuslines = ["%-17s = \"%s\"" % (i, bb.data.getVar(i, e.data, 1) or '') for i in statusvars]
 
Finally a small nitpick: debian uses 'hf' as hardfloat suffix and I prefer that over '-hfp'. Meego calls it armv8, but let's not go there.