Following patch reprograms SIL3114 into PCI IDE native mode compatible class code...
authorRudolf Marek <r.marek@assembler.cz>
Sun, 16 May 2010 15:31:53 +0000 (15:31 +0000)
committerRudolf Marek <r.marek@assembler.cz>
Sun, 16 May 2010 15:31:53 +0000 (15:31 +0000)
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

src/Kconfig
src/drivers/Kconfig [new file with mode: 0644]
src/drivers/Makefile.inc
src/drivers/sil/3114/Makefile.inc [new file with mode: 0644]
src/drivers/sil/3114/sil_sata.c [new file with mode: 0644]
src/mainboard/tyan/s2881/Kconfig
src/mainboard/tyan/s2882/Kconfig

index 67ac5753a7f765ee55e801684879ced9372a198b..5c83a0607d87ce3ece8eb93d622f5aca55c8f726 100644 (file)
@@ -100,6 +100,10 @@ source src/devices/Kconfig
 
 endmenu
 
+menu "Generic Drivers"
+source src/drivers/Kconfig
+endmenu
+
 config PCI_BUS_SEGN_BITS
        int
        default 0
diff --git a/src/drivers/Kconfig b/src/drivers/Kconfig
new file mode 100644 (file)
index 0000000..d2ff5d7
--- /dev/null
@@ -0,0 +1,25 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2010 Rudolf Marek <r.marek@assembler.cz>
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+##
+
+config DRIVERS_SIL
+       bool "Silicon Image SIL3114"
+       default n
+       help
+       It sets PCI class to IDE compatible native mode, allowing
+       SeaBIOS, FILO etc... to boot from it.
index 95a2afd63bc46156a523fe6a2bfb9accce0009e8..de099bb6f70d8f0c0c14b5883c9509c3eb71b14d 100644 (file)
@@ -1,2 +1,3 @@
 subdirs-y += generic/debug
 subdirs-y += ati/ragexl
+subdirs-y += sil/3114
diff --git a/src/drivers/sil/3114/Makefile.inc b/src/drivers/sil/3114/Makefile.inc
new file mode 100644 (file)
index 0000000..7e5db65
--- /dev/null
@@ -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 (file)
index 0000000..1285726
--- /dev/null
@@ -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,
+};
index 482a1df7ea68203a691d8a9c59503411265d4c96..e8d543c18dd84e8c6e79b633f416f1f591c60246 100644 (file)
@@ -13,6 +13,7 @@ config BOARD_TYAN_S2881
        select HAVE_MP_TABLE
        select BOARD_ROMSIZE_KB_512
        select SB_HT_CHAIN_UNITID_OFFSET_ONLY
+       select DRIVERS_SIL
 
 config MAINBOARD_DIR
        string
index ea03bc28a32f480f7a55a2821ca6f10f76d201c2..5fe7eb8198a623b04c49652a2c114b0bd799d3ec 100644 (file)
@@ -12,6 +12,7 @@ config BOARD_TYAN_S2882
        select HAVE_MP_TABLE
        select BOARD_ROMSIZE_KB_512
        select SB_HT_CHAIN_UNITID_OFFSET_ONLY
+       select DRIVERS_SIL
 
 config MAINBOARD_DIR
        string