summaryrefslogtreecommitdiffstats
path: root/arch/x86/cpu/intel_common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-03-16 07:44:36 -0600
committerBin Meng <bmeng.cn@gmail.com>2016-03-17 10:27:27 +0800
commit7e4a6ae62c7ee567ae43e94445e561b3ec8343b9 (patch)
tree6fb33d50aa6943375f844432bfe3b6a1921ba9b7 /arch/x86/cpu/intel_common
parentf215287bd59c28443efe6118e7e958be733ce727 (diff)
downloadblackbird-obmc-uboot-7e4a6ae62c7ee567ae43e94445e561b3ec8343b9.tar.gz
blackbird-obmc-uboot-7e4a6ae62c7ee567ae43e94445e561b3ec8343b9.zip
x86: Move common PCH code into a common place
The SATA indexed register write functions are common to several Intel PCHs. Move this into a common location. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/cpu/intel_common')
-rw-r--r--arch/x86/cpu/intel_common/Makefile1
-rw-r--r--arch/x86/cpu/intel_common/pch.c25
2 files changed, 26 insertions, 0 deletions
diff --git a/arch/x86/cpu/intel_common/Makefile b/arch/x86/cpu/intel_common/Makefile
index 1918ca30a8..74b097a6c1 100644
--- a/arch/x86/cpu/intel_common/Makefile
+++ b/arch/x86/cpu/intel_common/Makefile
@@ -11,4 +11,5 @@ obj-$(CONFIG_HAVE_MRC) += me_status.o
ifndef CONFIG_TARGET_EFI
obj-y += microcode.o
endif
+obj-y += pch.o
obj-$(CONFIG_HAVE_MRC) += report_platform.o
diff --git a/arch/x86/cpu/intel_common/pch.c b/arch/x86/cpu/intel_common/pch.c
new file mode 100644
index 0000000000..1f05b44586
--- /dev/null
+++ b/arch/x86/cpu/intel_common/pch.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2016 Google, Inc
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <asm/pch_common.h>
+
+u32 pch_common_sir_read(struct udevice *dev, int idx)
+{
+ u32 data;
+
+ dm_pci_write_config32(dev, SATA_SIRI, idx);
+ dm_pci_read_config32(dev, SATA_SIRD, &data);
+
+ return data;
+}
+
+void pch_common_sir_write(struct udevice *dev, int idx, u32 value)
+{
+ dm_pci_write_config32(dev, SATA_SIRI, idx);
+ dm_pci_write_config32(dev, SATA_SIRD, value);
+}
OpenPOWER on IntegriCloud