===================================================================
@@ -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_SI
+ bool "Silicon Image SIL3114"
+ default n
+ help
+ It sets PCI class to IDE compatible native mode, allowing
+ SeaBIOS, FILO etc... to boot from it.
===================================================================
@@ -1,2 +1,3 @@
subdirs-y += generic/debug
subdirs-y += ati/ragexl
+subdirs-y += si/3114
===================================================================
@@ -1,10 +1,9 @@
-/* Copyright 2003-2004 Tyan Computer*/
-
-/* Author: Yinghai Lu yhlu@tyan.com
+/* 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>
@@ -16,41 +15,23 @@
#include <device/pci_ids.h>
#include <device/pci_ops.h>
-
static void si_sata_init(struct device *dev)
{
- uint16_t word;
uint32_t dword;
-#if 0
- word = pci_read_config16(dev, 0x4);
- word |= ((1 << 2) |(1<<4)); // Command: 3--> 17
- pci_write_config16(dev, 0x4, word);
-#endif
-
- /* some driver change class code to 0x104, but not change deviceid without reason*/
- /* restore it so we don't need to unplug AC power to restore it*/
-
- word = pci_read_config16(dev, 0x0a);
- if(word!=0x0180) {
- /* enble change device id and class id*/
- dword = pci_read_config32(dev,0x40);
- dword |= (1<<0);
- pci_write_config32(dev, 0x40, dword);
-
- word = 0x0180;
- pci_write_config16(dev, 0x0a, word);
-
- /* disable change device id and class id*/
- dword = pci_read_config32(dev,0x40);
- dword &= ~(1<<0);
- pci_write_config32(dev, 0x40, dword);
-
- printk(BIOS_DEBUG, "Class code restored.\n");
-
- }
-
-
+ /* 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,
@@ -64,4 +45,3 @@
.vendor = 0x1095,
.device = 0x3114,
};
-
===================================================================
@@ -0,0 +1 @@
+driver-$(CONFIG_DRIVERS_SI) += si_sata.o
===================================================================
@@ -13,6 +13,7 @@
select HAVE_MP_TABLE
select BOARD_ROMSIZE_KB_512
select SB_HT_CHAIN_UNITID_OFFSET_ONLY
+ select DRIVERS_SII
config MAINBOARD_DIR
string
===================================================================
@@ -12,6 +12,7 @@
select HAVE_MP_TABLE
select BOARD_ROMSIZE_KB_512
select SB_HT_CHAIN_UNITID_OFFSET_ONLY
+ select DRIVERS_SII
config MAINBOARD_DIR
string