summaryrefslogtreecommitdiff
path: root/src/northbridge/via/cx700
diff options
context:
space:
mode:
Diffstat (limited to 'src/northbridge/via/cx700')
-rw-r--r--src/northbridge/via/cx700/Kconfig1
-rw-r--r--src/northbridge/via/cx700/Makefile.mk3
-rw-r--r--src/northbridge/via/cx700/bootblock.c25
-rw-r--r--src/northbridge/via/cx700/early_smbus.c8
4 files changed, 36 insertions, 1 deletions
diff --git a/src/northbridge/via/cx700/Kconfig b/src/northbridge/via/cx700/Kconfig
index 95f289aacb..f2ba54eee5 100644
--- a/src/northbridge/via/cx700/Kconfig
+++ b/src/northbridge/via/cx700/Kconfig
@@ -5,6 +5,7 @@ config NORTHBRIDGE_VIA_CX700
select PCI
select NO_ECAM_MMCONF_SUPPORT
select HAVE_CF9_RESET
+ select SOUTHBRIDGE_INTEL_COMMON_SMBUS
if NORTHBRIDGE_VIA_CX700
diff --git a/src/northbridge/via/cx700/Makefile.mk b/src/northbridge/via/cx700/Makefile.mk
index 550ee2dec3..a7af6fd90d 100644
--- a/src/northbridge/via/cx700/Makefile.mk
+++ b/src/northbridge/via/cx700/Makefile.mk
@@ -1,7 +1,8 @@
## SPDX-License-Identifier: GPL-2.0-only
ifeq ($(CONFIG_NORTHBRIDGE_VIA_CX700),y)
-romstage-y += romstage.c
+bootblock-y += early_smbus.c bootblock.c
+romstage-y += early_smbus.c romstage.c
ramstage-y += chip.c
all-y += clock.c reset.c
diff --git a/src/northbridge/via/cx700/bootblock.c b/src/northbridge/via/cx700/bootblock.c
new file mode 100644
index 0000000000..2de898e8b9
--- /dev/null
+++ b/src/northbridge/via/cx700/bootblock.c
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <device/pci_ops.h>
+#include <static_devices.h>
+#include <arch/bootblock.h>
+
+#define MISC_CONFIG_1 0x94
+#define SMBUS_CLOCK_SELECT (1 << 7)
+
+#define GP2_GP3_TIMER_CONTROL 0x98
+#define GP3_TIMER_TICK_SELECT (3 << 4)
+
+#define SMBUS_IO_BASE 0xd0
+#define SMBUS_HOST_CONFIG 0xd2
+#define SMBUS_CLOCK_FROM_128K (1 << 2)
+#define SMBUS_ENABLE (1 << 0)
+
+void bootblock_early_northbridge_init(void)
+{
+ pci_and_config8(_sdev_lpc, GP2_GP3_TIMER_CONTROL, ~GP3_TIMER_TICK_SELECT);
+
+ pci_and_config8(_sdev_lpc, MISC_CONFIG_1, (u8)~SMBUS_CLOCK_SELECT); /* 14.318MHz */
+ pci_write_config16(_sdev_lpc, SMBUS_IO_BASE, CONFIG_FIXED_SMBUS_IO_BASE);
+ pci_or_config8(_sdev_lpc, SMBUS_HOST_CONFIG, SMBUS_CLOCK_FROM_128K | SMBUS_ENABLE);
+}
diff --git a/src/northbridge/via/cx700/early_smbus.c b/src/northbridge/via/cx700/early_smbus.c
new file mode 100644
index 0000000000..eb8a0f02f9
--- /dev/null
+++ b/src/northbridge/via/cx700/early_smbus.c
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <device/smbus_host.h>
+
+uintptr_t smbus_base(void)
+{
+ return CONFIG_FIXED_SMBUS_IO_BASE;
+}