From 7037840ece7ed221990a8e683293408b81a4cfd1 Mon Sep 17 00:00:00 2001 From: Christoph Grenz Date: Thu, 4 Jul 2013 03:06:26 +0200 Subject: w83627hf/acpi: Move floppy drive enumeration from _INI into _FDE. Move the floppy drive enumeration from _INI() and PROB(), which stored the enumeration results into _FDE into _FDE(). _INI is called by any ACPI-capable OS on boot while _FDE is rarely used. So it's better to run the enumeration when requested rather than unconditionally. Change-Id: Icf1e2a551806592faa8ba8d80fa8d02681602007 Signed-off-by: Christoph Grenz Reviewed-on: http://review.coreboot.org/3604 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/superio/winbond/w83627hf/acpi/superio.asl | 59 ++++++++++++--------------- 1 file changed, 25 insertions(+), 34 deletions(-) (limited to 'src/superio') diff --git a/src/superio/winbond/w83627hf/acpi/superio.asl b/src/superio/winbond/w83627hf/acpi/superio.asl index 90d14ff451..85313393e8 100644 --- a/src/superio/winbond/w83627hf/acpi/superio.asl +++ b/src/superio/winbond/w83627hf/acpi/superio.asl @@ -212,24 +212,6 @@ Device(SIO) { Name (_STR, Unicode ("W83627HF Floppy Disk Controller")) Name (_UID, "w83627hf-fdc") - #ifndef NO_W83627HF_FDC_ENUM - /* Initialization method: Should be run once on boot - If FDC is active, enumerate all connected devices */ - Method (_INI) { - ENCM (0) - Store (ACTR, Local0) - Store (IO1H, Local1) - Store (IO1L, Local2) - EXCM () - ShiftLeft(Local1, 8, Local1) - Or(Local1, Local2, Local1) - If (Local0) { - /* Try probing drives and save result in _FDE */ - PROB(Local1) - } - } - #endif - Method (_STA) { Store (0x00, Local0) @@ -317,18 +299,33 @@ Device(SIO) { } #ifndef NO_W83627HF_FDC_ENUM - Name(_FDE, Buffer(){0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}) - #endif - - Method (PROB, 1) { - #ifndef NO_W83627HF_FDC_ENUM - /* Try probing drives and save result in _FDE + Method (_FDE, 0) { + /* Try probing drives. Probing is done through selecting and activating a drive and reading 0x03F7 aka the "shared IDE and floppy register" as any value there besides zero seems to indicate a connected drive. */ - OperationRegion (FIO1, SystemIO, Arg0, 0x06) + // Create template + Name(FDE, Buffer(){0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}) + CreateByteField (FDE, 1, FD1) + CreateByteField (FDE, 4, FD2) + CreateByteField (FDE, 8, FD3) + CreateByteField (FDE, 12, FD4) + + // Get resources from logical device + ENCM (0) + Store (ACTR, Local0) + Store (IO1H, Local1) + Store (IO1L, Local2) + EXCM () + ShiftLeft(Local1, 8, Local1) + Or(Local1, Local2, Local1) + If (LNot(Local0)) { + Return (FDE) + } + + OperationRegion (FIO1, SystemIO, Local1, 0x06) Field (FIO1, ByteAcc, NoLock, Preserve) { Offset(0x02), @@ -356,11 +353,6 @@ Device(SIO) { SIFR, 8 } - CreateByteField (_FDE, 1, FD1) - CreateByteField (_FDE, 4, FD2) - CreateByteField (_FDE, 8, FD3) - CreateByteField (_FDE, 12, FD4) - Store(One, ACT1) Store(0, SELE) Sleep(0x64) @@ -385,8 +377,10 @@ Device(SIO) { If (SIFR) { Store (One, FD4) } Store(Zero, ACT4) Store(Zero, SELE) - #endif + + Return (FDE) } + #endif Method (_SRS, 1, Serialized) @@ -407,9 +401,6 @@ Device(SIO) { Store (Local1, IO1H) Store (One, ACTR) EXCM () - - /* Try probing drives and save result in _FDE */ - PROB(IOA0) } } #endif -- cgit v1.2.3