1choice
2	bool "Early printk"
3	optional
4	help
5		You may want to enable early printk if you are debugging code
6		that executes before the console is initialized.
7
8		Note that selecting this option will limit Xen to a single UART
9		definition. Attempting to boot Xen image on a different
10		platform *will not work*, so this option should not be enable
11		for Xens that are intended to be portable.
12
13		Choose one of the UART drivers for early printk, then you'll
14		have to specify the parameters, like the base address.
15
16		Deprecated: Alternatively, there are platform specific options
17		which will have default values for the various parameters. But
18		such option will soon be removed.
19
20	config EARLY_UART_CHOICE_8250
21		select EARLY_UART_8250
22		bool "Early printk via 8250 UART"
23		help
24			Say Y here if you wish the early printk to direct their
25			output to a 8250 UART. You can use this option to
26			provide the parameters for the 8250 UART rather than
27			selecting one of the platform specific options below if
28			you know the parameters for the port.
29
30			This option is preferred over the platform specific
31			options; the platform specific options are deprecated
32			and will soon be removed.
33	config EARLY_UART_CHOICE_CADENCE
34		select EARLY_UART_CADENCE
35		depends on ARM_64
36		bool "Early printk via Cadence UART"
37		help
38			Say Y here if you wish the early printk to direct their
39			output to a Cadence UART. You can use this option to
40			provide the parameters for the Cadence UART rather than
41			selecting one of the platform specific options below if
42			you know the parameters for the port.
43
44			This option is preferred over the platform specific
45			options; the platform specific options are deprecated
46			and will soon be removed.
47	config EARLY_UART_CHOICE_EXYNOS4210
48		select EARLY_UART_EXYNOS4210
49		depends on ARM_32
50		bool "Early printk via Exynos4210 UART"
51		help
52			Say Y here if you wish the early printk to direct their
53			output to a Exynos 4210 UART. You can use this option to
54			provide the parameters for the Exynos 4210 UART rather than
55			selecting one of the platform specific options below if
56			you know the parameters for the port.
57
58			This option is preferred over the platform specific
59			options; the platform specific options are deprecated
60			and will soon be removed.
61	config EARLY_UART_CHOICE_MESON
62		select EARLY_UART_MESON
63		depends on ARM_64
64		bool "Early printk via MESON UART"
65		help
66			Say Y here if you wish the early printk to direct their
67			output to a MESON UART. You can use this option to
68			provide the parameters for the MESON UART rather than
69			selecting one of the platform specific options below if
70			you know the parameters for the port.
71
72			This option is preferred over the platform specific
73			options; the platform specific options are deprecated
74			and will soon be removed.
75	config EARLY_UART_CHOICE_MVEBU
76		select EARLY_UART_MVEBU
77		depends on ARM_64
78		bool "Early printk via MVEBU UART"
79		help
80			Say Y here if you wish the early printk to direct their
81			output to a MVEBU UART. You can use this option to
82			provide the parameters for the MVEBU UART rather than
83			selecting one of the platform specific options below if
84			you know the parameters for the port.
85
86			This option is preferred over the platform specific
87			options; the platform specific options are deprecated
88			and will soon be removed.
89	config EARLY_UART_CHOICE_PL011
90		select EARLY_UART_PL011
91		bool "Early printk via PL011 UART"
92		help
93			Say Y here if you wish the early printk to direct their
94			output to a PL011 UART. You can use this option to
95			provide the parameters for the PL011 UART rather than
96			selecting one of the platform specific options below if
97			you know the parameters for the port.
98
99			This option is preferred over the platform specific
100			options; the platform specific options are deprecated
101			and will soon be removed.
102	config EARLY_UART_CHOICE_SCIF
103		select EARLY_UART_SCIF
104		bool "Early printk via SCIF UART"
105		help
106			Say Y here if you wish the early printk to direct their
107			output to a SCIF UART. You can use this option to
108			provide the parameters for the SCIF UART rather than
109			selecting one of the platform specific options below if
110			you know the parameters for the port.
111
112			This option is preferred over the platform specific
113			options; the platform specific options are deprecated
114			and will soon be removed.
115
116	config EARLY_PRINTK_BRCM
117		bool "Early printk with 8250 on Broadcom 7445D0 boards with A15 processors"
118		select EARLY_UART_8250
119	config EARLY_PRINTK_DRA7
120		bool "Early printk with 8250 on DRA7 platform"
121		select EARLY_UART_8250
122	config EARLY_PRINTK_EXYNOS5250
123		bool "Early printk with the second UART on Exynos5250"
124		select EARLY_UART_EXYNOS4210
125		depends on ARM_32
126	config EARLY_PRINTK_FASTMODEL
127		bool "Early printk with pl011 on ARM Fastmodel software emulators"
128		select EARLY_UART_PL011
129	config EARLY_PRINTK_HIKEY960
130		bool "Early printk with pl011 with Hikey 960"
131		select EARLY_UART_PL011
132	config EARLY_PRINTK_JUNO
133		bool "Early printk with pl011 on Juno platform"
134		select EARLY_UART_PL011
135	config EARLY_PRINTK_LAGER
136		bool "Early printk with SCIF0 on Renesas Lager board (R-Car H2 processor)"
137		select EARLY_UART_SCIF
138	config EARLY_PRINTK_MIDWAY
139		bool "Early printk with pl011 on Calxeda Midway processors"
140		select EARLY_UART_PL011
141	config EARLY_PRINTK_MVEBU
142		bool "Early printk with MVEBU for Marvell Armada 3700 SoCs"
143		select EARLY_UART_MVEBU
144		depends on ARM_64
145	config EARLY_PRINTK_OMAP5432
146		bool "Early printk with UART3 on TI OMAP5432 processors"
147		select EARLY_UART_8250
148	config EARLY_PRINTK_RCAR3
149		bool "Early printk with SCIF2 on Renesas R-Car Gen3 processors"
150		select EARLY_UART_SCIF
151	config EARLY_PRINTK_SEATTLE
152		bool "Early printk with pl011 for AMD Seattle processor"
153		select EARLY_UART_PL011
154	config EARLY_PRINTK_SUN6I
155		bool "Early printk with 8250 on Allwinner A31 processors"
156		select EARLY_UART_8250
157	config EARLY_PRINTK_SUN7I
158		bool "Early printk with 8250 on Allwinner A20 processors"
159		select EARLY_UART_8250
160	config EARLY_PRINTK_THUNDERX
161		bool "Early printk with pl011 for Cavium ThunderX processor"
162		select EARLY_UART_PL011
163		depends on ARM_64
164	config EARLY_PRINTK_VEXPRESS
165		bool "Early printk with pl011 for versatile express"
166		select EARLY_UART_PL011
167	config EARLY_PRINTK_XGENE_MCDIVITT
168		bool "Early printk with 820 on Xgene mcdivitt platform"
169		select EARLY_UART_8250
170	config EARLY_PRINTK_XGENE_STORM
171		bool "Early printk with 820 on Xgene storm platform"
172		select EARLY_UART_8250
173	config EARLY_PRINTK_ZYNQMP
174		bool "Early printk with Cadence UART for Xilinx ZynqMP SoCs"
175		select EARLY_UART_CADENCE
176		depends on ARM_64
177endchoice
178
179
180config EARLY_UART_8250
181	select EARLY_PRINTK
182	bool
183config EARLY_UART_CADENCE
184	select EARLY_PRINTK
185	bool
186config EARLY_UART_EXYNOS4210
187	select EARLY_PRINTK
188	bool
189config EARLY_UART_MESON
190	select EARLY_PRINTK
191	bool
192config EARLY_UART_MVEBU
193	select EARLY_PRINTK
194	bool
195config EARLY_UART_PL011
196	select EARLY_PRINTK
197	bool
198config EARLY_UART_SCIF
199	select EARLY_PRINTK
200	bool
201
202config EARLY_PRINTK
203	bool
204
205config EARLY_UART_BASE_ADDRESS
206	depends on EARLY_PRINTK
207	hex "Early printk, physical base address of debug UART"
208	range 0x0 0xffffffff if ARM_32
209	default 0xF040AB00 if EARLY_PRINTK_BRCM
210	default 0x4806A000 if EARLY_PRINTK_DRA7
211	default 0x1c090000 if EARLY_PRINTK_FASTMODEL
212	default 0x12c20000 if EARLY_PRINTK_EXYNOS5250
213	default 0xfff32000 if EARLY_PRINTK_HIKEY960
214	default 0x7ff80000 if EARLY_PRINTK_JUNO
215	default 0xe6e60000 if EARLY_PRINTK_LAGER
216	default 0xfff36000 if EARLY_PRINTK_MIDWAY
217	default 0xd0012000 if EARLY_PRINTK_MVEBU
218	default 0x48020000 if EARLY_PRINTK_OMAP5432
219	default 0xe6e88000 if EARLY_PRINTK_RCAR3
220	default 0xe1010000 if EARLY_PRINTK_SEATTLE
221	default 0x01c28000 if EARLY_PRINTK_SUN6I
222	default 0x01c28000 if EARLY_PRINTK_SUN7I
223	default 0x87e024000000 if EARLY_PRINTK_THUNDERX
224	default 0x1c090000 if EARLY_PRINTK_VEXPRESS
225	default 0x1c021000 if EARLY_PRINTK_XGENE_MCDIVITT
226	default 0x1c020000 if EARLY_PRINTK_XGENE_STORM
227	default 0xff000000 if EARLY_PRINTK_ZYNQMP
228
229config EARLY_UART_PL011_BAUD_RATE
230	depends on EARLY_UART_PL011
231	int "Early printk UART baud rate for pl011"
232	help
233		Optionally sets the baud rate which should be used to configure
234		the UART at start of day.
235
236		If EARLY_UART_PL011_BAUD_RATE is set to 0 then the code will
237		not try to initialize the UART, so that bootloader or firmware
238		settings can be used for maximum compatibility.
239
240	default 115200 if EARLY_PRINTK_FASTMODEL
241	default 0
242
243config EARLY_UART_INIT
244	depends on EARLY_UART_PL011 && EARLY_UART_PL011_BAUD_RATE != 0
245	def_bool y
246
247config EARLY_UART_8250_REG_SHIFT
248	depends on EARLY_UART_8250
249	int "Early printk, left-shift to apply to the register offsets within the 8250 UART"
250	help
251		EARLY_UART_8250_REG_SHIFT is, optionally, the left-shift to
252		apply to the register offsets within the UART with early
253		printk.
254
255		Default to 0.
256
257	default 2 if EARLY_PRINTK_BRCM
258	default 2 if EARLY_PRINTK_DRA7
259	default 2 if EARLY_PRINTK_OMAP5432
260	default 2 if EARLY_PRINTK_SUN6I
261	default 2 if EARLY_PRINTK_SUN7I
262	default 2 if EARLY_PRINTK_XGENE_MCDIVITT
263	default 2 if EARLY_PRINTK_XGENE_STORM
264	default 0
265
266choice EARLY_UART_SCIF_VERSION
267	prompt "Early printk UART SCIF interface version"
268	depends on EARLY_UART_SCIF
269	default EARLY_UART_SCIF_VERSION_NONE
270	help
271		Select the interface version of the SCIF UART.
272
273		Select EARLY_UART_SCIF_VERSION_NONE to use the default
274		interface version (SCIF).
275	config EARLY_UART_SCIF_VERSION_NONE
276		bool "default SCIF UART interface"
277	config EARLY_UART_SCIF_VERSION_A
278		bool "SCIF UART interface version A"
279endchoice
280
281config EARLY_PRINTK_INC
282	string
283	default "debug-8250.inc" if EARLY_UART_8250
284	default "debug-cadence.inc" if EARLY_UART_CADENCE
285	default "debug-exynos4210.inc" if EARLY_UART_EXYNOS4210
286	default "debug-meson.inc" if EARLY_UART_MESON
287	default "debug-mvebu.inc" if EARLY_UART_MVEBU
288	default "debug-pl011.inc" if EARLY_UART_PL011
289	default "debug-scif.inc" if EARLY_UART_SCIF
290