added bcm stupid stuff

This commit is contained in:
Li-Ta Lo 2002-06-05 08:58:10 +00:00
commit 0d5ceca823
2 changed files with 79 additions and 3 deletions

View file

@ -11,6 +11,8 @@ northsouthbridge sis/550
option FINAL_MAINBOARD_FIXUP
option HAVE_PIRQ_TABLE=1
dir /src/ram
option USE_RAMTEST=1
object mainboard.o
object irq_tables.o
keyboard pc80

View file

@ -1,16 +1,90 @@
#include <printk.h>
#include <arch/io.h>
#include <pciconf.h>
#include <subr.h>
#include <pci.h>
#include <pci_ids.h>
static unsigned short acpibase;
static void
beep_on(void)
{
/* Timer 2, Mode 3, perodic square ware */
outb(0xb6, 0x43);
/* frequence = 440 Hz */
outb(0x97, 0x42);
outb(0x0a, 0x42);
/* Enable PC speaker gate */
outb(0x03, 0x61);
}
static void
beep_off(void)
{
/* Disable PC speaker gate */
outb(0x00, 0x61);
}
static void
led_on(int led)
{
unsigned enable, level;
enable = inw(acpibase + 0x64);
enable &= ~(1 << led);
outw(enable, acpibase + 0x64);
level = inw(acpibase + 0x66);
level &= ~(1 << led);
outb(level, acpibase + 0x66);
}
static void
led_off(int led)
{
unsigned enable, level;
enable = inw(acpibase + 0x64);
enable |= (1 << led);
outw(enable, acpibase + 0x64);
level = inw(acpibase + 0x66);
level |= (1 << led);
outb(level, acpibase + 0x66);
}
void
mainboard_fixup(void)
{
unsigned long ramsize;
int errors = 0;
struct pci_dev *pcidev;
pcidev = pci_find_device(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, (void *)NULL);
pci_read_config_word(pcidev, 0x74, &acpibase);
led_on(10);
beep_on();
ramsize = sizeram() * 1024;
if (ramcheck(0x00100000, ramsize, 20) != 0) {
error("DRAM Test Error");
}
beep_off();
led_off(10);
led_on(9);
}
void
final_mainboard_fixup(void)
{
void final_southbridge_fixup(void);
void final_southbridge_fixup(void);
printk_info("SiS 550 (and similar)...");
printk_info("SiS 550 (and similar)...");
final_southbridge_fixup();
final_southbridge_fixup();
}