]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - arch/x86/cpu/baytrail/early_uart.c
x86: baytrail: Add option to disable the internal UART to setup_early_uart()
[people/ms/u-boot.git] / arch / x86 / cpu / baytrail / early_uart.c
index 41992105fe198f974a7ee7fdf16639a38d985914..471d592b49fddb45ed215bcf177311fdcec73a13 100644 (file)
@@ -50,7 +50,7 @@ static void score_select_func(int pad, int func)
        writel(reg, pconf0_addr);
 }
 
-static void pci_write_config32(int dev, unsigned int where, u32 value)
+static void x86_pci_write_config32(int dev, unsigned int where, u32 value)
 {
        unsigned long addr;
 
@@ -59,10 +59,15 @@ static void pci_write_config32(int dev, unsigned int where, u32 value)
 }
 
 /* This can be called after memory-mapped PCI is working */
-int setup_early_uart(void)
+int setup_internal_uart(int enable)
 {
-       /* Enable the legacy UART hardware. */
-       pci_write_config32(PCI_DEV_CONFIG(0, LPC_DEV, LPC_FUNC), UART_CONT, 1);
+       /* Enable or disable the legacy UART hardware */
+       x86_pci_write_config32(PCI_DEV_CONFIG(0, LPC_DEV, LPC_FUNC), UART_CONT,
+                              enable);
+
+       /* All done for the disable part, so just return */
+       if (!enable)
+               return 0;
 
        /*
         * Set up the pads to the UART function. This allows the signals to