Bug 1192

Summary: mpc8315's tune file: "tune-ppc603e.inc"
Product: [Build System, Metadata & Runtime] BSPs Reporter: niqingliang2003 <niqingliang2003>
Component: bsps-configurationAssignee: Bruce Ashfield <bruce.ashfield>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: Medium+ CC: bruce.ashfield, dvhart, jessica.zhang, liming.wang, niqingliang2003, richard.purdie, song.liu, yi.zhao, yp.bsp.watcher, yp.watcher
Version: 1.0   
Target Milestone: 1.3 M4   
Hardware: mpc8315e-rdb   
OS: ppc   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description niqingliang2003 2011-06-22 22:21:54 UTC
the mpc8315's core is e300c3; for releasing its' power, the tune file should like this(from openembedded):

TARGET_CC_ARCH = "-mcpu=e300c3"
BASE_PACKAGE_ARCH = "ppce300c3"
FEED_ARCH = "ppce300c3"
PACKAGE_EXTRA_ARCHS += "ppce300c3"
Comment 1 Liming Wang 2012-01-13 01:29:59 UTC
I don't see where use the tune options. And I think it's not necessary for mpc8315e to use e300c3 options. Could we close this bug?
Comment 2 Bruce Ashfield 2012-01-13 06:43:25 UTC
I see the tune files in:

  meta-yocto/conf/machine/mpc8315e-rdb.conf

and

  meta/conf/machine/include/tune-ppc603e.inc

Although not required, as a reference board it would be better to show the
best possible tuning is used for a board.

It should be as simple as pulling in the e300c3 tuning from open embedded,
putting it in the oe-core machine/include directory and then changing the
meta-yocto include for the mpc8315e-rdb to pick it up.

A build and boot should be sufficient after that.
Comment 3 Liming Wang 2012-01-17 01:29:54 UTC
(In reply to comment #2)
> I see the tune files in:
> 
>   meta-yocto/conf/machine/mpc8315e-rdb.conf
> 
> and
> 
>   meta/conf/machine/include/tune-ppc603e.inc
> 
> Although not required, as a reference board it would be better to show the
> best possible tuning is used for a board.
> 
> It should be as simple as pulling in the e300c3 tuning from open embedded,
I didn't find the tune files of e300c3  in open embedded.
Comment 5 Liming Wang 2012-01-18 01:49:09 UTC
(In reply to comment #4)
> Should be this:
> 
>  
> http://cgit.openembedded.org/openembedded/tree/conf/machine/include/tune-ppce300c3.inc
> 
> and this board could be a reference:
> 
>   http://cgit.openembedded.org/openembedded/tree/conf/machine/mpc8315e-rdb.conf
I copied a file tune-ppce300c3.inc from the tune-ppce300c2.inc in poky, and replaced 300c2 with 300c3 :
---------------------------------------------------------------------
DEFAULTTUNE ?= "ppce300c3"

require conf/machine/include/powerpc/arch-powerpc.inc

TUNEVALID[ppce300c3] = "Enable ppce300c3 specific processor optimizations"
TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "ppce300c3", "-mcpu=e300c3", "", d)}"
TUNE_PKGARCH = "${@bb.utils.contains("TUNE_FEATURES", "ppce300c3", "ppce300c3", "${PPCPKGARCH}", d)}"

AVAILTUNES += "ppce300c3"
TUNE_FEATURES_tune-ppce300c3 = "m32 fpu-soft ppce300c3"
PACKAGE_EXTRA_ARCHS_tune-ppce300c3 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc-nf} ppce300c3"
---------------------------------------------------------------------

I built the kernel, it can boot on the target successfully. 

But when I built the core-image-sato, flac package prompted error messages:

powerpc-poky-linux-libtool: compile:  powerpc-poky-linux-gcc -m32 -msoft-float -mcpu=e300c3 --sysroot=/buildarea1/walimis/poky-test.git/build/tmp/sysroots/mpc8315e-rdb -DHAVE_CONFIG_H -I. -I../.. -DFLaC__INLINE=__inline__ -DNDEBUG -I../.. -I./include -I../../include -maltivec -mabi=altivec -DFLAC__NO_ASM -I/buildarea1/walimis/poky-test.git/build/tmp/sysroots/mpc8315e-rdb/usr/include -O3 -funroll-loops -finline-functions -Wall -W -Winline -O2 -pipe -g -feliminate-unused-debug-types -c crc.c  -fPIC -DPIC -o .libs/crc.o
crc.c:1:0: error: AltiVec not supported in this target

I noted a patch "meta/recipes-multimedia/flac/flac-1.2.1/0001-No-AltiVec-on-SPE.patch" and maybe I need more time to dig this failure.
Comment 6 Bruce Ashfield 2012-01-18 06:17:54 UTC
Liming: thanks for the update.

We can take more time on this, it is a more minor change, and if we had errors, 
I would have expected them on some of the graphics/mathematical userspace
apps that have inline asm or other lower level assumptions.

Good progress, keep working on this in the background, and now we have a
better scope / understanding of the effort.
Comment 7 Bruce Ashfield 2012-09-06 18:31:22 UTC
I'll take this bug.
Comment 8 Bruce Ashfield 2012-09-06 19:26:26 UTC
patches submitted to the mailing lists
Comment 9 Bruce Ashfield 2012-09-07 12:30:00 UTC
Patches have been merged to master:

a32f551c968dee86a801d8421e19ed7da92e6ac9 (meta-yocto-bsp)
72dc770cd926988b045cfff92ab30c89d6a417c1 (meta)
Comment 10 Yi Zhao 2012-09-29 08:31:25 UTC
Verified. 

git info: 718eb85806e080d0b165344b272e531ef19421eb
git branch: poky/1.3_M5