2 * This file is part of the coreboot project.
4 * Copyright (C) 2012 Rudolf Marek <r.marek@assembler.cz>
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.
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.
17 #include <console/console.h>
18 #include <device/device.h>
19 #include <device/pci.h>
20 #include <device/pci_ids.h>
21 #include <pc80/i8259.h>
24 static const unsigned char enetIrqs
[4] = { 10, 0, 0, 0 };
25 static const unsigned char usbIrqs
[4] = { 15, 14, 0, 0 };
27 static void pci_routing_fixup(struct device
*dev
)
29 pci_assign_irqs(0, 0x8, enetIrqs
);
30 pci_assign_irqs(0, 0xa, usbIrqs
);
33 static void r8610_init(struct device
*dev
)
38 printk(BIOS_DEBUG
, "r8610 init\n");
47 pci_write_config32(dev
, 0x54, 0x3f8);
48 /* serial IRQ disable, LPC disable, COM2 goes to LPC, internal UART for COM1 */
49 pci_write_config32(dev
, 0x50, 0x84101012);
51 /* Enable internal Port92, enable chipselect for flash */
52 tmp
= pci_read_config32(dev
, 0x40);
53 pci_write_config32(dev
, 0x40, tmp
| 0x07FF0600);
55 /* buffer strength SB pins */
56 pci_write_config32(dev
, 0x5c, 0x2315);
58 /* EHCI 14, OHCI 15, MAC1 disable, MAC0 10, INTD 9, INTC 9, INTB 12, INTA INT10 */
59 pci_write_config32(dev
, 0x58, 0xdf0311b3);
62 nb_dev
= dev_find_device(PCI_VENDOR_ID_RDC
,
63 PCI_DEVICE_ID_RDC_R8610_NB
, 0);
65 tmp
= pci_read_config32(nb_dev
, 0xc0);
67 pci_write_config32(nb_dev
, 0xc0, tmp
);
72 static void r8610_read_resources(device_t dev
)
76 pci_dev_read_resources(dev
);
78 res
= new_resource(dev
, 1);
81 res
->limit
= 0xffffUL
;
82 res
->flags
= IORESOURCE_IO
| IORESOURCE_ASSIGNED
| IORESOURCE_FIXED
;
84 /* Reserve space for flash */
85 res
= new_resource(dev
, 2);
86 res
->base
= 0xff800000;
87 res
->size
= 8*1024*1024;
88 res
->limit
= 0xffffffffUL
;
89 res
->flags
= IORESOURCE_MEM
| IORESOURCE_FIXED
| IORESOURCE_STORED
|
93 static void southbridge_init(struct device
*dev
)
96 pci_routing_fixup(dev
);
99 static struct device_operations r8610_sb_ops
= {
100 .read_resources
= r8610_read_resources
,
101 .set_resources
= pci_dev_set_resources
,
102 .enable_resources
= pci_dev_enable_resources
,
103 .init
= &southbridge_init
,
108 static const struct pci_driver lpc_driver __pci_driver
= {
109 .ops
= &r8610_sb_ops
,
110 .vendor
= PCI_VENDOR_ID_RDC
,
111 .device
= PCI_DEVICE_ID_RDC_R8610_SB
,