1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/pci.h>
4 #include <device/pci_ids.h>
5 #include <device/pci_ops.h>
6 #include "../../../northbridge/amd/amdk8/northbridge.h"
10 static void fixup_lsi_53c1030(struct device *pdev)
16 pci_write_config8(pdev, 0xff, byte);
18 // pci_write_config_word(pdev, PCI_DEVICE_ID, PCI_DEVICE_ID_LSILOGIC_53C1030);
19 // Set the subsytem vendor id
20 // pci_write_config16(pdev, PCI_SUBSYSTEM_VENDOR_ID, PCI_VENDOR_ID_TYAN);
22 pci_write_config16(pdev, PCI_SUBSYSTEM_VENDOR_ID, word);
23 // Set the subsytem id
25 pci_write_config16(pdev, PCI_SUBSYSTEM_ID, word);
26 // Disable writes to the device id
28 pci_write_config8(pdev, 0xff, byte);
30 // lsi_scsi_init(pdev);
36 static void print_pci_regs(struct device *dev)
42 byte = pci_read_config8(dev, i);
44 if((i%16)==0) printk_debug("\n%02x:",i);
45 printk_debug(" %02x",byte);
49 // pci_write_config8(dev, 0x4, byte);
54 static void print_mem(void)
57 unsigned int low_1MB = 0xf4107000;
58 for(i=low_1MB;i<low_1MB+1024;i++) {
59 if((i%16)==0) printk_debug("\n %08x:",i);
60 printk_debug(" %02x ",(unsigned char)*((unsigned char *)i));
63 for(i=low_1MB;i<low_1MB+1024*4;i++) {
64 if((i%16)==0) printk_debug("\n %08x:",i);
65 printk_debug(" %c ",(unsigned char)*((unsigned char *)i));
71 static void amd8111_enable_rom(void)
76 /* Enable 4MB rom access at 0xFFC00000 - 0xFFFFFFFF */
77 /* Locate the amd8111 */
78 dev = dev_find_device(0x1022, 0x7468, 0);
80 /* Set the 4MB enable bit bit */
81 byte = pci_read_config8(dev, 0x43);
83 pci_write_config8(dev, 0x43, byte);
87 static void onboard_scsi_fixup(void)
94 for(j=0;j<=0x1f;j++) {
96 dev = dev_find_slot(i, PCI_DEVFN(j, k));
98 printk_debug("%02x:%02x:%02x",i,j,k);
108 dev = dev_find_device(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1030,0);
110 printk_info("LSI_SCSI_FW_FIXUP: No Device Found!");
117 // amd8111_enable_rom();
121 static void vga_fixup(void) {
122 // we do this right here because:
123 // - all the hardware is working, and some VGA bioses seem to need
125 // - we need page 0 below for linuxbios tables.
126 #if CONFIG_REALMODE_IDT == 1
127 printk_debug("INSTALL REAL-MODE IDT\n");
128 setup_realmode_idt();
130 #if CONFIG_VGABIOS == 1
131 printk_debug("DO THE VGA BIOS\n");
142 enable(struct chip *chip, enum chip_pass pass)
145 struct mainboard_tyan_s2895_config *conf =
146 (struct mainboard_tyan_s2895_config *)chip->chip_info;
150 // case CONF_PASS_PRE_CONSOLE:
151 // case CONF_PASS_PRE_PCI:
152 // case CONF_PASS_POST_PCI:
153 case CONF_PASS_PRE_BOOT:
154 // if (conf->fixup_scsi)
155 // onboard_scsi_fixup();
156 // if (conf->fixup_vga)
158 printk_debug("mainboard fixup pass %d done\r\n",
166 struct chip_operations mainboard_tyan_s4880_ops = {
167 CHIP_NAME("Tyan s4880 mainboard")