Support for getting keyboard, framebuffer working

This commit is contained in:
Ronald G. Minnich 2000-12-20 04:42:36 +00:00
commit 607661601a
2 changed files with 44 additions and 2 deletions

View file

@ -1,5 +1,5 @@
#include <pci.h>
#include <cpu/p5/io.h>
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);

View file

@ -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, &regval);
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();
}