Patrick Georgi (patrick@georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/192
-gerrit
commit c6906e35334a7383706cb5933d688292f39c8de8 Author: Patrick Georgi patrick.georgi@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@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 4f612be..e034d6e 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
/*