aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/intel/common/block/include/intelblocks/lpc_lib.h7
-rw-r--r--src/soc/intel/common/block/lpc/Kconfig8
-rw-r--r--src/soc/intel/common/block/lpc/lpc_lib.c27
3 files changed, 30 insertions, 12 deletions
diff --git a/src/soc/intel/common/block/include/intelblocks/lpc_lib.h b/src/soc/intel/common/block/include/intelblocks/lpc_lib.h
index 7269bef667..ba4f045c34 100644
--- a/src/soc/intel/common/block/include/intelblocks/lpc_lib.h
+++ b/src/soc/intel/common/block/include/intelblocks/lpc_lib.h
@@ -59,8 +59,11 @@ struct lpc_mmio_range {
size_t size;
};
-/* Enable fixed IO ranges to LPC. IOE_* macros can be OR'ed together. */
-void lpc_enable_fixed_io_ranges(uint16_t io_enables);
+/*
+ * Enable fixed IO ranges to LPC. IOE_* macros can be OR'ed together.
+ * Output:I/O Enable Bits
+ */
+uint16_t lpc_enable_fixed_io_ranges(uint16_t io_enables);
/* Open a generic IO window to the LPC bus. Four windows are available. */
void lpc_open_pmio_window(uint16_t base, uint16_t size);
/* Close all generic IO windows to the LPC bus. */
diff --git a/src/soc/intel/common/block/lpc/Kconfig b/src/soc/intel/common/block/lpc/Kconfig
index c384c343f3..41e72c474a 100644
--- a/src/soc/intel/common/block/lpc/Kconfig
+++ b/src/soc/intel/common/block/lpc/Kconfig
@@ -3,3 +3,11 @@ config SOC_INTEL_COMMON_BLOCK_LPC
help
Use common LPC code for platform. Only soc specific code needs to
be implemented as per requirement.
+
+config SOC_INTEL_COMMON_BLOCK_LPC_COMB_ENABLE
+ depends on SOC_INTEL_COMMON_BLOCK_LPC && DRIVERS_UART_8250IO
+ bool
+ default n
+ help
+ By default COMA range to LPC is enable. COMB range to LPC is optional
+ and should select based on platform dedicated selection.
diff --git a/src/soc/intel/common/block/lpc/lpc_lib.c b/src/soc/intel/common/block/lpc/lpc_lib.c
index b4b3d1bb52..aeac441c23 100644
--- a/src/soc/intel/common/block/lpc/lpc_lib.c
+++ b/src/soc/intel/common/block/lpc/lpc_lib.c
@@ -1,7 +1,7 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2016 Intel Corp.
+ * Copyright (C) 2016-2018 Intel Corp.
* (Written by Alexandru Gagniuc <alexandrux.gagniuc@intel.com> for Intel Corp.)
*
* This program is free software; you can redistribute it and/or modify
@@ -25,13 +25,15 @@
#include "lpc_def.h"
#include <soc/pci_devs.h>
-void lpc_enable_fixed_io_ranges(uint16_t io_enables)
+uint16_t lpc_enable_fixed_io_ranges(uint16_t io_enables)
{
uint16_t reg_io_enables;
reg_io_enables = pci_read_config16(PCH_DEV_LPC, LPC_IO_ENABLES);
io_enables |= reg_io_enables;
pci_write_config16(PCH_DEV_LPC, LPC_IO_ENABLES, io_enables);
+
+ return io_enables;
}
/*
@@ -225,15 +227,20 @@ void lpc_set_serirq_mode(enum serirq_mode mode)
void lpc_io_setup_comm_a_b(void)
{
- /*
- * Setup I/O Decode Range Register for LPC
- * ComA Range 3F8h-3FFh [2:0]
- * ComB Range 2F8h-2FFh [6:4]
- */
- pci_write_config16(PCH_DEV_LPC, LPC_IO_DECODE,
- LPC_IOD_COMA_RANGE | LPC_IOD_COMB_RANGE);
+ /* ComA Range 3F8h-3FFh [2:0] */
+ uint16_t com_ranges = LPC_IOD_COMA_RANGE;
+ uint16_t com_enable = LPC_IOE_COMA_EN;
+
+ /* ComB Range 2F8h-2FFh [6:4] */
+ if (IS_ENABLED(CONFIG_SOC_INTEL_COMMON_BLOCK_LPC_COMB_ENABLE)) {
+ com_ranges |= LPC_IOD_COMB_RANGE;
+ com_enable |= LPC_IOE_COMB_EN;
+ }
+
+ /* Setup I/O Decode Range Register for LPC */
+ pci_write_config16(PCH_DEV_LPC, LPC_IO_DECODE, com_ranges);
/* Enable ComA and ComB Port */
- lpc_enable_fixed_io_ranges(LPC_IOE_COMA_EN | LPC_IOE_COMB_EN);
+ lpc_enable_fixed_io_ranges(com_enable);
}
static void lpc_set_gen_decode_range(