blob: 9b34031fe6c36cd4e7170a40e04a31d3a58c4461 [file] [log] [blame]
Angel Pons0612b272020-04-05 15:46:56 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Furquan Shaikha8198eb2017-08-04 16:12:19 -07002
Furquan Shaikh76cedd22020-05-02 10:24:23 -07003#include <acpi/acpi.h>
Patrick Rudolph49ae5962020-04-15 11:19:31 +02004#include <acpi/acpigen.h>
Kyösti Mälkki5daa1d32020-06-14 12:01:58 +03005#include <acpi/acpi_gnvs.h>
Subrata Banikafa07f72018-05-24 12:21:06 +05306#include <console/uart.h>
Aamir Bohra83f7bae2017-04-26 19:30:41 +05307#include <device/device.h>
8#include <device/pci.h>
Aamir Bohra01d75f42017-03-30 20:12:21 +05309#include <device/pci_def.h>
Aamir Bohra83f7bae2017-04-26 19:30:41 +053010#include <device/pci_ids.h>
Furquan Shaikha8198eb2017-08-04 16:12:19 -070011#include <device/pci_ops.h>
Aamir Bohra01d75f42017-03-30 20:12:21 +053012#include <intelblocks/lpss.h>
13#include <intelblocks/uart.h>
Subrata Banikafa07f72018-05-24 12:21:06 +053014#include <soc/pci_devs.h>
15#include <soc/iomap.h>
Patrick Rudolph49ae5962020-04-15 11:19:31 +020016#include <soc/irq.h>
Subrata Banikafa07f72018-05-24 12:21:06 +053017#include <soc/nvs.h>
Patrick Rudolph49ae5962020-04-15 11:19:31 +020018#include "chip.h"
Aamir Bohra01d75f42017-03-30 20:12:21 +053019
Furquan Shaikha8198eb2017-08-04 16:12:19 -070020#define UART_PCI_ENABLE (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER)
Subrata Banikafa07f72018-05-24 12:21:06 +053021
Michael Niewöhner405f2292020-12-21 03:46:58 +010022extern const unsigned int uart_devices[];
23extern const int uart_devices_size;
Furquan Shaikha8198eb2017-08-04 16:12:19 -070024
Furquan Shaikh582a0e22021-01-07 00:16:35 -080025static void uart_lpss_init(pci_devfn_t dev, uintptr_t baseaddr)
Furquan Shaikh3406dd62017-08-04 15:58:26 -070026{
Usha P5e59a822019-08-09 18:42:00 +053027 /* Ensure controller is in D0 state */
Furquan Shaikh582a0e22021-01-07 00:16:35 -080028 lpss_set_power_state(dev, STATE_D0);
Usha P5e59a822019-08-09 18:42:00 +053029
Furquan Shaikh3406dd62017-08-04 15:58:26 -070030 /* Take UART out of reset */
31 lpss_reset_release(baseaddr);
32
33 /* Set M and N divisor inputs and enable clock */
34 lpss_clk_update(baseaddr, CONFIG_SOC_INTEL_COMMON_LPSS_UART_CLK_M_VAL,
35 CONFIG_SOC_INTEL_COMMON_LPSS_UART_CLK_N_VAL);
36}
37
Nico Huber62ddc492019-05-29 18:39:31 +020038#if CONFIG(INTEL_LPSS_UART_FOR_CONSOLE)
Felix Helde3a12472020-09-11 15:47:09 +020039uintptr_t uart_platform_base(unsigned int idx)
Aamir Bohra01d75f42017-03-30 20:12:21 +053040{
Nico Huberce8eebd2019-05-29 18:33:35 +020041 if (idx == CONFIG_UART_FOR_CONSOLE)
Nico Huber99954182019-05-29 23:33:06 +020042 return CONFIG_CONSOLE_UART_BASE_ADDRESS;
Nico Huberce8eebd2019-05-29 18:33:35 +020043 return 0;
Subrata Banikafa07f72018-05-24 12:21:06 +053044}
45#endif
46
Furquan Shaikh582a0e22021-01-07 00:16:35 -080047static pci_devfn_t uart_console_get_pci_bdf(void)
Subrata Banikafa07f72018-05-24 12:21:06 +053048{
Furquan Shaikh582a0e22021-01-07 00:16:35 -080049 int devfn;
Subrata Banikafa07f72018-05-24 12:21:06 +053050
Furquan Shaikha8198eb2017-08-04 16:12:19 -070051 /*
Nico Hubera96e66a2018-11-11 02:51:14 +010052 * This function will get called even if INTEL_LPSS_UART_FOR_CONSOLE
53 * config option is not selected.
54 * By default return NULL in this case to avoid compilation errors.
Furquan Shaikha8198eb2017-08-04 16:12:19 -070055 */
Julius Wernercd49cce2019-03-05 16:53:33 -080056 if (!CONFIG(INTEL_LPSS_UART_FOR_CONSOLE))
Furquan Shaikh582a0e22021-01-07 00:16:35 -080057 return PCI_DEV_INVALID;
58
Michael Niewöhner405f2292020-12-21 03:46:58 +010059 if (CONFIG_UART_FOR_CONSOLE > uart_devices_size)
Furquan Shaikh582a0e22021-01-07 00:16:35 -080060 return PCI_DEV_INVALID;
61
Michael Niewöhner405f2292020-12-21 03:46:58 +010062 devfn = uart_devices[CONFIG_UART_FOR_CONSOLE];
63 if (devfn == PCI_DEVFN_INVALID)
64 return PCI_DEV_INVALID;
65
Furquan Shaikh582a0e22021-01-07 00:16:35 -080066 return PCI_DEV(0, PCI_SLOT(devfn), PCI_FUNC(devfn));
67}
68
69const struct device *uart_get_device(void)
70{
71 pci_devfn_t dev = uart_console_get_pci_bdf();
72 if (dev == PCI_DEV_INVALID)
Subrata Banikafa07f72018-05-24 12:21:06 +053073 return NULL;
74
Furquan Shaikh582a0e22021-01-07 00:16:35 -080075 return pcidev_path_on_root(PCI_DEV2DEVFN(dev));
Furquan Shaikha8198eb2017-08-04 16:12:19 -070076}
77
Subrata Banikafa07f72018-05-24 12:21:06 +053078bool uart_is_controller_initialized(void)
Furquan Shaikha8198eb2017-08-04 16:12:19 -070079{
Furquan Shaikha8198eb2017-08-04 16:12:19 -070080 uintptr_t base;
Furquan Shaikh582a0e22021-01-07 00:16:35 -080081 pci_devfn_t dev = uart_console_get_pci_bdf();
Aamir Bohra17cfba62019-07-25 20:56:54 +053082
Furquan Shaikh582a0e22021-01-07 00:16:35 -080083 if (dev == PCI_DEV_INVALID)
Aamir Bohra17cfba62019-07-25 20:56:54 +053084 return false;
Furquan Shaikha8198eb2017-08-04 16:12:19 -070085
Furquan Shaikh582a0e22021-01-07 00:16:35 -080086 base = pci_s_read_config32(dev, PCI_BASE_ADDRESS_0) & ~0xFFF;
Furquan Shaikha8198eb2017-08-04 16:12:19 -070087 if (!base)
88 return false;
89
Furquan Shaikh582a0e22021-01-07 00:16:35 -080090 if ((pci_s_read_config16(dev, PCI_COMMAND) & UART_PCI_ENABLE)
Furquan Shaikha8198eb2017-08-04 16:12:19 -070091 != UART_PCI_ENABLE)
92 return false;
93
94 return !lpss_is_controller_in_reset(base);
Aamir Bohra01d75f42017-03-30 20:12:21 +053095}
Aamir Bohra83f7bae2017-04-26 19:30:41 +053096
Subrata Banikafa07f72018-05-24 12:21:06 +053097void uart_bootblock_init(void)
Furquan Shaikha8198eb2017-08-04 16:12:19 -070098{
Furquan Shaikh582a0e22021-01-07 00:16:35 -080099 const uint32_t baseaddr = CONFIG_CONSOLE_UART_BASE_ADDRESS;
100 pci_devfn_t dev = uart_console_get_pci_bdf();
Aamir Bohra17cfba62019-07-25 20:56:54 +0530101
Furquan Shaikh582a0e22021-01-07 00:16:35 -0800102 if (dev == PCI_DEV_INVALID)
Aamir Bohra17cfba62019-07-25 20:56:54 +0530103 return;
104
Furquan Shaikh582a0e22021-01-07 00:16:35 -0800105 /* Set UART base address */
106 pci_s_write_config32(dev, PCI_BASE_ADDRESS_0, baseaddr);
107
108 /* Enable memory access and bus master */
109 pci_s_write_config16(dev, PCI_COMMAND, UART_PCI_ENABLE);
110
111 uart_lpss_init(dev, baseaddr);
Subrata Banikafa07f72018-05-24 12:21:06 +0530112}
113
114#if ENV_RAMSTAGE
115
116static void uart_read_resources(struct device *dev)
117{
118 pci_dev_read_resources(dev);
119
120 /* Set the configured UART base address for the debug port */
Julius Wernercd49cce2019-03-05 16:53:33 -0800121 if (CONFIG(INTEL_LPSS_UART_FOR_CONSOLE) &&
Nico Hubera96e66a2018-11-11 02:51:14 +0100122 uart_is_debug_controller(dev)) {
Subrata Banikafa07f72018-05-24 12:21:06 +0530123 struct resource *res = find_resource(dev, PCI_BASE_ADDRESS_0);
124 /* Need to set the base and size for the resource allocator. */
Nico Huber99954182019-05-29 23:33:06 +0200125 res->base = CONFIG_CONSOLE_UART_BASE_ADDRESS;
126 res->size = 0x1000;
Subrata Banikafa07f72018-05-24 12:21:06 +0530127 res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED |
128 IORESOURCE_FIXED;
129 }
130}
131
132/*
133 * Check if UART debug port controller needs to be initialized on resume.
134 *
135 * Returns:
136 * true = when SoC wants debug port initialization on resume
137 * false = otherwise
138 */
139static bool pch_uart_init_debug_controller_on_resume(void)
140{
Kyösti Mälkki0c1dd9c2020-06-17 23:37:49 +0300141 struct global_nvs *gnvs = acpi_get_gnvs();
Subrata Banikafa07f72018-05-24 12:21:06 +0530142
143 if (gnvs)
144 return !!gnvs->uior;
145
Furquan Shaikha8198eb2017-08-04 16:12:19 -0700146 return false;
147}
148
149bool uart_is_debug_controller(struct device *dev)
150{
Subrata Banikafa07f72018-05-24 12:21:06 +0530151 return dev == uart_get_device();
Furquan Shaikha8198eb2017-08-04 16:12:19 -0700152}
153
154/*
155 * This is a workaround to enable UART controller for the debug port if:
156 * 1. CONSOLE_SERIAL is not enabled in coreboot, and
157 * 2. This boot is S3 resume, and
158 * 3. SoC wants to initialize debug UART controller.
159 *
160 * This workaround is required because Linux kernel hangs on resume if console
161 * is not enabled in coreboot, but it is enabled in kernel and not suspended.
162 */
163static bool uart_controller_needs_init(struct device *dev)
164{
165 /*
Jonathan Neuschäfer5268b762018-02-12 12:24:25 +0100166 * If coreboot has CONSOLE_SERIAL enabled, the skip re-initializing
Furquan Shaikha8198eb2017-08-04 16:12:19 -0700167 * controller here.
168 */
Julius Wernercd49cce2019-03-05 16:53:33 -0800169 if (CONFIG(CONSOLE_SERIAL))
Furquan Shaikha8198eb2017-08-04 16:12:19 -0700170 return false;
171
172 /* If this device does not correspond to debug port, then skip. */
173 if (!uart_is_debug_controller(dev))
174 return false;
175
176 /* Initialize UART controller only on S3 resume. */
177 if (!acpi_is_wakeup_s3())
178 return false;
179
180 /*
Subrata Banikafa07f72018-05-24 12:21:06 +0530181 * check if SOC wants to initialize UART on resume
Furquan Shaikha8198eb2017-08-04 16:12:19 -0700182 */
183 return pch_uart_init_debug_controller_on_resume();
184}
185
186static void uart_common_enable_resources(struct device *dev)
187{
188 pci_dev_enable_resources(dev);
189
190 if (uart_controller_needs_init(dev)) {
191 uintptr_t base;
192
193 base = pci_read_config32(dev, PCI_BASE_ADDRESS_0) & ~0xFFF;
194 if (base)
Furquan Shaikh582a0e22021-01-07 00:16:35 -0800195 uart_lpss_init(PCI_BDF(dev), base);
Furquan Shaikha8198eb2017-08-04 16:12:19 -0700196 }
197}
198
Patrick Rudolph49ae5962020-04-15 11:19:31 +0200199static void uart_acpi_write_irq(const struct device *dev)
200{
201 struct acpi_irq irq;
202
203 switch (dev->path.pci.devfn) {
204 case PCH_DEVFN_UART0:
205 irq = (struct acpi_irq)ACPI_IRQ_LEVEL_LOW(LPSS_UART0_IRQ);
206 break;
207 case PCH_DEVFN_UART1:
208 irq = (struct acpi_irq)ACPI_IRQ_LEVEL_LOW(LPSS_UART1_IRQ);
209 break;
210 case PCH_DEVFN_UART2:
211 irq = (struct acpi_irq)ACPI_IRQ_LEVEL_LOW(LPSS_UART2_IRQ);
212 break;
213 default:
214 return;
215 }
216
217 acpi_device_write_interrupt(&irq);
218}
219
220/*
221 * Generate an ACPI entry if the device is enabled in devicetree for the ACPI
222 * LPSS driver. In this mode the device and vendor ID reads as 0xffff, but the
223 * PCI device is still there.
224 */
225static void uart_fill_ssdt(const struct device *dev)
226{
227 const char *scope = acpi_device_scope(dev);
228 const char *hid = acpi_device_hid(dev);
229 struct resource *res;
230
231 /* In ACPI mode the device is "invisible" */
232 if (!dev->hidden)
233 return;
234
235 if (!scope || !hid)
236 return;
237
238 res = probe_resource(dev, PCI_BASE_ADDRESS_0);
239 if (!res)
240 return;
241
242 /* Scope */
243 acpigen_write_scope(scope);
244
245 /* Device */
246 acpigen_write_device(acpi_device_name(dev));
247 acpigen_write_name_string("_HID", hid);
248 /*
249 * Advertise compatibility to Sunrise Point, as the Linux kernel doesn't support
250 * CannonPoint yet...
251 */
252 if (strcmp(hid, "INT34B8") == 0)
253 acpigen_write_name_string("_CID", "INT3448");
254 else if (strcmp(hid, "INT34B9") == 0)
255 acpigen_write_name_string("_CID", "INT3449");
256 else if (strcmp(hid, "INT34BA") == 0)
257 acpigen_write_name_string("_CID", "INT344A");
258
259 acpi_device_write_uid(dev);
260 acpigen_write_name_string("_DDN", "LPSS ACPI UART");
261 acpigen_write_STA(acpi_device_status(dev));
262
263 /* Resources */
264 acpigen_write_name("_CRS");
265 acpigen_write_resourcetemplate_header();
266
267 uart_acpi_write_irq(dev);
268 acpigen_write_mem32fixed(1, res->base, res->size);
269
270 acpigen_write_resourcetemplate_footer();
271
272 acpigen_pop_len(); /* Device */
273 acpigen_pop_len(); /* Scope */
274}
275
276static const char *uart_acpi_hid(const struct device *dev)
277{
278 switch (dev->device) {
279 case PCI_DEVICE_ID_INTEL_APL_UART0:
280 return "80865abc";
281 case PCI_DEVICE_ID_INTEL_APL_UART1:
282 return "80865abe";
283 case PCI_DEVICE_ID_INTEL_APL_UART2:
284 return "80865ac0";
285 case PCI_DEVICE_ID_INTEL_GLK_UART0:
286 return "808631bc";
287 case PCI_DEVICE_ID_INTEL_GLK_UART1:
288 return "808631be";
289 case PCI_DEVICE_ID_INTEL_GLK_UART2:
290 return "808631c0";
291 case PCI_DEVICE_ID_INTEL_GLK_UART3:
292 return "808631ee";
293 case PCI_DEVICE_ID_INTEL_SPT_UART0:
294 case PCI_DEVICE_ID_INTEL_SPT_H_UART0:
295 return "INT3448";
296 case PCI_DEVICE_ID_INTEL_SPT_UART1:
297 case PCI_DEVICE_ID_INTEL_SPT_H_UART1:
298 return "INT3449";
299 case PCI_DEVICE_ID_INTEL_SPT_UART2:
300 case PCI_DEVICE_ID_INTEL_SPT_H_UART2:
301 return "INT344A";
302 case PCI_DEVICE_ID_INTEL_CNP_H_UART0:
303 return "INT34B8";
304 case PCI_DEVICE_ID_INTEL_CNP_H_UART1:
305 return "INT34B9";
306 case PCI_DEVICE_ID_INTEL_CNP_H_UART2:
307 return "INT34BA";
308 default:
309 return NULL;
310 }
311}
312
313static const char *uart_acpi_name(const struct device *dev)
314{
315 switch (dev->device) {
316 case PCI_DEVICE_ID_INTEL_APL_UART0:
317 case PCI_DEVICE_ID_INTEL_GLK_UART0:
318 case PCI_DEVICE_ID_INTEL_SPT_UART0:
319 case PCI_DEVICE_ID_INTEL_SPT_H_UART0:
320 case PCI_DEVICE_ID_INTEL_CNP_H_UART0:
321 return "UAR0";
322 case PCI_DEVICE_ID_INTEL_APL_UART1:
323 case PCI_DEVICE_ID_INTEL_GLK_UART1:
324 case PCI_DEVICE_ID_INTEL_SPT_UART1:
325 case PCI_DEVICE_ID_INTEL_SPT_H_UART1:
326 case PCI_DEVICE_ID_INTEL_CNP_H_UART1:
327 return "UAR1";
328 case PCI_DEVICE_ID_INTEL_APL_UART2:
329 case PCI_DEVICE_ID_INTEL_GLK_UART2:
330 case PCI_DEVICE_ID_INTEL_SPT_UART2:
331 case PCI_DEVICE_ID_INTEL_SPT_H_UART2:
332 case PCI_DEVICE_ID_INTEL_CNP_H_UART2:
333 return "UAR2";
334 case PCI_DEVICE_ID_INTEL_GLK_UART3:
335 return "UAR3";
336 default:
337 return NULL;
338 }
339}
340
Aamir Bohra83f7bae2017-04-26 19:30:41 +0530341static struct device_operations device_ops = {
Elyes HAOUAS1d191272018-11-27 12:23:48 +0100342 .read_resources = uart_read_resources,
343 .set_resources = pci_dev_set_resources,
344 .enable_resources = uart_common_enable_resources,
Subrata Banik6bbc91a2017-12-07 14:55:51 +0530345 .ops_pci = &pci_dev_ops_pci,
Patrick Rudolph49ae5962020-04-15 11:19:31 +0200346 .acpi_fill_ssdt = uart_fill_ssdt,
347 .acpi_hid = uart_acpi_hid,
348 .acpi_name = uart_acpi_name,
Aamir Bohra83f7bae2017-04-26 19:30:41 +0530349};
350
351static const unsigned short pci_device_ids[] = {
352 PCI_DEVICE_ID_INTEL_SPT_UART0,
353 PCI_DEVICE_ID_INTEL_SPT_UART1,
354 PCI_DEVICE_ID_INTEL_SPT_UART2,
V Sowmya7c150472018-01-23 14:44:45 +0530355 PCI_DEVICE_ID_INTEL_SPT_H_UART0,
356 PCI_DEVICE_ID_INTEL_SPT_H_UART1,
357 PCI_DEVICE_ID_INTEL_SPT_H_UART2,
V Sowmyaacc2a482018-01-23 15:27:23 +0530358 PCI_DEVICE_ID_INTEL_KBP_H_UART0,
359 PCI_DEVICE_ID_INTEL_KBP_H_UART1,
360 PCI_DEVICE_ID_INTEL_KBP_H_UART2,
Aamir Bohra83f7bae2017-04-26 19:30:41 +0530361 PCI_DEVICE_ID_INTEL_APL_UART0,
362 PCI_DEVICE_ID_INTEL_APL_UART1,
363 PCI_DEVICE_ID_INTEL_APL_UART2,
364 PCI_DEVICE_ID_INTEL_APL_UART3,
Lijian Zhaobbedef92017-07-29 16:38:38 -0700365 PCI_DEVICE_ID_INTEL_CNL_UART0,
366 PCI_DEVICE_ID_INTEL_CNL_UART1,
367 PCI_DEVICE_ID_INTEL_CNL_UART2,
Hannah Williamsf7149652017-05-13 16:18:02 -0700368 PCI_DEVICE_ID_INTEL_GLK_UART0,
369 PCI_DEVICE_ID_INTEL_GLK_UART1,
370 PCI_DEVICE_ID_INTEL_GLK_UART2,
371 PCI_DEVICE_ID_INTEL_GLK_UART3,
praveen hodagatta praneshe26c4a42018-09-20 03:49:45 +0800372 PCI_DEVICE_ID_INTEL_CNP_H_UART0,
373 PCI_DEVICE_ID_INTEL_CNP_H_UART1,
374 PCI_DEVICE_ID_INTEL_CNP_H_UART2,
Aamir Bohra9eac0392018-06-30 12:07:04 +0530375 PCI_DEVICE_ID_INTEL_ICP_UART0,
376 PCI_DEVICE_ID_INTEL_ICP_UART1,
377 PCI_DEVICE_ID_INTEL_ICP_UART2,
Ronak Kanabarda7ffb482019-02-05 01:51:13 +0530378 PCI_DEVICE_ID_INTEL_CMP_UART0,
379 PCI_DEVICE_ID_INTEL_CMP_UART1,
380 PCI_DEVICE_ID_INTEL_CMP_UART2,
Gaggery Tsai12a651c2019-12-05 11:23:20 -0800381 PCI_DEVICE_ID_INTEL_CMP_H_UART0,
382 PCI_DEVICE_ID_INTEL_CMP_H_UART1,
383 PCI_DEVICE_ID_INTEL_CMP_H_UART2,
Ravi Sarawadi6b5bf402019-10-21 22:25:04 -0700384 PCI_DEVICE_ID_INTEL_TGP_UART0,
385 PCI_DEVICE_ID_INTEL_TGP_UART1,
386 PCI_DEVICE_ID_INTEL_TGP_UART2,
Tan, Lean Sheng26136092020-01-20 19:13:56 -0800387 PCI_DEVICE_ID_INTEL_MCC_UART0,
388 PCI_DEVICE_ID_INTEL_MCC_UART1,
389 PCI_DEVICE_ID_INTEL_MCC_UART2,
Meera Ravindranath3f4af0d2020-02-12 16:01:22 +0530390 PCI_DEVICE_ID_INTEL_JSP_UART0,
391 PCI_DEVICE_ID_INTEL_JSP_UART1,
392 PCI_DEVICE_ID_INTEL_JSP_UART2,
Subrata Banikf672f7f2020-08-03 14:29:25 +0530393 PCI_DEVICE_ID_INTEL_ADP_S_UART0,
394 PCI_DEVICE_ID_INTEL_ADP_S_UART1,
395 PCI_DEVICE_ID_INTEL_ADP_S_UART2,
396 PCI_DEVICE_ID_INTEL_ADP_S_UART3,
397 PCI_DEVICE_ID_INTEL_ADP_S_UART4,
398 PCI_DEVICE_ID_INTEL_ADP_S_UART5,
399 PCI_DEVICE_ID_INTEL_ADP_S_UART6,
400 PCI_DEVICE_ID_INTEL_ADP_P_UART0,
401 PCI_DEVICE_ID_INTEL_ADP_P_UART1,
402 PCI_DEVICE_ID_INTEL_ADP_P_UART2,
403 PCI_DEVICE_ID_INTEL_ADP_P_UART3,
404 PCI_DEVICE_ID_INTEL_ADP_P_UART4,
405 PCI_DEVICE_ID_INTEL_ADP_P_UART5,
406 PCI_DEVICE_ID_INTEL_ADP_P_UART6,
Varshit Pandyaf4d98fdd22021-01-17 18:39:29 +0530407 PCI_DEVICE_ID_INTEL_ADP_M_UART0,
408 PCI_DEVICE_ID_INTEL_ADP_M_UART1,
409 PCI_DEVICE_ID_INTEL_ADP_M_UART2,
410 PCI_DEVICE_ID_INTEL_ADP_M_UART3,
Hannah Williamsf7149652017-05-13 16:18:02 -0700411 0,
Aamir Bohra83f7bae2017-04-26 19:30:41 +0530412};
413
414static const struct pci_driver pch_uart __pci_driver = {
Subrata Banikafa07f72018-05-24 12:21:06 +0530415 .ops = &device_ops,
416 .vendor = PCI_VENDOR_ID_INTEL,
Aamir Bohra83f7bae2017-04-26 19:30:41 +0530417 .devices = pci_device_ids,
418};
Patrick Rudolph49ae5962020-04-15 11:19:31 +0200419
420static void uart_enable(struct device *dev)
421{
422 struct soc_intel_common_block_uart_config *conf = dev->chip_info;
423 dev->ops = &device_ops;
424 dev->device = conf ? conf->devid : 0;
425}
426
427struct chip_operations soc_intel_common_block_uart_ops = {
428 CHIP_NAME("LPSS UART in ACPI mode")
429 .enable_dev = uart_enable
430};
431
Aamir Bohra83f7bae2017-04-26 19:30:41 +0530432#endif /* ENV_RAMSTAGE */