1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/chip.h>
4 #include <device/pci.h>
5 #include <device/pci_ids.h>
6 #include <device/pci_ops.h>
8 //#include <part/mainboard.h>
9 //#include "lsi_scsi.c"
10 unsigned long initial_apicid[MAX_CPUS] =
15 static void fixup_lsi_53c1030(struct device *pdev)
21 pci_write_config8(pdev, 0xff, byte);
23 // pci_write_config_word(pdev, PCI_DEVICE_ID, PCI_DEVICE_ID_LSILOGIC_53C1030);
24 // Set the subsytem vendor id
25 // pci_write_config16(pdev, PCI_SUBSYSTEM_VENDOR_ID, PCI_VENDOR_ID_TYAN);
27 pci_write_config16(pdev, PCI_SUBSYSTEM_VENDOR_ID, word);
28 // Set the subsytem id
30 pci_write_config16(pdev, PCI_SUBSYSTEM_ID, word);
31 // Disable writes to the device id
33 pci_write_config8(pdev, 0xff, byte);
35 // lsi_scsi_init(pdev);
39 //extern static void lsi_scsi_init(struct device *dev);
41 static void print_pci_regs(struct device *dev)
47 byte = pci_read_config8(dev, i);
49 if((i%16)==0) printk_info("\n%02x:",i);
50 printk_debug(" %02x",byte);
54 // pci_write_config8(dev, 0x4, byte);
59 static void print_mem(void)
63 for(i=low_1MB;i<low_1MB+1024*4;i++) {
64 if((i%16)==0) printk_debug("\n %08x:",i);
65 printk_debug(" %02x ",(unsigned char)*((unsigned char *)i));
68 for(i=low_1MB;i<low_1MB+1024*4;i++) {
69 if((i%16)==0) printk_debug("\n %08x:",i);
70 printk_debug(" %c ",(unsigned char)*((unsigned char *)i));
75 static void amd8111_enable_rom(void)
80 /* Enable 4MB rom access at 0xFFC00000 - 0xFFFFFFFF */
81 /* Locate the amd8111 */
82 dev = dev_find_device(0x1022, 0x7468, 0);
84 /* Set the 4MB enable bit bit */
85 byte = pci_read_config8(dev, 0x43);
87 pci_write_config8(dev, 0x43, byte);
90 static void onboard_scsi_fixup(void)
96 for(j=0;j<=0x1f;j++) {
98 dev = dev_find_slot(i, PCI_DEVFN(j, k));
100 printk_debug("%02x:%02x:%02x",i,j,k);
110 dev = dev_find_device(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1030,0);
112 printk_info("LSI_SCSI_FW_FIXUP: No Device Found!");
119 // amd8111_enable_rom();
122 static void vga_fixup(void) {
123 // we do this right here because:
124 // - all the hardware is working, and some VGA bioses seem to need
126 // - we need page 0 below for linuxbios tables.
127 #if CONFIG_REALMODE_IDT == 1
128 printk_debug("INSTALL REAL-MODE IDT\n");
129 setup_realmode_idt();
131 #if CONFIG_VGABIOS == 1
132 printk_debug("DO THE VGA BIOS\n");
141 enable(struct chip *chip, enum chip_pass pass)
144 struct mainboard_tyan_s2885_config *conf =
145 (struct mainboard_tyan_s2885_config *)chip->chip_info;
149 // case CONF_PASS_PRE_CONSOLE:
150 // case CONF_PASS_PRE_PCI:
151 // case CONF_PASS_POST_PCI:
152 case CONF_PASS_PRE_BOOT:
153 if (conf->fixup_scsi)
154 onboard_scsi_fixup();
155 // if (conf->fixup_vga)
157 printk_debug("mainboard fixup pass %d done\r\n",
163 void final_mainboard_fixup(void)
166 enable_ide_devices();
170 struct chip_control mainboard_tyan_s2885_control = {
172 .name= "Tyan s2885 mainboard "