[coreboot-gerrit] New patch to review for coreboot: 4c03f2f w83627hf/acpi: Move floppy drive enumeration from _INI into _FDE.

Christoph Grenz (christophg+cb@grenz-bonn.de) gerrit at coreboot.org
Thu Jul 4 03:25:46 CEST 2013


Christoph Grenz (christophg+cb at grenz-bonn.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3604

-gerrit

commit 4c03f2fa39f2b0e43314ac8c8c3beafeaa2fb8bb
Author: Christoph Grenz <christophg+cb at grenz-bonn.de>
Date:   Thu Jul 4 03:06:26 2013 +0200

    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 <christophg+cb at grenz-bonn.de>
---
 src/superio/winbond/w83627hf/acpi/superio.asl | 59 ++++++++++++---------------
 1 file changed, 25 insertions(+), 34 deletions(-)

diff --git a/src/superio/winbond/w83627hf/acpi/superio.asl b/src/superio/winbond/w83627hf/acpi/superio.asl
index e8c031a..6dc08b9 100644
--- a/src/superio/winbond/w83627hf/acpi/superio.asl
+++ b/src/superio/winbond/w83627hf/acpi/superio.asl
@@ -211,24 +211,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)
@@ -316,18 +298,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),
@@ -355,11 +352,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)
@@ -384,8 +376,10 @@ Device(SIO) {
 			If (SIFR) { Store (One, FD4) }
 			Store(Zero, ACT4)
 			Store(Zero, SELE)
-			#endif
+
+			Return (FDE)
 		}
+		#endif
 
 
 		Method (_SRS, 1, Serialized)
@@ -406,9 +400,6 @@ Device(SIO) {
 			Store (Local1, IO1H)
 			Store (One, ACTR)
 			EXCM ()
-
-			/* Try probing drives and save result in _FDE */
-			PROB(IOA0)
 		}
 	}
 	#endif



More information about the coreboot-gerrit mailing list