Skip to content

Commit

Permalink
pci: Allow serial I/O base to be reset via UI when hotswapping
Browse files Browse the repository at this point in the history
  • Loading branch information
haxar committed Aug 2, 2022
1 parent c48b070 commit bf9dc2a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ void LpcSetSerialState(int enable)
// Select serial device
LpcWriteRegister(0x07, 0x04);

if (enable) {
// Set serial base
LpcWriteRegister(0x61, SERIAL_PORT & 0xFF);
LpcWriteRegister(0x60, SERIAL_PORT >> 8);
}

// Enable device
LpcWriteRegister(0x30, enable ? 0x01 : 0x00);
}
Expand Down Expand Up @@ -512,10 +518,6 @@ void BootPciPeripheralInitialization(void)
if (!LpcGetSerialState()) {
LpcSetSerialState(1);

// Set Serial Base
LpcWriteRegister(0x61, SERIAL_PORT & 0xFF);
LpcWriteRegister(0x60, SERIAL_PORT >> 8);

// Set Serial Interrupt
LpcSetSerialIRQState(1);
}
Expand Down

0 comments on commit bf9dc2a

Please sign in to comment.