blob: 8a1da2812b6274a8a845b12a6b60b5312e4e0c16 [file] [log] [blame]
Rudolf Marekd9c25492010-05-16 15:31:53 +00001/* Copyright 2003-2004 Tyan Computer
2 * Yinghai Lu yhlu@tyan.com
3 *
4 * Copyright (C) 2010 Rudolf Marek <r.marek@assembler.cz>
5 */
6
7#include <delay.h>
8#include <stdlib.h>
9#include <string.h>
10#include <arch/io.h>
11
12#include <console/console.h>
13#include <device/device.h>
14#include <device/pci.h>
15#include <device/pci_ids.h>
16#include <device/pci_ops.h>
17
18static void si_sata_init(struct device *dev)
19{
20 uint32_t dword;
21 /* enable change device id and class id */
22 dword = pci_read_config32(dev,0x40);
23 dword |= (1<<0);
24 pci_write_config32(dev, 0x40, dword);
25 /* Set IDE Class, Native mode, two drives per channel */
26 dword = 0x01018f00;
27 pci_write_config32(dev, 0x08, dword);
28 /* disable change device id and class id*/
29 dword = pci_read_config32(dev,0x40);
30 dword &= ~(1<<0);
31 pci_write_config32(dev, 0x40, dword);
32 printk(BIOS_INFO, "SIL3114 set to IDE compatible mode\n");
33}
34
35static struct device_operations si_sata_ops = {
36 .read_resources = pci_dev_read_resources,
37 .set_resources = pci_dev_set_resources,
38 .enable_resources = pci_dev_enable_resources,
39 .init = si_sata_init,
40 .scan_bus = 0,
41};
42
43static const struct pci_driver si_sata_driver __pci_driver = {
44 .ops = &si_sata_ops,
45 .vendor = 0x1095,
46 .device = 0x3114,
47};
Denis 'GNUtoo' Carikli8eb63fa2015-10-23 18:00:04 +020048
49static const struct pci_driver si_sata_driver_2 __pci_driver = {
50 .ops = &si_sata_ops,
51 .vendor = 0x1095,
52 .device = 0x0680,
53};