[coreboot] New patch to review: a8b71bd Unlock ATAPI devices on boot

Patrick Georgi (patrick@georgi-clan.de) gerrit at coreboot.org
Mon Sep 5 13:40:13 CEST 2011


Patrick Georgi (patrick at georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/192

-gerrit

commit a8b71bd56bf205fd2add685ba8e0f0412a123080
Author: Patrick Georgi <patrick.georgi at secunet.com>
Date:   Tue Aug 24 11:07:21 2010 +0200

    Unlock ATAPI devices on boot
    
    This makes CD/DVD drives accessible that were locked prior to a
    reboot.
    
    Change-Id: I4f2a0ddafac2debe0a1564904f37025850cc519e
    Signed-off-by: Patrick Georgi <patrick.georgi at secunet.com>
---
 drivers/ide_new.c |   13 +++++++++++++
 drivers/ide_new.h |    1 +
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/ide_new.c b/drivers/ide_new.c
index ddcc027..a2870b8 100644
--- a/drivers/ide_new.c
+++ b/drivers/ide_new.c
@@ -658,6 +658,19 @@ ob_ide_atapi_drive_ready(struct ide_drive *drive)
 		return 1;
 	}
 
+	/* clear Persistent Prevent State */
+	memset (cmd, 0, sizeof(*cmd));
+	cmd->cdb[0] = ATAPI_PREVENT_ALLOW_MEDIUM_REMOVAL;
+	cmd->cdb[2] = 2;
+	if (ob_ide_atapi_packet(drive, cmd))
+		printf("could not persistently unlock device\n");
+
+	/* clear Prevent State */
+	memset (cmd, 0, sizeof(*cmd));
+	cmd->cdb[0] = ATAPI_PREVENT_ALLOW_MEDIUM_REMOVAL;
+	if (ob_ide_atapi_packet(drive, cmd))
+		printf("could not unlock device\n");
+
 	/*
 	 * finally, get capacity and block size
 	 */
diff --git a/drivers/ide_new.h b/drivers/ide_new.h
index 8d3979a..f667e41 100644
--- a/drivers/ide_new.h
+++ b/drivers/ide_new.h
@@ -70,6 +70,7 @@
 #define ATAPI_READ_10		0x28
 #define ATAPI_REQ_SENSE		0x03
 #define ATAPI_START_STOP_UNIT	0x1b
+#define ATAPI_PREVENT_ALLOW_MEDIUM_REMOVAL  0x1e
 #define ATAPI_READ_CAPACITY	0x25
 
 /*




More information about the coreboot mailing list