1*4882a593Smuzhiyun2012/03/30 - Mark Hatle <mark.hatle@windriver.com> 2*4882a593Smuzhiyun - Initial Revision 3*4882a593Smuzhiyun 4*4882a593Smuzhiyun 5*4882a593SmuzhiyunIntroduction 6*4882a593Smuzhiyun============ 7*4882a593SmuzhiyunThe individual CPU, and ABI tunings are contained in this directory. A 8*4882a593Smuzhiyunnumber of local and global variables are used to control the way the 9*4882a593Smuzhiyuntunings are setup and how they work together to specify an optimized 10*4882a593Smuzhiyunconfiguration. 11*4882a593Smuzhiyun 12*4882a593SmuzhiyunThe following is brief summary of the generic components that are used 13*4882a593Smuzhiyunin these tunings. 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunAVAILTUNES - This is a list of all of the tuning definitions currently 16*4882a593Smuzhiyunavailable in the system. Not all tunes in this list may be compatible 17*4882a593Smuzhiyunwith the machine configuration, or each other in a multilib 18*4882a593Smuzhiyunconfiguration. Each tuning file can add to this list using "+=", but 19*4882a593Smuzhiyunshould never replace the list using "=". 20*4882a593Smuzhiyun 21*4882a593SmuzhiyunDEFAULTTUNE - This specifies the tune to use for a particular build. 22*4882a593SmuzhiyunEach tune should specify a reasonable default, which can be overriden by 23*4882a593Smuzhiyuna machine or multilib configuration. The specified tune must be listed 24*4882a593Smuzhiyunin the AVAILTUNES. 25*4882a593Smuzhiyun 26*4882a593SmuzhiyunTUNEVALID[feature] - The <feature> is defined with a human readable 27*4882a593Smuzhiyunexplanation for what it does. All architectural, cpu, abi, etc tuning 28*4882a593Smuzhiyunfeatures must be defined using TUNEVALID. 29*4882a593Smuzhiyun 30*4882a593SmuzhiyunTUNECONFLICTS[feature] - A list of features which conflict with <feature>. 31*4882a593SmuzhiyunNew sanity checks will try to reject combinations in which a single 32*4882a593Smuzhiyuntuning ends up with features which conflict with each other. 33*4882a593Smuzhiyun 34*4882a593SmuzhiyunTUNE_FEATURES - This is automatically defined as TUNE_FEATURES:tune-<tune>. 35*4882a593SmuzhiyunSee TUNE_FEATURES:tune-<tune> for more information. 36*4882a593Smuzhiyun 37*4882a593SmuzhiyunTUNE_FEATURES:tune-<tune> - Specify the features used to describe a 38*4882a593Smuzhiyunspecific tune. This is a list of features that a tune support, each 39*4882a593Smuzhiyunfeature must be in the TUNEVALID list. Note: the tune and a given 40*4882a593Smuzhiyunfeature name may be the same, but they have different purposes. Only 41*4882a593Smuzhiyunfeatures may be used to change behavior, while tunes are used to 42*4882a593Smuzhiyundescribe an overall set of features. 43*4882a593Smuzhiyun 44*4882a593SmuzhiyunABIEXTENSION - An ABI extension may be specified by a specific feature 45*4882a593Smuzhiyunor other tuning setting, such as TARGET_FPU. Any ABI extensions either 46*4882a593Smuzhiyunneed to be defined in the architectures base arch file, i.e. 47*4882a593SmuzhiyunABIEXTENSION = "eabi" in the arm case, or appended to in specific tune 48*4882a593Smuzhiyunfiles with a ".=". Spaces are not allowed in this variable. 49*4882a593Smuzhiyun 50*4882a593SmuzhiyunTUNE_CCARGS - Setup the cflags based on the TUNE_FEATURES settings. 51*4882a593SmuzhiyunThese should be additive when defined using "+=". All items in this 52*4882a593Smuzhiyunlist should be dynamic! i.e. 53*4882a593Smuzhiyun${@bb.utils.contains("TUNE_FEATURES", "feature", "cflag", "!cflag", d)} 54*4882a593Smuzhiyun 55*4882a593SmuzhiyunTUNE_ARCH - The GNU canonical arch for a specific architecture. i.e. 56*4882a593Smuzhiyunarm, armeb, mips, mips64, etc. This value is used by bitbake to setup 57*4882a593Smuzhiyunconfigure. TUNE_ARCH definitions are specific to a given architecture. 58*4882a593SmuzhiyunThey may be a single static definition, or may be dynamically adjusted. 59*4882a593SmuzhiyunSee each architecture's README for details for that CPU family. 60*4882a593Smuzhiyun 61*4882a593SmuzhiyunTUNE_PKGARCH - The package architecture used by the packaging systems to 62*4882a593Smuzhiyundefine the architecture, abi and tuning of a particular package. 63*4882a593SmuzhiyunSimilarly to TUNE_ARCH, the definition of TUNE_PKGARCH is specific to 64*4882a593Smuzhiyuneach architecture. See each architectures README for details for that 65*4882a593SmuzhiyunCPU family. 66*4882a593Smuzhiyun 67*4882a593SmuzhiyunPACKAGE_EXTRA_ARCHS - Lists all runtime compatible package 68*4882a593Smuzhiyunarchitectures. By default this is equal to 69*4882a593SmuzhiyunPACKAGE_EXTRA_ARCHS:tune-<tune>. If an architecture deviates from the 70*4882a593Smuzhiyundefault it will be listed in the architecture README. 71*4882a593Smuzhiyun 72*4882a593SmuzhiyunPACKAGE_EXTRA_ARCHS:tune-<tune> - List all of the package architectures 73*4882a593Smuzhiyunthat are compatible with this specific tune. The package arch of this 74*4882a593Smuzhiyuntune must be in the list. 75*4882a593Smuzhiyun 76*4882a593SmuzhiyunTARGET_FPU - The FPU setting for a given tune, hard (generate floating 77*4882a593Smuzhiyunpoint instructions), soft (generate internal gcc calls), "other" 78*4882a593Smuzhiyunarchitecture specific floating point. This is synchronized with the 79*4882a593Smuzhiyuncompiler and other toolchain items. This should be dynamically 80*4882a593Smuzhiyunconfigured in the same way that TUNE_CCARGS is. 81*4882a593Smuzhiyun 82*4882a593SmuzhiyunBASE_LIB:tune-<tune> - The "/lib" location for a specific ABI. This is 83*4882a593Smuzhiyunused in a multilib configuration to place the libraries in the correct, 84*4882a593Smuzhiyunnon-conflicting locations. 85*4882a593Smuzhiyun 86*4882a593Smuzhiyun 87*4882a593SmuzhiyunBest Practice 88*4882a593Smuzhiyun============= 89*4882a593SmuzhiyunThe tune infrastructure is designed to be hierarchical. When writing a 90*4882a593Smuzhiyunnew tune file for a "fast-forward" CPU architecture (one that supports 91*4882a593Smuzhiyuneverything from a previous generation), it is recommended to require the 92*4882a593Smuzhiyunprevious generation tune file and specify PACKAGE_EXTRA_ARCHS using the 93*4882a593Smuzhiyunprevious generation's override and appending the new tune. Note that 94*4882a593Smuzhiyunonly one previous tune file should be included to avoid mutiple includes 95*4882a593Smuzhiyunof the base arch which could lead to a broken configuration due to 96*4882a593Smuzhiyunmultiple prepend and append assignments. 97*4882a593Smuzhiyun 98*4882a593SmuzhiyunFor example, for x86, there is a common x86/arch-x86.inc which is 99*4882a593Smuzhiyunincluded in the base i586 tune file. The core2 tune builds 100*4882a593Smuzhiyunon that, and corei7 builds on core2. 101