blob: 095489ed8c9273368f6acb5176d7981cebf1033b [file] [log] [blame]
Timothy Pearsonc522fc82015-02-02 18:25:34 -06001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2015 Timothy Pearson <tpearson@raptorengineeringinc.com>, Raptor Engineering
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <delay.h>
20#include <stdlib.h>
21#include <string.h>
22#include <arch/io.h>
23#include <edid.h>
24
25#include <console/console.h>
26#include <device/device.h>
27#include <device/pci.h>
28#include <device/pci_ids.h>
29#include <device/pci_ops.h>
30
31#include "../common/xgi_coreboot.h"
32#include "../common/XGIfb.h"
33
34static void xgi_z9s_init(struct device *dev)
35{
36 u8 ret;
37 struct xgifb_video_info *xgifb_info;
38
39 printk(BIOS_INFO, "XGI Z9s: initializing video device\n");
40 xgifb_info = malloc(sizeof(*xgifb_info));
41 ret = xgifb_probe(dev, xgifb_info);
42 if (!ret)
43 xgifb_modeset(dev, xgifb_info);
44 free(xgifb_info);
45}
46
47static struct device_operations xgi_z9s_ops = {
48 .read_resources = pci_dev_read_resources,
49 .set_resources = pci_dev_set_resources,
50 .enable_resources = pci_dev_enable_resources,
51 .init = xgi_z9s_init,
52 .scan_bus = 0,
53};
54
55static const struct pci_driver xgi_z9s_driver __pci_driver = {
56 .ops = &xgi_z9s_ops,
57 .vendor = PCI_VENDOR_ID_XGI,
58 .device = PCI_DEVICE_ID_XGI_20,
59};