[platform][pc] fix up bios32 PCI support, get pci IDE working again
-Spiff up the device driver starting logic to allow for statically started devices, instead of always automatic.
This commit is contained in:
@@ -44,23 +44,39 @@ static const struct platform_uart_config uart0_config = {
|
||||
DEVICE_INSTANCE(uart, uart0, &uart0_config);
|
||||
#endif
|
||||
|
||||
#ifndef ARCH_X86_64
|
||||
// two legacy ISA IDE devices
|
||||
static const struct platform_ide_config ide0_config = {
|
||||
.legacy_index = 0,
|
||||
};
|
||||
|
||||
DEVICE_INSTANCE(ide, ide0, &ide0_config);
|
||||
DEVICE_INSTANCE(ide, ide0, &ide0_config, 0);
|
||||
|
||||
static const struct platform_ide_config ide1_config = {
|
||||
.legacy_index = 1,
|
||||
};
|
||||
DEVICE_INSTANCE(ide, ide1, &ide1_config, 0);
|
||||
|
||||
DEVICE_INSTANCE(ide, ide1, &ide1_config);
|
||||
// two PCI IDE devices
|
||||
static const struct platform_ide_config pci_ide0_config = {
|
||||
.legacy_index = 0x80,
|
||||
};
|
||||
DEVICE_INSTANCE(ide, pci_ide0, &pci_ide0_config, 0);
|
||||
|
||||
#endif
|
||||
static const struct platform_ide_config pci_ide1_config = {
|
||||
.legacy_index = 0x81,
|
||||
};
|
||||
DEVICE_INSTANCE(ide, pci_ide1, &pci_ide1_config, 0);
|
||||
|
||||
void target_init(void)
|
||||
{
|
||||
// initialize static devices
|
||||
device_init_all();
|
||||
|
||||
// try to initialize pci ide first
|
||||
if (device_init(&__device_ide_pci_ide0) < 0 || device_init(&__device_ide_pci_ide1) < 0) {
|
||||
// if that fails, initialize the legacy ISA IDE controllers
|
||||
device_init(&__device_ide_ide0);
|
||||
device_init(&__device_ide_ide1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user