[OpenBIOS] [PATCH 1/2] ide: change ob_ide_init() to take usual control base addresses

Hervé Poussineau hpoussin at reactos.org
Mon Dec 16 22:52:35 CET 2013


The +2 offset comes from the PCI IDE controllers, where control
status must be accessed at BAR1+2 and BAR3+2.

Signed-off-by: Hervé Poussineau <hpoussin at reactos.org>
---
 arch/amd64/openbios.c |    2 +-
 arch/x86/openbios.c   |    2 +-
 drivers/ide.c         |    4 ++--
 drivers/pci.c         |    4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/amd64/openbios.c b/arch/amd64/openbios.c
index f632e93..15d3b62 100644
--- a/arch/amd64/openbios.c
+++ b/arch/amd64/openbios.c
@@ -44,7 +44,7 @@ arch_init( void )
 	modules_init();
 #ifdef CONFIG_DRIVER_IDE
 	setup_timers();
-	ob_ide_init("/pci/pci-ata", 0x1f0, 0x3f4, 0x170, 0x374);
+	ob_ide_init("/pci/pci-ata", 0x1f0, 0x3f6, 0x170, 0x376);
 #endif
 	device_end();
 	bind_func("platform-boot", boot );
diff --git a/arch/x86/openbios.c b/arch/x86/openbios.c
index 23721bc..6145436 100644
--- a/arch/x86/openbios.c
+++ b/arch/x86/openbios.c
@@ -57,7 +57,7 @@ arch_init( void )
 #endif
 #ifdef CONFIG_DRIVER_IDE
 	setup_timers();
-	ob_ide_init("/pci/isa", 0x1f0, 0x3f4, 0x170, 0x374);
+	ob_ide_init("/pci/isa", 0x1f0, 0x3f6, 0x170, 0x376);
 #endif
 #ifdef CONFIG_DRIVER_FLOPPY
 	ob_floppy_init("/isa", "floppy0", 0x3f0, 0);
diff --git a/drivers/ide.c b/drivers/ide.c
index 125b9ce..0e0f0cf 100644
--- a/drivers/ide.c
+++ b/drivers/ide.c
@@ -1372,9 +1372,9 @@ int ob_ide_init(const char *path, uint32_t io_port0, uint32_t ctl_port0,
 	u32 props[6];
 
 	io_ports[0] = io_port0;
-	ctl_ports[0] = ctl_port0 + 2;
+	ctl_ports[0] = ctl_port0;
 	io_ports[1] = io_port1;
-	ctl_ports[1] = ctl_port1 + 2;
+	ctl_ports[1] = ctl_port1;
 
 	for (i = 0; i < IDE_NUM_CHANNELS; i++, current_channel++) {
 
diff --git a/drivers/pci.c b/drivers/pci.c
index c13f031..ee35b61 100644
--- a/drivers/pci.c
+++ b/drivers/pci.c
@@ -584,9 +584,9 @@ int ide_config_cb2 (const pci_config_t *config)
 {
 	ob_ide_init(config->path,
 		    config->assigned[0] & ~0x0000000F,
-		    config->assigned[1] & ~0x0000000F,
+		    (config->assigned[1] & ~0x0000000F) + 2,
 		    config->assigned[2] & ~0x0000000F,
-		    config->assigned[3] & ~0x0000000F);
+		    (config->assigned[3] & ~0x0000000F) + 2);
 	return 0;
 }
 
-- 
1.7.10.4




More information about the OpenBIOS mailing list