- Update abuild.sh so it will rebuild successfull builds
[coreboot.git] / src / mainboard / tyan / s2880 / mainboard.c
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"
7 #include "chip.h"
8
9 #if 0
10 static void fixup_lsi_53c1030(struct device *pdev)
11 {
12 //      uint8_t byte;
13         uint16_t word;
14
15         byte = 1;
16         pci_write_config8(pdev, 0xff, byte);
17            // Set the device id 
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);  
21         word = 0x10f1;
22         pci_write_config16(pdev, PCI_SUBSYSTEM_VENDOR_ID, word);
23             // Set the subsytem id 
24         word = 0x2880;
25         pci_write_config16(pdev, PCI_SUBSYSTEM_ID, word);
26             // Disable writes to the device id 
27         byte = 0;
28         pci_write_config8(pdev, 0xff, byte);
29
30 //      lsi_scsi_init(pdev);
31         
32 }
33 #endif
34
35 #if 0
36 static void print_pci_regs(struct device *dev)
37 {
38       uint8_t byte;
39       int i;
40
41       for(i=0;i<256;i++) {
42              byte = pci_read_config8(dev, i);
43    
44              if((i%16)==0) printk_debug("\n%02x:",i);
45              printk_debug(" %02x",byte);
46       }
47       printk_debug("\n");
48         
49 //        pci_write_config8(dev, 0x4, byte);
50
51 }
52 #endif
53 #if 0
54 static void print_mem(void)
55 {
56         unsigned int i;
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));
61              }
62 #if 0
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));
66              }
67 #endif
68  }
69 #endif
70 #if 0
71 static void amd8111_enable_rom(void)
72 {
73         uint8_t byte;
74         struct device *dev;
75
76         /* Enable 4MB rom access at 0xFFC00000 - 0xFFFFFFFF */
77         /* Locate the amd8111 */
78         dev = dev_find_device(0x1022, 0x7468, 0);
79
80         /* Set the 4MB enable bit bit */
81         byte = pci_read_config8(dev, 0x43);
82         byte |= 0x80;
83         pci_write_config8(dev, 0x43, byte);
84 }
85 #endif
86 #if 0
87 static void onboard_scsi_fixup(void)
88 {
89         struct device *dev;
90 #if 1
91         unsigned char i,j,k;
92
93         for(i=0;i<=15;i++) {
94                 for(j=0;j<=0x1f;j++) {
95                         for (k=0;k<=6;k++){
96                                 dev = dev_find_slot(i, PCI_DEVFN(j, k));
97                                 if (dev) {
98                                         printk_debug("%02x:%02x:%02x",i,j,k);
99                                         print_pci_regs(dev);
100                                 }
101                         }
102                 }
103         }
104 #endif
105
106
107 #if 0
108         dev = dev_find_device(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1030,0);
109         if(!dev) {
110                 printk_info("LSI_SCSI_FW_FIXUP: No Device Found!");
111                 return;
112         }
113
114         lsi_scsi_init(dev); 
115 #endif
116 //      print_mem();
117 //      amd8111_enable_rom();
118 }
119 #endif
120 #if 0
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
124         //   that
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();
129 #endif
130 #if CONFIG_VGABIOS == 1
131         printk_debug("DO THE VGA BIOS\n");
132         do_vgabios(0x0600);
133         post_code(0x93);
134 #endif
135
136 }
137
138 #endif
139  
140 #if 0
141 static void
142 enable(struct chip *chip, enum chip_pass pass)
143 {
144
145         struct mainboard_tyan_s2895_config *conf = 
146                 (struct mainboard_tyan_s2895_config *)chip->chip_info;
147
148         switch (pass) {
149                 default: break;
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)
157 //                              vga_fixup();
158                         printk_debug("mainboard fixup pass %d done\r\n",
159                                         pass);
160                         break;
161         }
162
163 }
164 #endif
165
166 struct chip_operations mainboard_tyan_s2880_ops = {
167         CHIP_NAME("Tayn s2880 mainboard")
168 };