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