<p>Subrata Banik has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/20940">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/intel/cannonlake: Add proper support to enable UART2 in 16550 mode<br><br>Need to perform a dummy read in order to activate LPSS UART's<br>16550 8-bit compatibility mode.<br><br>TEST=Able to get serial log in both 32 bit and 8 bit mode through<br>LPSS UART2 based on CONFIG_DRIVERS_UART_8250MEM_32 and<br>CONFIG_DRIVERS_UART_8250MEM selection.<br><br>Change-Id: Ief58fdcb8a91f9951a48c3bd7490b1c7fee17e48<br>Signed-off-by: Subrata Banik <subrata.banik@intel.com><br>---<br>M src/soc/intel/cannonlake/uart.c<br>1 file changed, 19 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/20940/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/soc/intel/cannonlake/uart.c b/src/soc/intel/cannonlake/uart.c<br>index 6f5fb6d..7481c24 100644<br>--- a/src/soc/intel/cannonlake/uart.c<br>+++ b/src/soc/intel/cannonlake/uart.c<br>@@ -25,6 +25,12 @@<br> #include <soc/pcr_ids.h><br> #include <soc/iomap.h><br> <br>+/* Serial IO UART controller legacy mode */<br>+#define PCR_SERIAL_IO_GPPRVRW7         0x618<br>+#define PCR_SIO_PCH_LEGACY_UART0        (1 << 0)<br>+#define PCR_SIO_PCH_LEGACY_UART1       (1 << 1)<br>+#define PCR_SIO_PCH_LEGACY_UART2       (1 << 2)<br>+<br> /* Clock divider parameters for 115200 baud rate */<br> #define CLK_M_VAL     0x30<br> #define CLK_N_VAL        0xc35<br>@@ -57,6 +63,19 @@<br>     base = uart_platform_base(CONFIG_UART_FOR_CONSOLE);<br> <br>        uart_common_init(p->dev, base, CLK_M_VAL, CLK_N_VAL);<br>+<br>+  /* Put UART2 in byte access mode for 16550 compatibility */<br>+  if (!IS_ENABLED(CONFIG_DRIVERS_UART_8250MEM_32)) {<br>+           pcr_write32(PID_SERIALIO, PCR_SERIAL_IO_GPPRVRW7,<br>+                    PCR_SIO_PCH_LEGACY_UART2);<br>+<br>+                /*<br>+            * Dummy read after setting any of GPPRVRW7.<br>+          * Required for UART 16550 8-bit Legacy mode to become active<br>+                 */<br>+          lpss_clk_read(base);<br>+ }<br>+<br>  gpio_configure_pads(p->pads, ARRAY_SIZE(p->pads));<br> }<br> <br></pre><p>To view, visit <a href="https://review.coreboot.org/20940">change 20940</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/20940"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ief58fdcb8a91f9951a48c3bd7490b1c7fee17e48 </div>
<div style="display:none"> Gerrit-Change-Number: 20940 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Subrata Banik <subrata.banik@intel.com> </div>