summaryrefslogtreecommitdiff
path: root/src/drivers/sil
diff options
context:
space:
mode:
authorRudolf Marek <r.marek@assembler.cz>2010-05-16 15:31:53 +0000
committerRudolf Marek <r.marek@assembler.cz>2010-05-16 15:31:53 +0000
commitd9c2549333e1d688cf0b4ec82d8945dea77e0bbf (patch)
treedbf540270226e512df1c71d91cfa8bcffdedb190 /src/drivers/sil
parent7cfa7f97a1affb06f493a2335c99b213a91d335d (diff)
downloadcoreboot-d9c2549333e1d688cf0b4ec82d8945dea77e0bbf.tar.xz
Following patch reprograms SIL3114 into PCI IDE native mode compatible class code allowing
legacy software to recognize it as IDE and boot from it. I think this should be the default for two Tyan boards (k8s aka s2882 and s2881). Rename the directory to sil prefix to match the Linux kernel naming. (And I think it was a SiliconSystems wish to be named sil ;) Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5560 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/drivers/sil')
-rw-r--r--src/drivers/sil/3114/Makefile.inc1
-rw-r--r--src/drivers/sil/3114/sil_sata.c47
2 files changed, 48 insertions, 0 deletions
diff --git a/src/drivers/sil/3114/Makefile.inc b/src/drivers/sil/3114/Makefile.inc
new file mode 100644
index 0000000000..7e5db65987
--- /dev/null
+++ b/src/drivers/sil/3114/Makefile.inc
@@ -0,0 +1 @@
+driver-$(CONFIG_DRIVERS_SIL) += sil_sata.o
diff --git a/src/drivers/sil/3114/sil_sata.c b/src/drivers/sil/3114/sil_sata.c
new file mode 100644
index 0000000000..1285726ec1
--- /dev/null
+++ b/src/drivers/sil/3114/sil_sata.c
@@ -0,0 +1,47 @@
+/* Copyright 2003-2004 Tyan Computer
+ * Yinghai Lu yhlu@tyan.com
+ *
+ * Copyright (C) 2010 Rudolf Marek <r.marek@assembler.cz>
+ */
+
+#include <delay.h>
+#include <stdlib.h>
+#include <string.h>
+#include <arch/io.h>
+
+#include <console/console.h>
+#include <device/device.h>
+#include <device/pci.h>
+#include <device/pci_ids.h>
+#include <device/pci_ops.h>
+
+static void si_sata_init(struct device *dev)
+{
+ uint32_t dword;
+ /* enable change device id and class id */
+ dword = pci_read_config32(dev,0x40);
+ dword |= (1<<0);
+ pci_write_config32(dev, 0x40, dword);
+ /* Set IDE Class, Native mode, two drives per channel */
+ dword = 0x01018f00;
+ pci_write_config32(dev, 0x08, dword);
+ /* disable change device id and class id*/
+ dword = pci_read_config32(dev,0x40);
+ dword &= ~(1<<0);
+ pci_write_config32(dev, 0x40, dword);
+ printk(BIOS_INFO, "SIL3114 set to IDE compatible mode\n");
+}
+
+static struct device_operations si_sata_ops = {
+ .read_resources = pci_dev_read_resources,
+ .set_resources = pci_dev_set_resources,
+ .enable_resources = pci_dev_enable_resources,
+ .init = si_sata_init,
+ .scan_bus = 0,
+};
+
+static const struct pci_driver si_sata_driver __pci_driver = {
+ .ops = &si_sata_ops,
+ .vendor = 0x1095,
+ .device = 0x3114,
+};