Skip to content

Commit bf9dc2a

Browse files
committed
pci: Allow serial I/O base to be reset via UI when hotswapping
1 parent c48b070 commit bf9dc2a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/pci/pci.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ void LpcSetSerialState(int enable)
205205
// Select serial device
206206
LpcWriteRegister(0x07, 0x04);
207207

208+
if (enable) {
209+
// Set serial base
210+
LpcWriteRegister(0x61, SERIAL_PORT & 0xFF);
211+
LpcWriteRegister(0x60, SERIAL_PORT >> 8);
212+
}
213+
208214
// Enable device
209215
LpcWriteRegister(0x30, enable ? 0x01 : 0x00);
210216
}
@@ -512,10 +518,6 @@ void BootPciPeripheralInitialization(void)
512518
if (!LpcGetSerialState()) {
513519
LpcSetSerialState(1);
514520

515-
// Set Serial Base
516-
LpcWriteRegister(0x61, SERIAL_PORT & 0xFF);
517-
LpcWriteRegister(0x60, SERIAL_PORT >> 8);
518-
519521
// Set Serial Interrupt
520522
LpcSetSerialIRQState(1);
521523
}

0 commit comments

Comments
 (0)