Kconfig 11 KB
Newer Older
1 2 3 4 5 6 7 8

mainmenu "PPSi configuration"

choice
	prompt "Architecture to build for"

config ARCH_UNIX
	bool "Unix (Linux and likely other systems)"
9 10
	select HAS_VLAN
	select HAS_MULTIPLE_VLAN
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
	help
	  ARCH=unix supports standard Unix system calls, although
	  the code most likely includes some Linux dependencies.
	  Choose this architecture if you build for a Linux PC
	  or embedded system

config ARCH_BARE_I386
	bool "Bare i386"
	help
	  This architecture builds a Linux-i386 executable that
	  does not rely on the standard C library, but makes
	  system calls directly.  This architecture is a test case
	  to ensure the code can run in freestanding environments
	  (microcontrollers or other contexts with no operating system)

config ARCH_BARE_X86_64
	bool "Bare x86-64"
	help
	  This architecture builds a Linux-x86-64 executable that
	  does not rely on the standard C library, but makes
	  system calls directly.  This architecture is a test case
	  to ensure the code can run in freestanding environments
	  (microcontrollers or other contexts with no operating system)

config ARCH_WRPC
	bool "White Rabbit PTP Core (WR Node)"
37
	select HAS_VLAN
38 39 40 41 42 43 44
	help
	  Build PPSi for use in the WRPC environment (SPEC card or similar
	  one).  This is a freestanding build, without operating system.
	  The configuration selects the "White Rabbit" protocol extension.

config ARCH_WRS
	bool "White Rabbit Switch"
45 46
	select HAS_VLAN
	select HAS_MULTIPLE_VLAN
47 48 49
	help
	  Build PPSi for use in the WR switch. The computer is a standard
	  ARM-Linux host with hardware timestamping and internal PLLs
50
	  needed to achieve sub-ns synchronization.
51 52
	  The configuration selects the "White Rabbit" protocol extension.

53 54 55 56 57 58 59 60 61
config ARCH_SIMULATOR
	bool "PPSi Simulator (hosted on Linux)"
	help
	  Build a PPSi simulator. It's almost a unix full running slave,
	  with a simulated master stimulating it for test purposes. This
	  avoids to wait a long time to see how PPSi behaves.
	  This architecture uses standard Unix system calls, but the
	  code includes some Linux dependencies.

62 63 64 65 66 67 68 69 70
endchoice

config ARCH
       string
       default "unix" if ARCH_UNIX
       default "bare-i386" if ARCH_BARE_I386
       default "bare-x86-64" if ARCH_BARE_X86_64
       default "wrpc" if ARCH_WRPC
       default "wrs" if ARCH_WRS
71
       default "sim" if ARCH_SIMULATOR
72

baujc's avatar
baujc committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
	
config CROSS_COMPILE
       string "Cross compiler prefix"
       default "/opt/gcc-lm32/bin/lm32-elf-" if ARCH_WRPC
       default "/opt/arm-wrswitch/bin/arm-linux-" if ARCH_WRS
       default ""

config ARCH_CFLAGS
       string
       default "-m32" if ARCH_BARE_I386
       default "-m64" if ARCH_BARE_X86_64
       default ""

config ARCH_LDFLAGS
       string
       default "-m elf_i386" if ARCH_BARE_I386
       default "-m elf_x86_64" if ARCH_BARE_X86_64
       default ""

config WRPCSW_ROOT
       string "Source location of wrpc-sw"
       depends on ARCH_WRPC
       default "../wrpc-sw"

menu "Options" 

99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
menu "PTP Protocol Options"
        choice
                prompt "PTP Synchronization Mechanism"
        config E2E
                boolean "Delay-Request-Respond"
                help
                  Delay-Request-Response uses 4 timestamps
                  for calculating the link delay and synchronizing.
        config P2P
                boolean "Peer Delay"
                help
                  Peer Delay uses 4 timestamps for calculating
                  the link delay and another 2 for synchronizing.
        endchoice

114 115
	config E2E_ONLY
		boolean "Avoid building P2P code"
116
		depends on E2E
117
		default y if E2E && (ARCH_BARE_I386 || ARCH_BARE_X86_64)
118 119 120 121 122 123 124 125 126 127
		help
		  If you choose E2E above, P2P is built anyways,
		  and you can choose at runtime what to run.
		  This disables P2P code, for size reasons on wrpc-sw

	config HAS_P2P
	       int
	       default 0 if E2E_ONLY
	       default 1  

128
endmenu
129

baujc's avatar
baujc committed
130
menu "Enabled profiles"
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145

	config PROFILE_WR
		bool "WhiteRabbit"
		default y if ARCH_WRS

	config PROFILE_HA
		bool "HighAccuracy"
		default y if ARCH_WRS || ARCH_WRPC

	config PROFILE_CUSTOM
		bool "Custom"
		default y if ARCH_WRS

endmenu

146
config PROFILE_PTP
147
	bool
148
	default y
149

baujc's avatar
baujc committed
150 151 152 153 154
config HAS_EXT_WR
	int 
	range 0 1
	default 1 if PROFILE_WR
	default 0
155
	
baujc's avatar
baujc committed
156 157 158 159 160 161 162 163 164 165 166
config HAS_EXT_L1SYNC
	int 
	range 0 1 
	default 1 if PROFILE_HA
	default 0

config HAS_EXT_NONE
	int 
	range 0 1
	default 1 if !(PROFILE_WR || PROFILE_HA || PROFILE_CUSTOM)
	default 0
167
	
baujc's avatar
baujc committed
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
config HAS_PROFILE_PTP
	int 
	range 0 1
	default 1 if PROFILE_PTP 
	default 0 

config HAS_PROFILE_HA
	int 
	range 0 1
	default 1 if PROFILE_HA
	default 0 

config HAS_PROFILE_WR
	int 
	range 0 1
	default 1 if PROFILE_WR 
	default 0 

config HAS_PROFILE_CUSTOM
	int 
	range 0 1
	default 1 if PROFILE_CUSTOM 
	default 0 

menu VLAN
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227

# Vlan support: not all architectures have it, so this is set by them
config HAS_VLAN
	bool

config HAS_MULTIPLE_VLAN
	bool

config VLAN
	bool "Enable VLAN support for raw Ethernet"
	depends on HAS_VLAN || HAS_MULTIPLE_VLAN
	default y
	help
	  PPSI is able to directly emit and receive tagged frames,
	  with some architectures (if you see this option, it means
	  the architecture you selected has such support). A
	  designated master port can send announce on several VLANs,
	  but the other roles (designated slave or auto) can only bind
	  to a single VLAN.  This choice is a tradeoff between code
	  complexity and flexibility.
	  
	  Please note that you can always create several PTP ports that
	  act on different VLANs on the same physical port, and you can
	  also run VLAN support in your OS without special PPSI code.
	  Please see the PPSI documentation for details.

config MAX_VLANS_PER_PORT
	int "Maximum number of VLANs per port"
	depends on HAS_MULTIPLE_VLAN
	default 32
	help
	  This configuration option is mainly used to support
	  the special case of 1 VLAN per port, useful for
	  microcontroller-class architectures.  Hosted builds
	  feature a bigger default, because they have no size constraints.
baujc's avatar
baujc committed
228
	  
229 230 231 232 233 234
# I want a number, to be used without ifdef
config VLAN_ARRAY_SIZE
       int
       default 0 if !VLAN
       default 1 if !HAS_MULTIPLE_VLAN
       default MAX_VLANS_PER_PORT
235

baujc's avatar
baujc committed
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254

endmenu

config ASSERT
	bool "Build assertion checks in the code"
	default n
	  help
	    Build assertions in the code, to catch unexpected situations.
	    When an assertion fails the code loops over repeating the
	    error message every second. OTOH, panic() is always built,
	    with no Kconfig -- and it does the same, unconditionally.


config NR_FOREIGN_RECORDS 
	int "Size of foreignMasterDS data set"
	range 1 20
	default 1 if ARCH_WRPC
	default 5 
	help 
baujc's avatar
baujc committed
255 256 257
		Size of foreignMasterDS data set (Clause 9.3.2.4.5).
		If the code is optimized with externalPortConfiguration.enable forced to true,
		the NR_FOREIGN_RECORDS should be set to 1
baujc's avatar
baujc committed
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368

config SINGLE_FMASTER
	boolean 
	default y if NR_FOREIGN_RECORDS=1
	default n
	
config NR_PORTS 
	int "Number of ports"
	range 1 64
	default 1 if ARCH_WRPC
	default 18 if ARCH_WRS
	default 64
	help 
		number of physical ports

config NR_INSTANCES_PER_PORT 
	int "Max instances per port"
	range 1 64
	default 1 if ARCH_WRPC
	default 2 if ARCH_WRS
	default 1
	help 
		Number of PPSi instances per physical port

menu "Code optimization" 

config CODEOPT_ENABLED 
	boolean "Enable code optimization"
	default y
	help 
		Enable code optimization

config SINGLE_INSTANCE_PER_PORT
	boolean 
	default y if NR_INSTANCES_PER_PORT=1
	default n

config SINGLE_INSTANCE
	boolean 
	default y if NR_INSTANCES_PER_PORT=1 && NR_PORTS=1
	default n

config SINGLE_PORT
	boolean 
	default y if NR_PORTS=1
	default n

config CODEOPT_SINGLE_PORT  
	boolean "Single port"
	depends on CODEOPT_ENABLED && SINGLE_PORT 
	default n
	help 
		Code optimization when only one port is used (e.g:WRPC).

config 	CODEOPT_SINGLE_FMASTER
	boolean "One foreign master"
	depends on CODEOPT_ENABLED && SINGLE_FMASTER
	default n
	help 
		Only one foreign master per port instance.

config 	CODEOPT_SINGLE_INSTANCE_PER_PORT
	boolean "One instance per port"
	depends on CODEOPT_ENABLED && SINGLE_INSTANCE_PER_PORT
	default n
	help 
		Only one foreign master per port instance.
		
choice 
	prompt "Exclusive options"
	
	config CODEOPT_EPC_SO_DISABLED 
		boolean "No optimization"
		depends on CODEOPT_ENABLED
		help 
			No optimization		
	
	config CODEOPT_EPC_ENABLED 
		boolean "Force externalPortConfiguration.enable to true"
		depends on CODEOPT_ENABLED
		help 
			externalPortConfiguration.enable is set to true and cannot be changed
	
	config CODEOPT_SO_ENABLED
		boolean "Force slaveOnly mode to true"
		depends on CODEOPT_ENABLED && SINGLE_PORT
		help 
			slaveOnly is set to true and cannot be changed. 
			It implies that the number of port instances must be set to 1. 
			
endchoice

endmenu

endmenu


choice
	prompt "Compilation optimization"
    
    config OPTIMIZATION_SPEED
        boolean "Execution time (-O2)"
        help
           GCC performs nearly all supported optimizations that do not involve a space-speed tradeoff.
           
     config OPTIMIZATION_SIZE_SPEED
        boolean "Size and execution time (-Os)"
        help
           Optimize for size. Enables all -O2 optimizations except those that often increase code size.
           
     config OPTIMIZATION_DEBUGGING
Jean-Claude BAU's avatar
Jean-Claude BAU committed
369
        boolean "Debugging (-Og)"
baujc's avatar
baujc committed
370 371 372 373 374 375 376 377
        help
           Should be the optimization level of choice for the standard edit-compile-debug cycle

     config OPTIMIZATION_NONE_DEBUGGING
        boolean "Debugging without optimization(-ggdb)"
        help
           Compile without optimization and with debug informations 
endchoice
378 379

config OPTIMIZATION
baujc's avatar
baujc committed
380
	string
381 382 383 384
	default "-Os" if OPTIMIZATION_SIZE_SPEED && ARCH_WRPC
	default "-Os -ggdb" if OPTIMIZATION_SIZE_SPEED
	default "-O2" if OPTIMIZATION_SPEED && ARCH_WRPC
	default "-O2 -ggdb" if OPTIMIZATION_SPEED
baujc's avatar
baujc committed
385 386 387
	default "-Og -ggdb" if OPTIMIZATION_DEBUGGING
	default "-ggdb" if OPTIMIZATION_NONE_DEBUGGING
	default ""
388

baujc's avatar
baujc committed
389 390 391

config FAULT_INJECTION_MECHANISM
	bool "Add fault injection mechanism"
392
	help
baujc's avatar
baujc committed
393 394
	  The implementation is architecture specific.
	  For wrpc it adds a "fault" shell command, with subcommands.
395 396
	  The same mechanisms are available in the wr switch, through
	  the configuration file.
baujc's avatar
baujc committed
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470

config HAS_FAULT_INJECTION_MECHANISM
	int
	range 0 1
	default 1 if FAULT_INJECTION_MECHANISM
	default 0

# We want numbers (0/1) to avoid ifdef
config HAS_WRPC_FAULTS
	int
	range 0 1
	default 1 if WRPC_FAULTS
	default 0

config HAS_CODEOPT_SINGLE_FMASTER
	int 
	range 0 1
	default 1 if CODEOPT_SINGLE_FMASTER
	default 0
	
config HAS_CODEOPT_SINGLE_PORT
	int 
	range 0 1
	default 1 if CODEOPT_SINGLE_PORT
	default 0
	
config HAS_CODEOPT_SINGLE_INSTANCE_PER_PORT
	int 
	range 0 1
	default 1 if CODEOPT_SINGLE_INSTANCE_PER_PORT
	default 0

config HAS_CODEOPT_EPC_ENABLED
	int 
	range 0 1
	default 1 if CODEOPT_EPC_ENABLED
	default 0

config HAS_CODEOPT_SO_ENABLED
	int 
	range 0 1
	default 1 if CODEOPT_SO_ENABLED
	default 0

config HAS_EXT_WR 
	int 
	range 0 1
	default 1 if EXT_WR
	default 0
	
config HAS_EXT_L1SYNC 
	int 
	range 0 1
	default 1 if EXT_L1SYNC
	default 0
	
config ARCH_IS_WRS
	int 
	range 0 1
	default 1 if ARCH_WRS
	default 0

config ARCH_IS_WRPC
	int 
	range 0 1
	default 1 if ARCH_WRPC
	default 0
	
config HAS_ASSERT
	int 
	range 0 1
	default 1 if ASSERT
	default 0