From 607661601a7e8e24bf0d04ce574dded34d6c8e3e Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Wed, 20 Dec 2000 04:42:36 +0000 Subject: [PATCH] Support for getting keyboard, framebuffer working --- src/northbridge/intel/440gx/northbridge.c | 4 +-- src/southbridge/intel/piix4e/southbridge.c | 42 ++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/northbridge/intel/440gx/northbridge.c b/src/northbridge/intel/440gx/northbridge.c index 692dafb26b..39150f7b28 100644 --- a/src/northbridge/intel/440gx/northbridge.c +++ b/src/northbridge/intel/440gx/northbridge.c @@ -1,5 +1,5 @@ #include - +#include unsigned long sizeram() { @@ -30,7 +30,7 @@ unsigned long sizeram() #ifdef HAVE_FRAMEBUFFER -void intel_framebuffer_on() +void framebuffer_on() { outl(0x8000a004, 0xcf8); outb(0x03, 0xcfc); diff --git a/src/southbridge/intel/piix4e/southbridge.c b/src/southbridge/intel/piix4e/southbridge.c index 9060d9af0d..7ffe7eec20 100644 --- a/src/southbridge/intel/piix4e/southbridge.c +++ b/src/southbridge/intel/piix4e/southbridge.c @@ -27,6 +27,48 @@ void nvram_on() } // Have to talk to Eric Beiderman about this ... +// for now, I am putting in the old keyboard code, until we figure out +// the best way to do this -- RGM + void keyboard_on() { + u32 controlbits; + struct pci_dev *pcidev; + volatile unsigned char regval; + unsigned short devfn; +#define KBC_EN_DEV11 0x10000000 +#define KBC_EIO_EN 0x40000000 + pcidev = pci_find_device(0x8086, 0x7110, (void *)NULL); + + if (! pcidev) { + printk(KERN_ERR __FUNCTION__ "Can't find dev 0x7110\n"); + return; + } + /* oh no, we are setting this below. Fix it later. */ + /* to do -- changed these to PciReadByte */ + pci_read_config_byte(pcidev, 0x4e, ®val); + printk(KERN_DEBUG __FUNCTION__ "regcal at 0x4e is 0x%x\n", regval); + regval |= 0x2; + pci_write_config_byte(pcidev, 0x4e, regval); + + /* this is a hole in the linux pci function design. You get devfn 0, + * but you can't select functions 1-3 using the pci_find_device! + */ + devfn = PCI_DEVFN(0x12, 3); + /* gosh, the PIIX4E is such a special chip! Not in any good sense! */ + /* we have to set two other bits to make the keyboard work. */ + /* this is related to power management, I guess. */ + /* enable the enables -- I'm not kidding, that's what this is. */ + pcibios_read_config_dword(0, devfn, 0x5c, &controlbits); + controlbits |= KBC_EN_DEV11; + pcibios_write_config_dword(0, devfn, 0x5c, controlbits); + + /* now enable actual keyboard IO */ + pcibios_read_config_dword(0, devfn, 0x60, &controlbits); + controlbits |= KBC_EIO_EN; + pcibios_write_config_dword(0, devfn, 0x60, controlbits); + + /* now keyboard should work, ha ha. */ + pc_keyboard_init(); + }