Read out comport on x86 from BDA area
With this patch the comport are tried to read out from the BIOS Data Area on x86 machines. The BDA Area are part of the first physical page and may contain the non-default io ports of the comport. When used together with 'bender' from the 'morbo' toolchain, even serial PCI cards (also Intel's AMT Serial Over Line adapter) are detected automatically.
This commit is contained in:
committed by
Sebastian Sumpf
parent
6c831301d9
commit
d51aad39f1
@@ -612,8 +612,15 @@ public:
|
|||||||
printf("PCI IO port = %x\n", comport);
|
printf("PCI IO port = %x\n", comport);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (comport == -1)
|
if (comport == -1) {
|
||||||
comport = 1;
|
/* try to read Bios Data Area (BDA) to get comport information */
|
||||||
|
unsigned short comport_count = (*((unsigned short *)0x410) >> 9) & 0x7;
|
||||||
|
if (comport_count)
|
||||||
|
comport = *((unsigned short *)0x400);
|
||||||
|
else
|
||||||
|
/* give up and try default values */
|
||||||
|
comport = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (init_uart(comport, comirq, &du))
|
if (init_uart(comport, comirq, &du))
|
||||||
printf("UART init failed\n");
|
printf("UART init failed\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user