config/target.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Nov 17 09:27:38 2009 +0100 (2009-11-17)
changeset 1633 95c28d483690
parent 1586 1fbb4a9d94fc
child 1638 27165f6184f2
permissions -rw-r--r--
arch: add hidden config knobs for 32- and 64-bit support and select

Add new hidden config knobs that architectures can select to
say whether they support 32- or 64-bit variants, and which
they default to.
     1 # Target definition: architecture, optimisations, etc...
     2 
     3 menu "Target options"
     4 
     5 config ARCH
     6     string
     7 
     8 # Note: when all archs have migrated to the 32/64 bit selection,
     9 # remove this option, and rename the config options in the bitness
    10 # choice, below.
    11 config ARCH_64
    12     bool
    13     default n
    14 
    15 # Pre-declare target optimisation variables
    16 config ARCH_SUPPORTS_BOTH_MMU
    17 config ARCH_SUPPORTS_BOTH_ENDIAN
    18 config ARCH_SUPPORTS_32
    19 config ARCH_SUPPORTS_64
    20 config ARCH_SUPPORT_ARCH
    21 config ARCH_SUPPORT_ABI
    22 config ARCH_SUPPORT_CPU
    23 config ARCH_SUPPORT_TUNE
    24 config ARCH_SUPPORT_FPU
    25 
    26 config ARCH_DEFAULT_HAS_MMU
    27 config ARCH_DEFAULT_BE
    28 config ARCH_DEFAULT_LE
    29 config ARCH_DEFAULT_32
    30 config ARCH_DEFAULT_64
    31 
    32 config ARCH_ARCH
    33 config ARCH_ABI
    34 config ARCH_CPU
    35 config ARCH_TUNE
    36 config ARCH_FPU
    37 config ARCH_BE
    38 config ARCH_LE
    39 config ARCH_32b
    40 config ARCH_64b
    41 config ARCH_FLOAT_HW
    42 config ARCH_FLOAT_SW
    43 config TARGET_CFLAGS
    44 config TARGET_LDFLAGS
    45 
    46 comment "General target options"
    47 
    48 source config.gen/arch.in
    49 
    50 #--------------------------------------
    51 config ARCH_SUPPORTS_BOTH_MMU
    52     bool
    53     default n
    54 
    55 config ARCH_DEFAULT_HAS_MMU
    56     bool
    57     default n
    58 
    59 config ARCH_USE_MMU
    60     bool
    61     prompt "Use the MMU" if ARCH_SUPPORTS_BOTH_MMU
    62     default n if ! ARCH_DEFAULT_HAS_MMU
    63     default y if ARCH_DEFAULT_HAS_MMU
    64     help
    65       If your architecture has an MMU and you want to use it,
    66       say 'Y' here.
    67       
    68       OTOH, if you don't want to use the MMU, or your arch
    69       lacks an MMU, say 'N' here.
    70       
    71       Note that some architectures (eg. ARM) has variants that
    72       lacks an MMU (eg. ARM Cortex-M3), while other variants
    73       have one (eg. ARM Cortex-A8).
    74 
    75 #--------------------------------------
    76 config ARCH_SUPPORTS_BOTH_ENDIAN
    77     bool
    78     default n
    79 
    80 config ARCH_DEFAULT_BE
    81     bool
    82     default n
    83 
    84 config ARCH_DEFAULT_LE
    85     bool
    86     default n
    87 
    88 choice
    89     bool
    90     prompt "Endianness:"
    91     depends on ARCH_SUPPORTS_BOTH_ENDIAN
    92     default ARCH_BE if ARCH_DEFAULT_BE
    93     default ARCH_LE if ARCH_DEFAULT_LE
    94 
    95 config ARCH_BE
    96     bool
    97     prompt "Big endian"
    98 
    99 config ARCH_LE
   100     bool
   101     prompt "Little endian"
   102 
   103 endchoice
   104 
   105 #--------------------------------------
   106 config ARCH_SUPPORTS_32
   107     bool
   108     default n
   109 
   110 config ARCH_SUPPORTS_64
   111     bool
   112     default n
   113 
   114 config ARCH_DEFAULT_32
   115     bool
   116     default n
   117 
   118 config ARCH_DEFAULT_64
   119     bool
   120     default n
   121 
   122 choice
   123     bool
   124     prompt "Bitness:"
   125     default ARCH_32b if ARCH_DEFAULT_32
   126     default ARCH_64b if ARCH_DEFAULT_64
   127 
   128 config ARCH_32b
   129     bool
   130     prompt "32-bit"
   131     depends on ARCH_SUPPORTS_32
   132 
   133 config ARCH_64b
   134     bool
   135     prompt "64-bit"
   136     depends on ARCH_SUPPORTS_64
   137     select ARCH_64
   138 
   139 endchoice
   140 
   141 #--------------------------------------
   142 comment "Target optimisations"
   143 
   144 config ARCH_SUPPORT_ARCH
   145     bool
   146     default n
   147 
   148 config ARCH_SUPPORT_ABI
   149     bool
   150     default n
   151 
   152 config ARCH_SUPPORT_CPU
   153     bool
   154     default n
   155 
   156 config ARCH_SUPPORT_TUNE
   157     bool
   158     default n
   159 
   160 config ARCH_SUPPORT_FPU
   161     bool
   162     default n
   163 
   164 config ARCH_ARCH
   165     string
   166     prompt "Architecture level"
   167     depends on ARCH_SUPPORT_ARCH
   168     default ""
   169     help
   170       GCC uses this name to determine what kind of instructions it can emit
   171       when generating assembly code. This option can be used in conjunction
   172       with or instead of the ARCH_CPU option (above), or a (command-line)
   173       -mcpu= option.
   174       
   175       This is the configuration flag --with-arch=XXXX, and the runtime flag
   176       -march=XXX.
   177       
   178       Pick a value from the gcc manual for your choosen gcc version and your
   179       target CPU.
   180       
   181       Leave blank if you don't know, or if your target architecture does not
   182       offer this option.
   183 
   184 config ARCH_ABI
   185     string
   186     prompt "Generate code for the specific ABI"
   187     depends on ARCH_SUPPORT_ABI
   188     default ""
   189     help
   190       Generate code for the given ABI.
   191 
   192       This is the configuration flag --with-abi=XXXX, and the runtime flag
   193       -mabi=XXX.
   194 
   195       Pick a value from the gcc manual for your choosen gcc version and your
   196       target CPU.
   197 
   198       Leave blank if you don't know, or if your target architecutre does not
   199       offer this option.
   200 
   201 config ARCH_CPU
   202     string
   203     prompt "Emit assembly for CPU"
   204     depends on ARCH_SUPPORT_CPU
   205     default ""
   206     help
   207       This specifies the name of the target processor. GCC uses this name
   208       to determine what kind of instructions it can emit when generating
   209       assembly code.
   210       
   211       This is the configuration flag --with-cpu=XXXX, and the runtime flag
   212       -mcpu=XXX.
   213 
   214       Pick a value from the gcc manual for your choosen gcc version and your
   215       target CPU.
   216       
   217       Leave blank if you don't know, or if your target architecture does not
   218       offer this option.
   219 
   220 config ARCH_TUNE
   221     string
   222     prompt "Tune for CPU"
   223     depends on ARCH_SUPPORT_TUNE
   224     default ""
   225     help
   226       This option is very similar to the ARCH_CPU option (above), except
   227       that instead of specifying the actual target processor type, and hence
   228       restricting which instructions can be used, it specifies that GCC should
   229       tune the performance of the code as if the target were of the type
   230       specified in this option, but still choosing the instructions that it
   231       will generate based on the cpu specified by the ARCH_CPU option
   232       (above), or a (command-line) -mcpu= option.
   233       
   234       This is the configuration flag --with-tune=XXXX, and the runtime flag
   235       -mtune=XXX.
   236       
   237       Pick a value from the gcc manual for your choosen gcc version and your
   238       target CPU.
   239       
   240       Leave blank if you don't know, or if your target architecture does not
   241       offer this option.
   242 
   243 config ARCH_FPU
   244     string
   245     prompt "Use specific FPU"
   246     depends on ARCH_SUPPORT_FPU
   247     default ""
   248     help
   249       On some targets (eg. ARM), you can specify the kind of FPU to emit
   250       code for.
   251 
   252       This is the configuration flag --with-fpu=XXX, and the runtime flag
   253       -mfpu=XXX.
   254       
   255       See below wether to actually emit FP opcodes, or to emulate them.
   256       
   257       Pick a value from the gcc manual for your choosen gcc version and your
   258       target CPU.
   259       
   260       Leave blank if you don't know, or if your target architecture does not
   261       offer this option.
   262 
   263 choice
   264     bool
   265     prompt "Floating point:"
   266 
   267 config ARCH_FLOAT_HW
   268     bool
   269     prompt "hardware (FPU)"
   270     help
   271       Emit hardware floating point opcodes.
   272       
   273       If you've got a processor with a FPU, then you want that.
   274       If your hardware has no FPU, you still can use HW floating point, but
   275       need to compile support for FPU emulation in your kernel. Needless to
   276       say that emulating the FPU is /slooowwwww/...
   277       
   278       One situation you'd want HW floating point without a FPU is if you get
   279       binary blobs from different vendors that are compiling this way and
   280       can't (don't wan't to) change.
   281 
   282 config ARCH_FLOAT_SW
   283     bool
   284     prompt "software"
   285     help
   286       Do not emit any hardware floating point opcode.
   287       
   288       If your processor has no FPU, then you most probably want this, as it
   289       is faster than emulating the FPU in the kernel.
   290 
   291 endchoice
   292 
   293 config TARGET_CFLAGS
   294     string
   295     prompt "Target CFLAGS"
   296     default ""
   297     help
   298       Used to add specific options when compiling libraries of the toolchain,
   299       that will run on the target (eg. libc.so).
   300       
   301       Note that the options above for ARCH, ABI, CPU, TUNE and FPU will be
   302       automaticaly used. You don't need to specify them here.
   303       
   304       Leave blank if you don't know better.
   305 
   306 config TARGET_LDFLAGS
   307     string
   308     prompt "Target LDFLAGS"
   309     default ""
   310     help
   311       Used to add specific options when linking libraries of the toolchain,
   312       that will run on your target.
   313       
   314       Leave blank if you don't know better.
   315 
   316 endmenu