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	config EARLY_UART_CHOICE_8250
17		select EARLY_UART_8250
18		bool "Early printk via 8250 UART"
19		help
20		  Say Y here if you wish the early printk to direct their
21		  output to a 8250 UART.
22
23	config EARLY_UART_CHOICE_CADENCE
24		select EARLY_UART_CADENCE
25		depends on ARM_64
26		bool "Early printk via Cadence UART"
27		help
28		  Say Y here if you wish the early printk to direct their
29		  output to a Cadence UART.
30
31	config EARLY_UART_CHOICE_EXYNOS4210
32		select EARLY_UART_EXYNOS4210
33		depends on ARM_32
34		bool "Early printk via Exynos4210 UART"
35		help
36		  Say Y here if you wish the early printk to direct their
37		  output to a Exynos 4210 UART.
38
39	config EARLY_UART_CHOICE_IMX_LPUART
40		select EARLY_UART_IMX_LPUART
41		depends on ARM_64
42		bool "Early printk via i.MX LPUART"
43		help
44		  Say Y here if you wish the early printk to direct their
45		  output to a i.MX LPUART.
46
47	config EARLY_UART_CHOICE_LINFLEX
48		select EARLY_UART_LINFLEX
49		depends on ARM_64
50		bool "Early printk via NXP LINFlexD UART"
51		help
52		  Say Y here if you wish the early printk to direct their
53		  output to an NXP LINFlexD UART.
54
55	config EARLY_UART_CHOICE_MESON
56		select EARLY_UART_MESON
57		depends on ARM_64
58		bool "Early printk via MESON UART"
59		help
60		  Say Y here if you wish the early printk to direct their
61		  output to a MESON UART.
62
63	config EARLY_UART_CHOICE_MVEBU
64		select EARLY_UART_MVEBU
65		depends on ARM_64
66		bool "Early printk via MVEBU UART"
67		help
68		  Say Y here if you wish the early printk to direct their
69		  output to a MVEBU UART.
70
71	config EARLY_UART_CHOICE_PL011
72		select EARLY_UART_PL011
73		bool "Early printk via PL011 UART"
74		help
75		  Say Y here if you wish the early printk to direct their
76		  output to a PL011 UART.
77
78	config EARLY_UART_CHOICE_SCIF
79		select EARLY_UART_SCIF
80		bool "Early printk via SCIF UART"
81		help
82		  Say Y here if you wish the early printk to direct their
83		  output to a SCIF UART.
84
85endchoice
86
87
88config EARLY_UART_8250
89	select EARLY_PRINTK
90	bool
91config EARLY_UART_CADENCE
92	select EARLY_PRINTK
93	bool
94config EARLY_UART_EXYNOS4210
95	select EARLY_PRINTK
96	bool
97config EARLY_UART_IMX_LPUART
98	select EARLY_PRINTK
99	bool
100config EARLY_UART_LINFLEX
101	select EARLY_PRINTK
102	bool
103config EARLY_UART_MESON
104	select EARLY_PRINTK
105	bool
106config EARLY_UART_MVEBU
107	select EARLY_PRINTK
108	bool
109config EARLY_UART_PL011
110	select EARLY_PRINTK
111	bool
112config EARLY_UART_SCIF
113	select EARLY_PRINTK
114	bool
115
116config EARLY_PRINTK
117	bool
118
119config EARLY_UART_BASE_ADDRESS
120	depends on EARLY_PRINTK
121	hex "Early printk, physical base address of debug UART"
122	range 0x0 0xffffffff if ARM_32
123
124config EARLY_UART_SIZE
125       depends on EARLY_PRINTK
126       depends on MPU
127       hex "Early printk, physical size of debug UART"
128       range 0x0 0xffffffff if ARM_32
129       default 0x1000
130
131config EARLY_UART_PL011_BAUD_RATE
132	depends on EARLY_UART_PL011
133	int "Early printk UART baud rate for pl011"
134	default 0
135	help
136	  Optionally sets the baud rate which should be used to configure
137	  the UART at start of day.
138
139	  If EARLY_UART_PL011_BAUD_RATE is set to 0 then the code will
140	  not try to initialize the UART, so that bootloader or firmware
141	  settings can be used for maximum compatibility.
142
143config EARLY_UART_PL011_MMIO32
144	bool "32-bit only MMIO for PL011 early printk"
145	depends on EARLY_UART_PL011
146	help
147	  If specified, all accesses to PL011 registers made from early printk code
148	  will be done using 32-bit only accessors.
149
150config EARLY_UART_INIT
151	depends on EARLY_UART_PL011 && EARLY_UART_PL011_BAUD_RATE != 0
152	def_bool y
153
154config EARLY_UART_8250_REG_SHIFT
155	depends on EARLY_UART_8250
156	int "Early printk, left-shift to apply to the register offsets within the 8250 UART"
157	default 0
158	help
159	  EARLY_UART_8250_REG_SHIFT is, optionally, the left-shift to
160	  apply to the register offsets within the UART with early
161	  printk.
162
163	  Default to 0.
164
165
166choice EARLY_UART_SCIF_VERSION
167	prompt "Early printk UART SCIF interface version"
168	depends on EARLY_UART_SCIF
169	default EARLY_UART_SCIF_VERSION_NONE
170	help
171	  Select the interface version of the SCIF UART.
172
173	  Select EARLY_UART_SCIF_VERSION_NONE to use the default
174	  interface version (SCIF).
175
176	config EARLY_UART_SCIF_VERSION_NONE
177		bool "default SCIF UART interface"
178	config EARLY_UART_SCIF_VERSION_A
179		bool "SCIF UART interface version A"
180endchoice
181
182config EARLY_PRINTK_INC
183	string
184	default "debug-8250.inc" if EARLY_UART_8250
185	default "debug-cadence.inc" if EARLY_UART_CADENCE
186	default "debug-exynos4210.inc" if EARLY_UART_EXYNOS4210
187	default "debug-imx-lpuart.inc" if EARLY_UART_IMX_LPUART
188	default "debug-linflex.inc" if EARLY_UART_LINFLEX
189	default "debug-meson.inc" if EARLY_UART_MESON
190	default "debug-mvebu.inc" if EARLY_UART_MVEBU
191	default "debug-pl011.inc" if EARLY_UART_PL011
192	default "debug-scif.inc" if EARLY_UART_SCIF
193