Kconfig 6.05 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

73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
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

88 89
	config E2E_ONLY
		boolean "Avoid building P2P code"
90
		depends on E2E
91
		default y if E2E && (ARCH_BARE_I386 || ARCH_BARE_X86_64)
92 93 94 95 96 97 98 99 100 101
		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  

102
endmenu
103

104 105 106 107 108 109 110 111 112
config ASSERT
	bool "Build assertion checks in the code"
	default y
	  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.

113
config EXT_WR
114 115
	bool
	default y if ARCH_WRS || ARCH_WRPC
116 117

config EXT_NONE
118 119
	bool
	default !EXT_WR
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149

config EXTENSION
       string
       default "whiterabbit" if EXT_WR
       default "" if EXT_NONE



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"
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185

# 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.

186

187 188 189 190 191 192
# 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
193 194 195 196 197 198 199 200

config DISABLE_OPTIMIZATION
	bool "Disable -O2, to ease running a debugger"

config OPTIMIZATION
	int
	default 0 if DISABLE_OPTIMIZATION
	default 2
201 202 203 204 205 206 207 208

config WRPC_FAULTS
	bool "Add the fault injection mechanism and shell command for wrpc"
	depends on ARCH_WRPC
	help
	  This adds a "fault" shell command, with subcommands.
	  The same mechanisms are available in the wr switch, through
	  the configuration file.