This list is closed, nobody may subscribe to it.
2004 |
Jan
(53) |
Feb
(78) |
Mar
(34) |
Apr
(26) |
May
(25) |
Jun
(34) |
Jul
(16) |
Aug
(16) |
Sep
(2) |
Oct
(58) |
Nov
(13) |
Dec
(32) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(62) |
Feb
(4) |
Mar
(40) |
Apr
(9) |
May
(13) |
Jun
(26) |
Jul
(32) |
Aug
(24) |
Sep
(18) |
Oct
(18) |
Nov
(14) |
Dec
|
2006 |
Jan
(15) |
Feb
(2) |
Mar
(23) |
Apr
(2) |
May
(2) |
Jun
(13) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2007 |
Jan
(1) |
Feb
(45) |
Mar
|
Apr
(13) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(31) |
Dec
(5) |
2008 |
Jan
(6) |
Feb
(34) |
Mar
(113) |
Apr
(40) |
May
(19) |
Jun
(5) |
Jul
(41) |
Aug
(13) |
Sep
(53) |
Oct
(4) |
Nov
(53) |
Dec
|
2009 |
Jan
(1) |
Feb
(29) |
Mar
(66) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(163) |
Nov
|
Dec
(91) |
From: <he...@us...> - 2005-06-12 00:49:58
|
Update of /cvsroot/gc-linux/linux/drivers/block/gcn-di In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26101 Modified Files: drive_20010608.h drive_20020402.h drive_20020823.h Log Message: Oops, forgot to include the pre-compiled firmware. Index: drive_20010608.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/drive_20010608.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- drive_20010608.h 31 May 2005 18:33:42 -0000 1.2 +++ drive_20010608.h 12 Jun 2005 00:49:49 -0000 1.3 @@ -2,13 +2,13 @@ const char drive_20010608_firmware[] = "\xf4\xe1\xa5\x38\xc7\xdc\x00\x80\xf4\x71\xc8\xe9\x08\x80\x6e\xf4" "\xe1\x1a\x5f\xc7\xdc\x6e\x80\xa0\xf8\xac\x01\xf4\xe1\x30\x5f\xc7" - "\xf4\x74\x47\xd0\x40\xf7\x20\x4c\x80\xf4\x74\xf0\xaa\x08\xf7\x20" - "\xd6\xfc\xf4\x74\x45\xb1\x08\xf7\x20\xd2\xfc\x80\x0c\xc4\xda\xfc" + "\xf4\x74\x47\xd0\x40\xf7\x20\x4c\x80\xf4\x74\x42\x9d\x08\xf7\x20" + "\xd6\xfc\xf4\x74\x45\xb1\x08\xf7\x20\xd2\xfc\x80\x04\xc4\xda\xfc" "\xf4\x74\x1e\xd4\x08\xf0\x00\xc8\xda\xfc\xf5\x00\x01\xe9\x73\xc8" "\xda\xfc\xf5\x00\x02\xe8\x03\xfc\xec\x00\xf4\x74\x02\xed\x40\x80" "\x02\xf0\x20\xc8\x78\x80\xc0\x90\x81\xdc\xa8\x80\xf5\x30\x00\xf4" - "\x44\x7d\xd1\x40\xf8\xaa\x00\x10\xf4\xd0\x78\xd1\x40\xf0\x01\xdc" - "\xa8\x80\xf5\x30\x00\xf7\x48\xaa\x00\xe9\x07\xf4\xc4\x7d\xd1\x40" + "\x44\x79\xd1\x40\xf8\xaa\x00\x10\xf4\xd0\x74\xd1\x40\xf0\x01\xdc" + "\xa8\x80\xf5\x30\x00\xf7\x48\xaa\x00\xe9\x07\xf4\xc4\x79\xd1\x40" "\x10\xfe\xf7\x48\xee\x00\xe8\x0c\xd8\x55\xe9\x25\xcc\xa9\x80\xfd" "\x53\x00\xea\x0c\xcc\xa9\x80\xc4\xa4\x81\xcc\xaa\x80\xc4\x88\x81" "\xdc\xa8\x80\xf8\xe0\x00\x10\xa0\xf5\x10\x01\xf5\x10\x02\xf5\x10" @@ -16,15 +16,14 @@ "\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b\x80\xd8\x01\xe9" "\x02\x7c\x04\xf4\x75\x13\xd1\x40\x51\x20\x71\x34\xf4\x7d\xb9\x85" "\x08\xe9\x1b\x80\x00\xcd\xda\xfc\xd8\x00\xe9\x06\xf7\x01\xf7\xff" - "\xea\x03\xf5\x09\x08\xc5\xda\xfc\xf4\x75\x7c\xd1\x40\x14\xfe\x80" + "\xea\x03\xf5\x09\x08\xc5\xda\xfc\xf4\x75\x78\xd1\x40\x14\xfe\x80" "\x01\xea\xe2\xf7\x10\xff\xf7\x21\xf4\x79\x00\xf0\x00\xe9\x0e\x80" - "\x00\xf4\xc9\x7c\xd1\x40\xd9\x00\xe8\x03\xf5\x10\x09\x21\xd9\x06" - "\xe9\x0f\x61\x06\xf4\xc8\x7c\xd1\x40\xd8\x00\xe8\x02\xd5\x06\x41" + "\x00\xf4\xc9\x78\xd1\x40\xd9\x00\xe8\x03\xf5\x10\x09\x21\xd9\x06" + "\xe9\x0f\x61\x06\xf4\xc8\x78\xd1\x40\xd8\x00\xe8\x02\xd5\x06\x41" "\x06\xf4\xe0\x0a\xe0\xc7\xcc\xda\xfc\xf7\x00\xfd\xff\xc4\xda\xfc" "\xcc\x44\xfc\xf7\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b" - "\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x6f\xd1\x40\x51\x20\xfe\xa0" - "\xf4\xe0\x2d\xda\xc7\x00\x00\x00\x74\x0a\x08\x00\x01\x00\x00\x00" - "" + "\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x6f\xd1\x40\x51\x20\xfe\xf4" + "\xe0\x5c\xcc\xc7\x74\x0a\x08\x00\x01\x00\x00\x00" ; -const int drive_20010608_firmware_size = 384; +const int drive_20010608_firmware_size = 380; Index: drive_20020402.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/drive_20020402.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- drive_20020402.h 31 May 2005 18:33:42 -0000 1.3 +++ drive_20020402.h 12 Jun 2005 00:49:49 -0000 1.4 @@ -2,13 +2,13 @@ const char drive_20020402_firmware[] = "\xf4\xe1\xa5\x38\xc7\xdc\x00\x80\xf4\x71\x2a\xea\x08\x80\x6e\xf4" "\xe1\x13\x5f\xc7\xdc\x6e\x80\xa0\xf8\xb8\x01\xf4\xe1\x29\x5f\xc7" - "\xf4\x74\x47\xd0\x40\xf7\x20\x4c\x80\xf4\x74\xdb\xa7\x08\xf7\x20" - "\xd6\xfc\xf4\x74\x28\xae\x08\xf7\x20\xd2\xfc\x80\x0c\xc4\xda\xfc" + "\xf4\x74\x47\xd0\x40\xf7\x20\x4c\x80\xf4\x74\xd6\x9c\x08\xf7\x20" + "\xd6\xfc\xf4\x74\x28\xae\x08\xf7\x20\xd2\xfc\x80\x04\xc4\xda\xfc" "\xf4\x74\x7e\xd4\x08\xf0\x00\xc8\xda\xfc\xf5\x00\x01\xe9\x73\xc8" "\xda\xfc\xf5\x00\x02\xe8\x03\xfc\xec\x00\xf4\x74\xf9\xec\x40\x80" "\x02\xf0\x20\xc8\x84\x80\xc0\x9c\x81\xdc\xb4\x80\xf5\x30\x00\xf4" - "\x44\x7d\xd1\x40\xf8\xaa\x00\x10\xf4\xd0\x78\xd1\x40\xf0\x01\xdc" - "\xb4\x80\xf5\x30\x00\xf7\x48\xaa\x00\xe9\x07\xf4\xc4\x7d\xd1\x40" + "\x44\x79\xd1\x40\xf8\xaa\x00\x10\xf4\xd0\x74\xd1\x40\xf0\x01\xdc" + "\xb4\x80\xf5\x30\x00\xf7\x48\xaa\x00\xe9\x07\xf4\xc4\x79\xd1\x40" "\x10\xfe\xf7\x48\xee\x00\xe8\x0c\xd8\x55\xe9\x25\xcc\xb5\x80\xfd" "\x53\x00\xea\x0c\xcc\xb5\x80\xc4\xb0\x81\xcc\xb6\x80\xc4\x94\x81" "\xdc\xb4\x80\xf8\xe0\x00\x10\xa0\xf5\x10\x01\xf5\x10\x02\xf5\x10" @@ -16,15 +16,14 @@ "\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b\x80\xd8\x01\xe9" "\x02\x7c\x04\xf4\x75\x13\xd1\x40\x51\x20\x71\x34\xf4\x7d\xc1\x85" "\x08\xe9\x1b\x80\x00\xcd\xda\xfc\xd8\x00\xe9\x06\xf7\x01\xf7\xff" - "\xea\x03\xf5\x09\x08\xc5\xda\xfc\xf4\x75\x7c\xd1\x40\x14\xfe\x80" + "\xea\x03\xf5\x09\x08\xc5\xda\xfc\xf4\x75\x78\xd1\x40\x14\xfe\x80" "\x01\xea\xe2\xf7\x10\xff\xf7\x21\xf4\x79\x00\xf0\x00\xe9\x0e\x80" - "\x00\xf4\xc9\x7c\xd1\x40\xd9\x00\xe8\x03\xf5\x10\x09\x21\xd9\x06" - "\xe9\x0f\x61\x06\xf4\xc8\x7c\xd1\x40\xd8\x00\xe8\x02\xd5\x06\x41" + "\x00\xf4\xc9\x78\xd1\x40\xd9\x00\xe8\x03\xf5\x10\x09\x21\xd9\x06" + "\xe9\x0f\x61\x06\xf4\xc8\x78\xd1\x40\xd8\x00\xe8\x02\xd5\x06\x41" "\x06\xf4\xe0\xed\xdc\xc7\xcc\xda\xfc\xf7\x00\xfd\xff\xc4\xda\xfc" "\xcc\x44\xfc\xf7\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b" - "\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x6f\xd1\x40\x51\x20\xfe\xa0" - "\xf4\xe0\x18\xd7\xc7\x00\x00\x00\x74\x0a\x08\x00\x01\x00\x00\x00" - "" + "\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x6f\xd1\x40\x51\x20\xfe\xf4" + "\xe0\xda\xcb\xc7\x74\x0a\x08\x00\x01\x00\x00\x00" ; -const int drive_20020402_firmware_size = 384; +const int drive_20020402_firmware_size = 380; Index: drive_20020823.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/drive_20020823.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- drive_20020823.h 31 May 2005 18:33:42 -0000 1.2 +++ drive_20020823.h 12 Jun 2005 00:49:49 -0000 1.3 @@ -2,13 +2,13 @@ const char drive_20020823_firmware[] = "\xf4\xe1\xa5\x38\xc7\xdc\x00\x80\xf4\x71\x7c\xea\x08\x80\x6e\xf4" "\xe1\x13\x5f\xc7\xdc\x6e\x80\xa0\xf8\xb6\x01\xf4\xe1\x29\x5f\xc7" - "\xf4\x74\x47\xd0\x40\xf7\x20\x4c\x80\xf4\x74\x28\xa8\x08\xf7\x20" - "\xd6\xfc\xf4\x74\x75\xae\x08\xf7\x20\xd2\xfc\x80\x0c\xc4\xda\xfc" + "\xf4\x74\x47\xd0\x40\xf7\x20\x4c\x80\xf4\x74\x32\x9d\x08\xf7\x20" + "\xd6\xfc\xf4\x74\x75\xae\x08\xf7\x20\xd2\xfc\x80\x04\xc4\xda\xfc" "\xf4\x74\xd9\xd4\x08\xf0\x00\xc8\xda\xfc\xf5\x00\x01\xe9\x73\xc8" "\xda\xfc\xf5\x00\x02\xe8\x03\xfc\xec\x00\xf4\x74\xf5\xec\x40\x80" "\x02\xf0\x20\xc8\x80\x80\xc0\x98\x81\xdc\xb0\x80\xf5\x30\x00\xf4" - "\x44\x7d\xd1\x40\xf8\xaa\x00\x10\xf4\xd0\x78\xd1\x40\xf0\x01\xdc" - "\xb0\x80\xf5\x30\x00\xf7\x48\xaa\x00\xe9\x07\xf4\xc4\x7d\xd1\x40" + "\x44\x79\xd1\x40\xf8\xaa\x00\x10\xf4\xd0\x74\xd1\x40\xf0\x01\xdc" + "\xb0\x80\xf5\x30\x00\xf7\x48\xaa\x00\xe9\x07\xf4\xc4\x79\xd1\x40" "\x10\xfe\xf7\x48\xee\x00\xe8\x0c\xd8\x55\xe9\x25\xcc\xb1\x80\xfd" "\x53\x00\xea\x0c\xcc\xb1\x80\xc4\xac\x81\xcc\xb2\x80\xc4\x90\x81" "\xdc\xb0\x80\xf8\xe0\x00\x10\xa0\xf5\x10\x01\xf5\x10\x02\xf5\x10" @@ -16,15 +16,14 @@ "\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b\x80\xd8\x01\xe9" "\x02\x7c\x04\xf4\x75\x13\xd1\x40\x51\x20\x71\x34\xf4\x7d\xc1\x85" "\x08\xe9\x1b\x80\x00\xcd\xda\xfc\xd8\x00\xe9\x06\xf7\x01\xf7\xff" - "\xea\x03\xf5\x09\x08\xc5\xda\xfc\xf4\x75\x7c\xd1\x40\x14\xfe\x80" + "\xea\x03\xf5\x09\x08\xc5\xda\xfc\xf4\x75\x78\xd1\x40\x14\xfe\x80" "\x01\xea\xe2\xf7\x10\xff\xf7\x21\xf4\x79\x00\xf0\x00\xe9\x0e\x80" - "\x00\xf4\xc9\x7c\xd1\x40\xd9\x00\xe8\x03\xf5\x10\x09\x21\xd9\x06" - "\xe9\x0f\x61\x06\xf4\xc8\x7c\xd1\x40\xd8\x00\xe8\x02\xd5\x06\x41" + "\x00\xf4\xc9\x78\xd1\x40\xd9\x00\xe8\x03\xf5\x10\x09\x21\xd9\x06" + "\xe9\x0f\x61\x06\xf4\xc8\x78\xd1\x40\xd8\x00\xe8\x02\xd5\x06\x41" "\x06\xf4\xe0\x3a\xdd\xc7\xcc\xda\xfc\xf7\x00\xfd\xff\xc4\xda\xfc" "\xcc\x44\xfc\xf7\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b" - "\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x6f\xd1\x40\x51\x20\xfe\xa0" - "\xf4\xe0\x65\xd7\xc7\x00\x00\x00\x74\x0a\x08\x00\x01\x00\x00\x00" - "" + "\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x6f\xd1\x40\x51\x20\xfe\xf4" + "\xe0\x33\xcc\xc7\x74\x0a\x08\x00\x01\x00\x00\x00" ; -const int drive_20020823_firmware_size = 384; +const int drive_20020823_firmware_size = 380; |
From: <he...@us...> - 2005-06-11 22:51:26
|
Update of /cvsroot/gc-linux/linux/drivers/block/gcn-di In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28604 Modified Files: gcn-di.c drive_all.S Log Message: - Load firmware extensions only if they seem not loaded. - Do not reset the drive, unless it becomes stuck. - Accept DVD+R media too (thanks to tmbinc for pointing where to dig into) Index: gcn-di.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/gcn-di.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gcn-di.c 31 May 2005 18:33:42 -0000 1.3 +++ gcn-di.c 11 Jun 2005 22:51:15 -0000 1.4 @@ -36,7 +36,7 @@ #define DRV_DESCRIPTION "Nintendo GameCube DVD Interface driver" #define DRV_AUTHOR "Albert Herranz" -static char di_driver_version[] = "0.3"; +static char di_driver_version[] = "0.4"; #define di_printk(level, format, arg...) \ printk(level DRV_MODULE_NAME ": " format , ## arg) @@ -125,8 +125,10 @@ #define DI_ERROR_INVALID_FIELD 0x052400 #define DI_ERROR_MEDIUM_CHANGED 0x062800 -#define di_may_retry(s) (DI_STATUS(s) == DI_STATUS_READY || \ - DI_STATUS(s) == DI_STATUS_DISK_ID_NOT_READ) +#define di_may_retry(s) ((DI_STATUS(s) == DI_STATUS_READY || \ + DI_STATUS(s) == DI_STATUS_DISK_ID_NOT_READ) \ + && \ + (DI_ERROR(s) != DI_ERROR_SEEK_INCOMPLETE)) /* DI Sector Size */ #define DI_SECTOR_SHIFT 11 @@ -177,6 +179,7 @@ #define DI_DIR_WRITE DI_CR_RW #define DI_MODE_IMMED 0x00 #define DI_MODE_DMA DI_CR_DMA +#define DI_IGNORE_ERRORS (1<<7) char *name; @@ -450,7 +453,8 @@ #define DI_OP_ENABLEEXTENSIONS (DI_OP_SETSTATUS+1) [DI_OP_ENABLEEXTENSIONS] = { - .op = DI_OP(DI_OP_ENABLEEXTENSIONS, DI_DIR_READ|DI_MODE_IMMED), + .op = DI_OP(DI_OP_ENABLEEXTENSIONS, DI_DIR_READ|DI_MODE_IMMED| + DI_IGNORE_ERRORS), .name = "ENABLEEXTENSIONS", .cmdbuf0 = 0x55000000, #define DI_ENABLEEXTENSIONS_MASK 0x00ff0000 @@ -500,7 +504,7 @@ memset(cmd, 0, sizeof(*cmd)); cmd->ddev = ddev; cmd->opidx = opidx; - cmd->max_retries = cmd->retries = DI_COMMAND_RETRIES; + cmd->max_retries = cmd->retries = 0; opcode = di_get_opcode(cmd); if (opcode) { cmd->cmdbuf0 = opcode->cmdbuf0; @@ -540,6 +544,7 @@ cmd->cmdbuf2 = sizeof(*disk_id); cmd->data = disk_id; cmd->len = sizeof(*disk_id); + cmd->max_retries = cmd->retries = DI_COMMAND_RETRIES; } /* @@ -554,6 +559,7 @@ cmd->cmdbuf2 = len; cmd->data = data; cmd->len = len; + cmd->max_retries = cmd->retries = DI_COMMAND_RETRIES; } /* @@ -614,7 +620,6 @@ { di_op_basic(cmd, ddev, DI_OP_SPINMOTOR); cmd->cmdbuf0 |= (flags & DI_SPINMOTOR_MASK); - cmd->max_retries = 0; } /* @@ -743,14 +748,13 @@ /* * Prints the given drive status, only if debug enabled. */ -static void di_debug_print_drive_status(u32 drive_status) +static inline void di_debug_print_drive_status(u32 drive_status) { DBG("%08x, [%s, %s]\n", drive_status, di_printable_status(drive_status), di_printable_error(drive_status)); } -#if 0 /* * Prints the given drive status. */ @@ -760,7 +764,6 @@ di_printable_status(drive_status), di_printable_error(drive_status)); } -#endif /* * Prints the given disk identifier. @@ -1016,10 +1019,12 @@ opcode->name); } } else { - DBG("command %s failed\n", opcode->name); + if (!(opcode->op & DI_IGNORE_ERRORS)) + DBG("command %s failed\n", opcode->name); } - di_debug_print_drive_status(drive_status); + if (!(opcode->op & DI_IGNORE_ERRORS)) + di_print_drive_status(drive_status); /* complete the failed command */ di_command_done(cmd); @@ -1126,7 +1131,6 @@ spin_unlock_irqrestore(&ddev->io_lock, flags); if (reason & DI_SR_TCINT) { - /* DBG("TCINT\n"); */ di_complete_transfer(ddev, DI_SR_TCINT); } if (reason & DI_SR_BRKINT) { @@ -1385,18 +1389,18 @@ { struct di_command cmd; - /* first, make sure the drive is interoperable ... */ + /* first, make sure the drive is interoperable */ if (!(ddev->flags & DI_INTEROPERABLE)) { di_spin_down_drive(ddev); /* this actually will reset and spin up the drive */ di_make_interoperable(ddev); + } else { + /* assume enabled extensions */ + di_op_enableextensions(&cmd, ddev, enable_extensions); + di_run_command_and_wait(&cmd); } - /* ... and that extensions are enabled and working */ - di_op_enableextensions(&cmd, ddev, enable_extensions); - di_run_command_and_wait(&cmd); - /* the spin motor command requires the privileged mode */ di_enable_privileged_commands(ddev); @@ -1449,6 +1453,17 @@ /* * This is currently hardcoded. Scream|CT got this number * by reading up to where the lens physically allowed. + * + * This is currently causing us problems. + * For example, recent 'mount' versions will read 4k from + * the end of the device when guessing filesystem types. + * The end of device we are reporting is not the real one, + * so the drive will fail to read that part if it was not + * burned. + * + * As a temporary solution, specify always a filesystem + * type when using mount, or fill the whole disk when + * burning. */ ddev->nr_sectors = DI_MAX_SECTORS; /* in DVD sectors */ clear_bit(__DI_MEDIA_CHANGED, &ddev->flags); @@ -1602,7 +1617,7 @@ goto out_unlock; } - /* this will take of validating the media */ + /* this will take care of validating the media */ check_disk_change(inode->i_bdev); if (!ddev->nr_sectors) { retval = -ENOMEDIUM; @@ -1714,9 +1729,9 @@ case BLKFLSBUF: return ioctl_by_bdev(inode->i_bdev,cmd,arg); default: - return -ENOTTY; + return -EINVAL; } - return -ENOTTY; + return -EINVAL; } static struct block_device_operations di_fops = { @@ -1767,6 +1782,7 @@ u32 __iomem *sr_reg = io_base + DI_SR; u32 __iomem *cvr_reg = io_base + DI_CVR; u32 sr, cvr; + struct di_command cmd; unsigned long flags; int retval; @@ -1796,8 +1812,17 @@ spin_unlock_irqrestore(&ddev->io_lock, flags); - /* start with a known and clean state */ - di_reset(ddev); + /* + * We check if the drive is already interoperable by issuing one of + * the extended commands. + */ + di_op_enableextensions(&cmd, ddev, 1); + di_run_command_and_wait(&cmd); + if (ddev->drive_status) { + di_make_interoperable(ddev); + } else { + set_bit(__DI_INTEROPERABLE, &ddev->flags); + } di_schedule_motor_off(ddev, DI_MOTOR_OFF_TIMEOUT); Index: drive_all.S =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/drive_all.S,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- drive_all.S 31 May 2005 18:33:42 -0000 1.2 +++ drive_all.S 11 Jun 2005 22:51:16 -0000 1.3 @@ -1,5 +1,5 @@ /* - * DVD-R compatible "cactus" firmware extensions + * DVD±R compatible "cactus" firmware extensions * Copyright (C) 2005 The GameCube Linux Team * Copyright (C) 2005 Albert Herranz * @@ -70,8 +70,8 @@ .org 0x082f49 /* 04, 08 */ memset: - .equ adb1_break_address, 0x08a7db - .org 0x08a88d + .equ adb1_break_address, 0x089cd6 + .org 0x089d4e adb1_fixup_exit: .equ adb0_break_address, 0x08ae28 @@ -111,8 +111,8 @@ .org 0x082f50 memset: - .equ adb1_break_address, 0x08aaf0 - .org 0x08aba2 + .equ adb1_break_address, 0x089d42 + .org 0x089dd0 adb1_fixup_exit: .equ adb0_break_address, 0x08b145 @@ -152,8 +152,8 @@ .org 0x082f49 /* 04, 08 */ memset: - .equ adb1_break_address, 0x08a828 - .org 0x08a8da + .equ adb1_break_address, 0x089d32 + .org 0x089da7 adb1_fixup_exit: .equ adb0_break_address, 0x08ae75 @@ -204,7 +204,9 @@ mov a0, (ADB1) mov adb0_break_address, a0 mov a0, (ADB0) - mov ADB1ON|ADB0ON, d0 + + /* just enable the layout fix */ + mov ADB0ON, d0 movb d0, (ADBCTL) /* return to the original firmware */ @@ -267,7 +269,7 @@ enable_or_disable_extensions: /* 0x55, enable, 0x00, 0x00 */ - /* 1=enable, otherwise=disable */ + /* otherwise=enable, 0=disable */ movbu (cmdbuf0+1), d0 jsr di_enable_or_disable_extensions jmp get_drive_status @@ -374,6 +376,7 @@ mov 0, d0 di_enable_or_disable_extensions: + /* enable additional media if extensions are enabled */ movbu (ADBCTL), d1 cmp 0, d0 bne 1f @@ -453,8 +456,7 @@ rts adb1_fixup: - /* no disk id */ - sub d0, d0 + /* accept additional media */ jmp adb1_fixup_exit |
From: <he...@us...> - 2005-05-31 19:41:46
|
Update of /cvsroot/gc-linux/htdocs/xml/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27571 Modified Files: lkb_changelog.xml download.xml news.xml Log Message: 31 May 2005, Improved DVD Interface driver - R14 kernel build Index: lkb_changelog.xml =================================================================== RCS file: /cvsroot/gc-linux/htdocs/xml/en/lkb_changelog.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- lkb_changelog.xml 24 May 2005 18:20:58 -0000 1.1 +++ lkb_changelog.xml 31 May 2005 19:41:37 -0000 1.2 @@ -4,11 +4,25 @@ <info> <title>Latest Kernel Build ChangeLog</title> <author>Albert Herranz</author> - <date>24 May 2005</date> + <date>31 May 2005</date> </info> <p>Here you will find a log of changes for each of the Latest Kernel Build releases.</p> + <h2>Build 14, 31 May 2005</h2> + + <list> + <item>DI (DVD Interface)</item> + <list> + <item>Minimize spin ups and spin downs. + </item> + <item>Mount media faster. + </item> + <item>Retry failed operations 10 times before giving up. + </item> + </list> + </list> + <h2>Build 13, 24 May 2005</h2> <list> Index: download.xml =================================================================== RCS file: /cvsroot/gc-linux/htdocs/xml/en/download.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- download.xml 24 May 2005 18:20:58 -0000 1.13 +++ download.xml 31 May 2005 19:41:37 -0000 1.14 @@ -15,7 +15,7 @@ <h2>Latest Kernel Build</h2> - <p>(Build 13, 24 May 2005, <a href="lkb_changelog.html">ChangeLog</a>)</p> + <p>(Build 14, 31 May 2005, <a href="lkb_changelog.html">ChangeLog</a>)</p> <p>This build always has the latest features, but might not work reliably. You may choose between two different kernel images.</p> Index: news.xml =================================================================== RCS file: /cvsroot/gc-linux/htdocs/xml/en/news.xml,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- news.xml 21 May 2005 13:50:13 -0000 1.36 +++ news.xml 31 May 2005 19:41:37 -0000 1.37 @@ -2,6 +2,11 @@ <?xml-stylesheet href="news.xsl" type="text/xsl"?> <news> <item> + <date>31 May 2005</date> + <title>Improved DVD Interface driver</title> + <text>We managed to reduce to a minimum the drive spin-ups needed (thanks cheqmate!), media is now successfully mounted faster, and errors are retried several times to help recover from possible temporary failures. Want to check this? Visit the <a href="docs/download.html">Latest Kernel Build</a> page.</text> + </item> + <item> <date>21 May 2005</date> <title>Updated cactus extensions</title> <text>The "cactus" firmware extensions have, since some days, support for drives 06 (minimally tested) and 08 (untested), in addition to drive 04. If you want to review or test the new stuff look at the <a href="http://cvs.sourceforge.net/viewcvs.py/gc-linux/linux/">CVS</a> and <a href="docs/download.html">Latest Kernel Build</a>.</text> |
From: <he...@us...> - 2005-05-31 18:33:53
|
Update of /cvsroot/gc-linux/linux/drivers/block/gcn-di In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24530 Modified Files: drive_20010608.h drive_20020402.h drive_20020823.h drive_all.S gcn-di.c Log Message: Made the driver a lot more user friendly. - Now we need a single drive spin up on open, thanks to cheqmate's findings. - And normal media is accepted quickly. - Failed drive commands are retried up to 10 times before aborting them. Index: drive_20010608.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/drive_20010608.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- drive_20010608.h 17 May 2005 20:59:19 -0000 1.1 +++ drive_20010608.h 31 May 2005 18:33:42 -0000 1.2 @@ -4,21 +4,27 @@ "\xe1\x1a\x5f\xc7\xdc\x6e\x80\xa0\xf8\xac\x01\xf4\xe1\x30\x5f\xc7" "\xf4\x74\x47\xd0\x40\xf7\x20\x4c\x80\xf4\x74\xf0\xaa\x08\xf7\x20" "\xd6\xfc\xf4\x74\x45\xb1\x08\xf7\x20\xd2\xfc\x80\x0c\xc4\xda\xfc" - "\xf4\x74\x1e\xd4\x08\xf0\x00\xc8\xda\xfc\xf5\x00\x01\xe9\x22\xc8" - "\xda\xfc\xf5\x00\x02\xe8\x03\xfc\x8e\x00\xf4\x74\x02\xed\x40\x80" - "\x02\xf0\x20\xc8\x78\x80\xc0\x90\x81\xf4\xd0\x18\xd1\x40\xf0\x01" - "\xfe\xcc\xda\xfc\xf7\x00\xfe\xff\xc4\xda\xfc\xcc\x44\xfc\xf7\x00" - "\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b\x80\xd8\x01\xe9\x02" - "\x7c\x04\xf4\x75\xb5\xd0\x40\x51\x20\x71\x34\xf4\x7d\xb9\x85\x08" - "\xe9\x12\xf4\x75\x1c\xd1\x40\x80\x01\x14\xcc\xda\xfc\xf7\x00\xf7" - "\xff\xc4\xda\xfc\xfe\xf7\x10\xff\xf7\x21\xf4\x79\x00\xf0\x00\xe9" - "\x0e\x80\x00\xf4\xc9\x1c\xd1\x40\xd9\x00\xe9\x03\xf5\x10\x09\x21" - "\xd9\x06\xe9\x0f\x61\x06\xf4\xc8\x1c\xd1\x40\xd8\x00\xe9\x02\xd5" - "\x06\x41\x06\xf4\xe0\x68\xe0\xc7\xcc\xda\xfc\xf7\x00\xfd\xff\xc4" - "\xda\xfc\xcc\x44\xfc\xf7\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04" - "\xcc\x5b\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x11\xd1\x40\x51\x20" - "\xfe\xa0\xf4\xe0\x8b\xda\xc7\x00\x74\x0a\x08\x00\x00\x00\x00\x00" + "\xf4\x74\x1e\xd4\x08\xf0\x00\xc8\xda\xfc\xf5\x00\x01\xe9\x73\xc8" + "\xda\xfc\xf5\x00\x02\xe8\x03\xfc\xec\x00\xf4\x74\x02\xed\x40\x80" + "\x02\xf0\x20\xc8\x78\x80\xc0\x90\x81\xdc\xa8\x80\xf5\x30\x00\xf4" + "\x44\x7d\xd1\x40\xf8\xaa\x00\x10\xf4\xd0\x78\xd1\x40\xf0\x01\xdc" + "\xa8\x80\xf5\x30\x00\xf7\x48\xaa\x00\xe9\x07\xf4\xc4\x7d\xd1\x40" + "\x10\xfe\xf7\x48\xee\x00\xe8\x0c\xd8\x55\xe9\x25\xcc\xa9\x80\xfd" + "\x53\x00\xea\x0c\xcc\xa9\x80\xc4\xa4\x81\xcc\xaa\x80\xc4\x88\x81" + "\xdc\xa8\x80\xf8\xe0\x00\x10\xa0\xf5\x10\x01\xf5\x10\x02\xf5\x10" + "\x03\xfe\xcc\xda\xfc\xf7\x00\xfe\xff\xc4\xda\xfc\xcc\x44\xfc\xf7" + "\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b\x80\xd8\x01\xe9" + "\x02\x7c\x04\xf4\x75\x13\xd1\x40\x51\x20\x71\x34\xf4\x7d\xb9\x85" + "\x08\xe9\x1b\x80\x00\xcd\xda\xfc\xd8\x00\xe9\x06\xf7\x01\xf7\xff" + "\xea\x03\xf5\x09\x08\xc5\xda\xfc\xf4\x75\x7c\xd1\x40\x14\xfe\x80" + "\x01\xea\xe2\xf7\x10\xff\xf7\x21\xf4\x79\x00\xf0\x00\xe9\x0e\x80" + "\x00\xf4\xc9\x7c\xd1\x40\xd9\x00\xe8\x03\xf5\x10\x09\x21\xd9\x06" + "\xe9\x0f\x61\x06\xf4\xc8\x7c\xd1\x40\xd8\x00\xe8\x02\xd5\x06\x41" + "\x06\xf4\xe0\x0a\xe0\xc7\xcc\xda\xfc\xf7\x00\xfd\xff\xc4\xda\xfc" + "\xcc\x44\xfc\xf7\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b" + "\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x6f\xd1\x40\x51\x20\xfe\xa0" + "\xf4\xe0\x2d\xda\xc7\x00\x00\x00\x74\x0a\x08\x00\x01\x00\x00\x00" "" ; -const int drive_20010608_firmware_size = 288; +const int drive_20010608_firmware_size = 384; Index: drive_20020402.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/drive_20020402.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- drive_20020402.h 17 May 2005 20:59:19 -0000 1.2 +++ drive_20020402.h 31 May 2005 18:33:42 -0000 1.3 @@ -4,21 +4,27 @@ "\xe1\x13\x5f\xc7\xdc\x6e\x80\xa0\xf8\xb8\x01\xf4\xe1\x29\x5f\xc7" "\xf4\x74\x47\xd0\x40\xf7\x20\x4c\x80\xf4\x74\xdb\xa7\x08\xf7\x20" "\xd6\xfc\xf4\x74\x28\xae\x08\xf7\x20\xd2\xfc\x80\x0c\xc4\xda\xfc" - "\xf4\x74\x7e\xd4\x08\xf0\x00\xc8\xda\xfc\xf5\x00\x01\xe9\x22\xc8" - "\xda\xfc\xf5\x00\x02\xe8\x03\xfc\x8e\x00\xf4\x74\xf9\xec\x40\x80" - "\x02\xf0\x20\xc8\x84\x80\xc0\x9c\x81\xf4\xd0\x18\xd1\x40\xf0\x01" - "\xfe\xcc\xda\xfc\xf7\x00\xfe\xff\xc4\xda\xfc\xcc\x44\xfc\xf7\x00" - "\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b\x80\xd8\x01\xe9\x02" - "\x7c\x04\xf4\x75\xb5\xd0\x40\x51\x20\x71\x34\xf4\x7d\xc1\x85\x08" - "\xe9\x12\xf4\x75\x1c\xd1\x40\x80\x01\x14\xcc\xda\xfc\xf7\x00\xf7" - "\xff\xc4\xda\xfc\xfe\xf7\x10\xff\xf7\x21\xf4\x79\x00\xf0\x00\xe9" - "\x0e\x80\x00\xf4\xc9\x1c\xd1\x40\xd9\x00\xe9\x03\xf5\x10\x09\x21" - "\xd9\x06\xe9\x0f\x61\x06\xf4\xc8\x1c\xd1\x40\xd8\x00\xe9\x02\xd5" - "\x06\x41\x06\xf4\xe0\x4b\xdd\xc7\xcc\xda\xfc\xf7\x00\xfd\xff\xc4" - "\xda\xfc\xcc\x44\xfc\xf7\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04" - "\xcc\x5b\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x11\xd1\x40\x51\x20" - "\xfe\xa0\xf4\xe0\x76\xd7\xc7\x00\x74\x0a\x08\x00\x00\x00\x00\x00" + "\xf4\x74\x7e\xd4\x08\xf0\x00\xc8\xda\xfc\xf5\x00\x01\xe9\x73\xc8" + "\xda\xfc\xf5\x00\x02\xe8\x03\xfc\xec\x00\xf4\x74\xf9\xec\x40\x80" + "\x02\xf0\x20\xc8\x84\x80\xc0\x9c\x81\xdc\xb4\x80\xf5\x30\x00\xf4" + "\x44\x7d\xd1\x40\xf8\xaa\x00\x10\xf4\xd0\x78\xd1\x40\xf0\x01\xdc" + "\xb4\x80\xf5\x30\x00\xf7\x48\xaa\x00\xe9\x07\xf4\xc4\x7d\xd1\x40" + "\x10\xfe\xf7\x48\xee\x00\xe8\x0c\xd8\x55\xe9\x25\xcc\xb5\x80\xfd" + "\x53\x00\xea\x0c\xcc\xb5\x80\xc4\xb0\x81\xcc\xb6\x80\xc4\x94\x81" + "\xdc\xb4\x80\xf8\xe0\x00\x10\xa0\xf5\x10\x01\xf5\x10\x02\xf5\x10" + "\x03\xfe\xcc\xda\xfc\xf7\x00\xfe\xff\xc4\xda\xfc\xcc\x44\xfc\xf7" + "\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b\x80\xd8\x01\xe9" + "\x02\x7c\x04\xf4\x75\x13\xd1\x40\x51\x20\x71\x34\xf4\x7d\xc1\x85" + "\x08\xe9\x1b\x80\x00\xcd\xda\xfc\xd8\x00\xe9\x06\xf7\x01\xf7\xff" + "\xea\x03\xf5\x09\x08\xc5\xda\xfc\xf4\x75\x7c\xd1\x40\x14\xfe\x80" + "\x01\xea\xe2\xf7\x10\xff\xf7\x21\xf4\x79\x00\xf0\x00\xe9\x0e\x80" + "\x00\xf4\xc9\x7c\xd1\x40\xd9\x00\xe8\x03\xf5\x10\x09\x21\xd9\x06" + "\xe9\x0f\x61\x06\xf4\xc8\x7c\xd1\x40\xd8\x00\xe8\x02\xd5\x06\x41" + "\x06\xf4\xe0\xed\xdc\xc7\xcc\xda\xfc\xf7\x00\xfd\xff\xc4\xda\xfc" + "\xcc\x44\xfc\xf7\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b" + "\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x6f\xd1\x40\x51\x20\xfe\xa0" + "\xf4\xe0\x18\xd7\xc7\x00\x00\x00\x74\x0a\x08\x00\x01\x00\x00\x00" "" ; -const int drive_20020402_firmware_size = 288; +const int drive_20020402_firmware_size = 384; Index: drive_20020823.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/drive_20020823.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- drive_20020823.h 17 May 2005 20:59:19 -0000 1.1 +++ drive_20020823.h 31 May 2005 18:33:42 -0000 1.2 @@ -4,21 +4,27 @@ "\xe1\x13\x5f\xc7\xdc\x6e\x80\xa0\xf8\xb6\x01\xf4\xe1\x29\x5f\xc7" "\xf4\x74\x47\xd0\x40\xf7\x20\x4c\x80\xf4\x74\x28\xa8\x08\xf7\x20" "\xd6\xfc\xf4\x74\x75\xae\x08\xf7\x20\xd2\xfc\x80\x0c\xc4\xda\xfc" - "\xf4\x74\xd9\xd4\x08\xf0\x00\xc8\xda\xfc\xf5\x00\x01\xe9\x22\xc8" - "\xda\xfc\xf5\x00\x02\xe8\x03\xfc\x8e\x00\xf4\x74\xf5\xec\x40\x80" - "\x02\xf0\x20\xc8\x80\x80\xc0\x98\x81\xf4\xd0\x18\xd1\x40\xf0\x01" - "\xfe\xcc\xda\xfc\xf7\x00\xfe\xff\xc4\xda\xfc\xcc\x44\xfc\xf7\x00" - "\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b\x80\xd8\x01\xe9\x02" - "\x7c\x04\xf4\x75\xb5\xd0\x40\x51\x20\x71\x34\xf4\x7d\xc1\x85\x08" - "\xe9\x12\xf4\x75\x1c\xd1\x40\x80\x01\x14\xcc\xda\xfc\xf7\x00\xf7" - "\xff\xc4\xda\xfc\xfe\xf7\x10\xff\xf7\x21\xf4\x79\x00\xf0\x00\xe9" - "\x0e\x80\x00\xf4\xc9\x1c\xd1\x40\xd9\x00\xe9\x03\xf5\x10\x09\x21" - "\xd9\x06\xe9\x0f\x61\x06\xf4\xc8\x1c\xd1\x40\xd8\x00\xe9\x02\xd5" - "\x06\x41\x06\xf4\xe0\x98\xdd\xc7\xcc\xda\xfc\xf7\x00\xfd\xff\xc4" - "\xda\xfc\xcc\x44\xfc\xf7\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04" - "\xcc\x5b\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x11\xd1\x40\x51\x20" - "\xfe\xa0\xf4\xe0\xc3\xd7\xc7\x00\x74\x0a\x08\x00\x00\x00\x00\x00" + "\xf4\x74\xd9\xd4\x08\xf0\x00\xc8\xda\xfc\xf5\x00\x01\xe9\x73\xc8" + "\xda\xfc\xf5\x00\x02\xe8\x03\xfc\xec\x00\xf4\x74\xf5\xec\x40\x80" + "\x02\xf0\x20\xc8\x80\x80\xc0\x98\x81\xdc\xb0\x80\xf5\x30\x00\xf4" + "\x44\x7d\xd1\x40\xf8\xaa\x00\x10\xf4\xd0\x78\xd1\x40\xf0\x01\xdc" + "\xb0\x80\xf5\x30\x00\xf7\x48\xaa\x00\xe9\x07\xf4\xc4\x7d\xd1\x40" + "\x10\xfe\xf7\x48\xee\x00\xe8\x0c\xd8\x55\xe9\x25\xcc\xb1\x80\xfd" + "\x53\x00\xea\x0c\xcc\xb1\x80\xc4\xac\x81\xcc\xb2\x80\xc4\x90\x81" + "\xdc\xb0\x80\xf8\xe0\x00\x10\xa0\xf5\x10\x01\xf5\x10\x02\xf5\x10" + "\x03\xfe\xcc\xda\xfc\xf7\x00\xfe\xff\xc4\xda\xfc\xcc\x44\xfc\xf7" + "\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b\x80\xd8\x01\xe9" + "\x02\x7c\x04\xf4\x75\x13\xd1\x40\x51\x20\x71\x34\xf4\x7d\xc1\x85" + "\x08\xe9\x1b\x80\x00\xcd\xda\xfc\xd8\x00\xe9\x06\xf7\x01\xf7\xff" + "\xea\x03\xf5\x09\x08\xc5\xda\xfc\xf4\x75\x7c\xd1\x40\x14\xfe\x80" + "\x01\xea\xe2\xf7\x10\xff\xf7\x21\xf4\x79\x00\xf0\x00\xe9\x0e\x80" + "\x00\xf4\xc9\x7c\xd1\x40\xd9\x00\xe8\x03\xf5\x10\x09\x21\xd9\x06" + "\xe9\x0f\x61\x06\xf4\xc8\x7c\xd1\x40\xd8\x00\xe8\x02\xd5\x06\x41" + "\x06\xf4\xe0\x3a\xdd\xc7\xcc\xda\xfc\xf7\x00\xfd\xff\xc4\xda\xfc" + "\xcc\x44\xfc\xf7\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b" + "\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x6f\xd1\x40\x51\x20\xfe\xa0" + "\xf4\xe0\x65\xd7\xc7\x00\x00\x00\x74\x0a\x08\x00\x01\x00\x00\x00" "" ; -const int drive_20020823_firmware_size = 288; +const int drive_20020823_firmware_size = 384; Index: drive_all.S =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/drive_all.S,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- drive_all.S 17 May 2005 20:08:38 -0000 1.1 +++ drive_all.S 31 May 2005 18:33:42 -0000 1.2 @@ -33,11 +33,22 @@ .equ irq_handler_vector, 0x804c /* 04, 06, 08 */ .equ irq_depth, 0x805b /* 04, 06, 08 */ +.equ fake_command, 0xaa +.equ set_drive_status_command, 0xee /* same as in gcn-di.c */ +.equ enable_extensions_command, 0x55 /* same as in gcn-di.c */ + +.equ get_drive_status_command, 0xe0 + #if DRIVE_MODEL == 0x20020402 /* 04 */ + .equ cmdbuf0, 0x80b4 + .equ drive_status, 0x81b0 + .equ drive_status2, 0x8194 - .equ dicmdbuf0, 0x80b4 + .equ bert, 0x8084 + .equ ernie, 0x819c + .equ cactus, 0x40ecf9 .equ entry_return_address, 0x08d47e @@ -48,11 +59,6 @@ .equ bss, 0x00806e .equ bss_size, 0x1b8 - .equ cactus, 0x40ecf9 - - .equ bert, 0x8084 - .equ ernie, 0x819c - .section absolute .org 0x0808aa /* 04, 06, 08 */ @@ -77,8 +83,13 @@ #elif DRIVE_MODEL == 0x20010608 /* 06 */ + .equ cmdbuf0, 0x80a8 + .equ drive_status, 0x81a4 + .equ drive_status2, 0x8188 - .equ dicmdbuf0, 0x80a8 + .equ bert, 0x8078 + .equ ernie, 0x8190 + .equ cactus, 0x40ed02 .equ entry_return_address, 0x08d41e @@ -89,11 +100,6 @@ .equ bss, 0x00806e .equ bss_size, 0x1ac - .equ cactus, 0x40ed02 - - .equ bert, 0x8078 - .equ ernie, 0x8190 - .section absolute .org 0x0808aa /* 04, 06, 08 */ @@ -118,8 +124,13 @@ #elif DRIVE_MODEL == 0x20020823 /* 08 */ + .equ cmdbuf0, 0x80b0 + .equ drive_status, 0x81ac + .equ drive_status2, 0x8190 - .equ dicmdbuf0, 0x80b0 + .equ bert, 0x8080 + .equ ernie, 0x8198 + .equ cactus, 0x40ecf5 .equ entry_return_address, 0x08d4d9 @@ -130,11 +141,6 @@ .equ bss, 0x00806e .equ bss_size, 0x1b6 - .equ cactus, 0x40ecf5 - - .equ bert, 0x8080 - .equ ernie, 0x8198 - .section absolute .org 0x0808aa /* 04, 06, 08 */ @@ -193,16 +199,15 @@ mov our_irq_handler, a0 mov a0, (irq_handler_vector) - /* setup our extending functions ... */ + /* setup our extending functions */ mov adb1_break_address, a0 mov a0, (ADB1) mov adb0_break_address, a0 mov a0, (ADB0) - - /* ... and enable them */ mov ADB1ON|ADB0ON, d0 movb d0, (ADBCTL) + /* return to the original firmware */ mov entry_return_address, a0 jmp (a0) @@ -226,12 +231,74 @@ mov (bert), d0 mov d0, (ernie) + /* save current command ... */ + mov cmdbuf0, a0 + movbu (0, a0), d0 + movb d0, (saved_cmdbuf0) + + /* ... and place a temporary fake command, to detect new commands */ + mov fake_command, d0 + movb d0, (a0) + /* call the original handler */ mov (saved_irq_handler), a0 jsr (a0) + /* if our fake command changed, we assume a new command has arrived */ + mov cmdbuf0, a0 + movbu (0, a0), d0 + cmp fake_command, d0 + bne extra_command_parser + + /* if there is no new command, restore the previously saved command */ + movb (saved_cmdbuf0), d0 + movb d0, (a0) + + rts + +extra_command_parser: + /* "set drive status" command */ + cmp set_drive_status_command, d0 + beq set_drive_status + + /* "enable extensions" command */ + cmp enable_extensions_command, d0 + bne done + +enable_or_disable_extensions: + /* 0x55, enable, 0x00, 0x00 */ + /* 1=enable, otherwise=disable */ + movbu (cmdbuf0+1), d0 + jsr di_enable_or_disable_extensions + jmp get_drive_status + +set_drive_status: + /* 0xee, drive_status, drive_status2, 0x00 */ + movbu (cmdbuf0+1), d0 + movb d0, (drive_status) + movbu (cmdbuf0+2), d0 + movb d0, (drive_status2) + +get_drive_status: + /* + * This saves us an invalid command error and updates the status + * accordingly. In fact, our extended command becomes a "get status" + * command. + */ + mov cmdbuf0, a0 + mov get_drive_status_command, d0 + movb d0, (a0) + sub d0, d0 + movb d0, (1,a0) + movb d0, (2,a0) + movb d0, (3,a0) + +done: rts + + + /* * This is how the stacks look like when our interrupt handler is called. * @@ -301,19 +368,32 @@ /* 0x20 + 0x10 + 0x04 = 0x34 */ mov (0x34, a0), a1 cmp disable_extensions_when_called_from, a1 - bne 1f + bne 3f /* else, do nothing */ di_disable_extensions: - mov disable_extensions, a1 - mov 1, d0 - movb d0, (a1) - movbu (ADBCTL), d0 - and ~ADB1ON, d0 - movb d0, (ADBCTL) + mov 0, d0 +di_enable_or_disable_extensions: + movbu (ADBCTL), d1 + cmp 0, d0 + bne 1f + and ~ADB1ON, d1 + jmp 2f 1: + or ADB1ON, d1 +2: + movb d1, (ADBCTL) + + mov enable_extensions, a1 + movb d0, (a1) + +3: rts +di_enable_extensions: + mov 1, d0 + jmp di_enable_or_disable_extensions + adb0_fixup: /* disable interrupts */ @@ -324,9 +404,9 @@ cmp 0x00f000, d1 bne 1f mov 0x00, d0 - movbu (disable_extensions), d1 + movbu (enable_extensions), d1 cmp 0, d1 - bne 1f + beq 1f movb d0, (0x09, a0) 1: /* skip the extra field */ @@ -334,9 +414,9 @@ cmp 0x06, d1 bne 1f mov (0x06, a0), d1 - movbu (disable_extensions), d0 + movbu (enable_extensions), d0 cmp 0, d0 - bne 2f + beq 2f add 6, d1 2: mov d1, (0x06, a0) @@ -381,7 +461,9 @@ .align 2 saved_irq_handler: .long 0x00080A74 /* 04, 06, 08 */ -disable_extensions: +enable_extensions: + .byte 0x01 +saved_cmdbuf0: .byte 0x00 _exit: Index: gcn-di.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/gcn-di.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gcn-di.c 17 May 2005 20:08:38 -0000 1.2 +++ gcn-di.c 31 May 2005 18:33:42 -0000 1.3 @@ -19,6 +19,7 @@ #include <linux/init.h> #include <linux/interrupt.h> #include <linux/dma-mapping.h> +#include <linux/timer.h> #include <linux/delay.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> @@ -29,13 +30,13 @@ #include <asm/io.h> [...1384 lines suppressed...] out: return retval; } /* - * Relinquishes control of the haardware. + * Relinquishes control of the hardware. */ static void di_exit_irq(struct di_device *ddev) { - struct di_command cmd; - /* stop DVD motor */ - di_op_stopmotor(&cmd, ddev); - di_run_command_and_wait(&cmd); + di_cancel_motor_off(ddev); + di_spin_down_drive(ddev); di_quiesce(ddev); |
From: <he...@us...> - 2005-05-24 18:21:11
|
Update of /cvsroot/gc-linux/htdocs/xml/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13984 Modified Files: download.xml howtodevelop.xml status.xml Added Files: lkb_changelog.xml Log Message: Modified some texts regarding the status of dvd support in the project. Bumped latest kernel build to R13. Added a Latest Kernel Build ChangeLog page. --- NEW FILE: lkb_changelog.xml --- <?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet type="text/xsl" href="iparticle.xsl"?> <iparticle> <info> <title>Latest Kernel Build ChangeLog</title> <author>Albert Herranz</author> <date>24 May 2005</date> </info> <p>Here you will find a log of changes for each of the Latest Kernel Build releases.</p> <h2>Build 13, 24 May 2005</h2> <list> <item>DI (DVD Interface)</item> <list> <item>In case of errors, print the status/error reported by the drive. </item> <item>Retry failed operations 14 times before giving up. </item> </list> </list> </iparticle> Index: download.xml =================================================================== RCS file: /cvsroot/gc-linux/htdocs/xml/en/download.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- download.xml 17 Mar 2005 15:35:56 -0000 1.12 +++ download.xml 24 May 2005 18:20:58 -0000 1.13 @@ -15,7 +15,7 @@ <h2>Latest Kernel Build</h2> - <p>(Build 9, 14 March 2005)</p> + <p>(Build 13, 24 May 2005, <a href="lkb_changelog.html">ChangeLog</a>)</p> <p>This build always has the latest features, but might not work reliably. You may choose between two different kernel images.</p> Index: howtodevelop.xml =================================================================== RCS file: /cvsroot/gc-linux/htdocs/xml/en/howtodevelop.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- howtodevelop.xml 6 Oct 2004 23:27:32 -0000 1.8 +++ howtodevelop.xml 24 May 2005 18:20:58 -0000 1.9 @@ -22,7 +22,7 @@ <h2>Running Executables on the GameCube</h2> - <p>The GameCube cannot read any CDs/DVDs that can be burnt. There are several methods to run your code on the GameCube, but we will show briefly only the "PSOload" method.</p> + <p>There are several methods to run your code on the GameCube, but we will show briefly only the "PSOload" method.</p> <p>The game "Phantasy Star Online" ("PSO", any version) tries to connect to a central server if you want to play an online game, in order to download an updated version of the game executable. This mechanism can be used to upload any code to the GameCube.</p> <p>You need the game "PSO", a memory card, a broadband adapter and a PC running the tool "PSOload", connected to the GameCube via Ethernet.</p> <p>PSOload v2.0a for Windows can be downloaded <a href="http://www.gcdev.com/download/PSOloadV2.0a.zip">here</a>.</p> Index: status.xml =================================================================== RCS file: /cvsroot/gc-linux/htdocs/xml/en/status.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- status.xml 25 Jul 2004 22:17:15 -0000 1.5 +++ status.xml 24 May 2005 18:20:58 -0000 1.6 @@ -4,10 +4,10 @@ <info> <title>Status/Contribute</title> <author>Michael Steil (updated by Albert Herranz)</author> - <date>26 July 2004</date> + <date>24 May 2005</date> </info> - <p>Linux has working drivers for PAL and NTSC framebuffers, the Broadband Adapter (network card), audio, ARAM, Real Time Clock, gamepad, keyboard and reset button. It has also preliminary support for memory cards.</p> + <p>The GameCube Linux kernel has working drivers for PAL and NTSC framebuffers, the Broadband Adapter (network card), audio, ARAM, Real Time Clock, gamepad, keyboard, DVD and reset button. It has also preliminary support for memory cards and SD cards.</p> <p>If you are interested in helping, please join the <a href="mailinglist.html">Mailing List</a> or email <a href="mailto:mi...@c6...?Subject=GameCube Linux Development">Michael</a>.</p> |
From: <he...@us...> - 2005-05-21 13:50:22
|
Update of /cvsroot/gc-linux/htdocs/xml/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20900 Modified Files: news.xml Log Message: 21 May 2005, Updated cactus extensions Index: news.xml =================================================================== RCS file: /cvsroot/gc-linux/htdocs/xml/en/news.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- news.xml 8 Apr 2005 20:19:08 -0000 1.35 +++ news.xml 21 May 2005 13:50:13 -0000 1.36 @@ -2,6 +2,16 @@ <?xml-stylesheet href="news.xsl" type="text/xsl"?> <news> <item> + <date>21 May 2005</date> + <title>Updated cactus extensions</title> + <text>The "cactus" firmware extensions have, since some days, support for drives 06 (minimally tested) and 08 (untested), in addition to drive 04. If you want to review or test the new stuff look at the <a href="http://cvs.sourceforge.net/viewcvs.py/gc-linux/linux/">CVS</a> and <a href="docs/download.html">Latest Kernel Build</a>.</text> + </item> + <item> + <date>15 May 2005</date> + <title>Cactus firmware extensions</title> + <text>An alternate experimental DVD driver is now available with support for DVD-R media using the "cactus" firmware extensions (it currently works with drive 04 models only). Create a DVD device file if you don't have already one (mknod /dev/dvd b 60 0), load your DVD-R on your GameCube, mount it (mount -t iso9660 /dev/dvd /mnt), and access it just like in any other Linux. All code is available on <a href="http://cvs.sourceforge.net/viewcvs.py/gc-linux/linux/">CVS</a>. And the <a href="docs/download.html">Latest Kernel Build</a> has already integrated the new code.</text> + </item> + <item> <date>8 April 2005</date> <title>DVD block driver</title> <text>Scream|CT finally committed his GameCube DVD block driver. In its current form, it allows raw access to original GameCube disks. The code is available on CVS. </text> |
From: <he...@us...> - 2005-05-21 13:49:50
|
Update of /cvsroot/gc-linux/htdocs/xml/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20768 Modified Files: faq.xml Log Message: Updated the FAQ regarding the ability of the GameCube to read normal DVD media. Index: faq.xml =================================================================== RCS file: /cvsroot/gc-linux/htdocs/xml/en/faq.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- faq.xml 27 Jul 2004 17:55:46 -0000 1.4 +++ faq.xml 21 May 2005 13:49:41 -0000 1.5 @@ -39,9 +39,9 @@ <faq> <category>2 Running Homebrew Code</category> - <question>Can I just burn a 8 cm CD/DVD and use it in the GameCube?</question> + <question>Can I just burn a 8 cm DVD and use it in the GameCube?</question> <answer> - Not on a unmodified GameCube. The GameCube, as shipped, reads no CDs/DVDs. There is no way to produce a GameCube compatible optical media using unmodified CD/DVD burners. + Yes, with the help of a volatile firmware extension as the DVD Interface driver currently does. This extension makes the GameCube DVD drive interoperable with DVD-R media as of today. The firmware extensions are not permanent and disappear as soon as the drive is reset. </answer> </faq> <faq> |
From: <he...@us...> - 2005-05-17 20:59:29
|
Update of /cvsroot/gc-linux/linux/drivers/block/gcn-di In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21551 Modified Files: Makefile drive_20020402.h Added Files: drive_20010608.h drive_20020823.h Log Message: Added pre-compiled drive codes. Do not build by default drive codes. --- NEW FILE: drive_20010608.h --- static const char drive_20010608_firmware[] = "\xf4\xe1\xa5\x38\xc7\xdc\x00\x80\xf4\x71\xc8\xe9\x08\x80\x6e\xf4" "\xe1\x1a\x5f\xc7\xdc\x6e\x80\xa0\xf8\xac\x01\xf4\xe1\x30\x5f\xc7" "\xf4\x74\x47\xd0\x40\xf7\x20\x4c\x80\xf4\x74\xf0\xaa\x08\xf7\x20" "\xd6\xfc\xf4\x74\x45\xb1\x08\xf7\x20\xd2\xfc\x80\x0c\xc4\xda\xfc" "\xf4\x74\x1e\xd4\x08\xf0\x00\xc8\xda\xfc\xf5\x00\x01\xe9\x22\xc8" "\xda\xfc\xf5\x00\x02\xe8\x03\xfc\x8e\x00\xf4\x74\x02\xed\x40\x80" "\x02\xf0\x20\xc8\x78\x80\xc0\x90\x81\xf4\xd0\x18\xd1\x40\xf0\x01" "\xfe\xcc\xda\xfc\xf7\x00\xfe\xff\xc4\xda\xfc\xcc\x44\xfc\xf7\x00" "\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b\x80\xd8\x01\xe9\x02" "\x7c\x04\xf4\x75\xb5\xd0\x40\x51\x20\x71\x34\xf4\x7d\xb9\x85\x08" "\xe9\x12\xf4\x75\x1c\xd1\x40\x80\x01\x14\xcc\xda\xfc\xf7\x00\xf7" "\xff\xc4\xda\xfc\xfe\xf7\x10\xff\xf7\x21\xf4\x79\x00\xf0\x00\xe9" "\x0e\x80\x00\xf4\xc9\x1c\xd1\x40\xd9\x00\xe9\x03\xf5\x10\x09\x21" "\xd9\x06\xe9\x0f\x61\x06\xf4\xc8\x1c\xd1\x40\xd8\x00\xe9\x02\xd5" "\x06\x41\x06\xf4\xe0\x68\xe0\xc7\xcc\xda\xfc\xf7\x00\xfd\xff\xc4" "\xda\xfc\xcc\x44\xfc\xf7\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04" "\xcc\x5b\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x11\xd1\x40\x51\x20" "\xfe\xa0\xf4\xe0\x8b\xda\xc7\x00\x74\x0a\x08\x00\x00\x00\x00\x00" "" ; const int drive_20010608_firmware_size = 288; --- NEW FILE: drive_20020823.h --- static const char drive_20020823_firmware[] = "\xf4\xe1\xa5\x38\xc7\xdc\x00\x80\xf4\x71\x7c\xea\x08\x80\x6e\xf4" "\xe1\x13\x5f\xc7\xdc\x6e\x80\xa0\xf8\xb6\x01\xf4\xe1\x29\x5f\xc7" "\xf4\x74\x47\xd0\x40\xf7\x20\x4c\x80\xf4\x74\x28\xa8\x08\xf7\x20" "\xd6\xfc\xf4\x74\x75\xae\x08\xf7\x20\xd2\xfc\x80\x0c\xc4\xda\xfc" "\xf4\x74\xd9\xd4\x08\xf0\x00\xc8\xda\xfc\xf5\x00\x01\xe9\x22\xc8" "\xda\xfc\xf5\x00\x02\xe8\x03\xfc\x8e\x00\xf4\x74\xf5\xec\x40\x80" "\x02\xf0\x20\xc8\x80\x80\xc0\x98\x81\xf4\xd0\x18\xd1\x40\xf0\x01" "\xfe\xcc\xda\xfc\xf7\x00\xfe\xff\xc4\xda\xfc\xcc\x44\xfc\xf7\x00" "\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b\x80\xd8\x01\xe9\x02" "\x7c\x04\xf4\x75\xb5\xd0\x40\x51\x20\x71\x34\xf4\x7d\xc1\x85\x08" "\xe9\x12\xf4\x75\x1c\xd1\x40\x80\x01\x14\xcc\xda\xfc\xf7\x00\xf7" "\xff\xc4\xda\xfc\xfe\xf7\x10\xff\xf7\x21\xf4\x79\x00\xf0\x00\xe9" "\x0e\x80\x00\xf4\xc9\x1c\xd1\x40\xd9\x00\xe9\x03\xf5\x10\x09\x21" "\xd9\x06\xe9\x0f\x61\x06\xf4\xc8\x1c\xd1\x40\xd8\x00\xe9\x02\xd5" "\x06\x41\x06\xf4\xe0\x98\xdd\xc7\xcc\xda\xfc\xf7\x00\xfd\xff\xc4" "\xda\xfc\xcc\x44\xfc\xf7\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04" "\xcc\x5b\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x11\xd1\x40\x51\x20" "\xfe\xa0\xf4\xe0\xc3\xd7\xc7\x00\x74\x0a\x08\x00\x00\x00\x00\x00" "" ; const int drive_20020823_firmware_size = 288; Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 17 May 2005 20:08:38 -0000 1.2 +++ Makefile 17 May 2005 20:59:19 -0000 1.3 @@ -4,7 +4,7 @@ $(obj)/drive_20010608.h \ $(obj)/drive_20020823.h -CONFIG_GAMECUBE_DI_BUILD_FIRMWARE=y +#CONFIG_GAMECUBE_DI_BUILD_FIRMWARE=y ifeq ($(CONFIG_GAMECUBE_DI_BUILD_FIRMWARE),y) Index: drive_20020402.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/drive_20020402.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- drive_20020402.h 14 May 2005 21:40:12 -0000 1.1 +++ drive_20020402.h 17 May 2005 20:59:19 -0000 1.2 @@ -1,25 +1,24 @@ static const char drive_20020402_firmware[] = - "\xf4\xe1\xa5\x38\xc7\xdc\x00\x80\xf4\x71\x2a\xea\x08\x80\x10\xf4" - "\xe1\x13\x5f\xc7\xdc\x10\x80\xf4\x71\x3a\xea\x08\x80\x5e\xf4\xe1" - "\x04\x5f\xc7\xdc\x6e\x80\xa0\xf8\xb8\x01\xf4\xe1\x1a\x5f\xc7\xf4" - "\x74\x56\xd0\x40\xf7\x20\x4c\x80\xf4\x74\xdb\xa7\x08\xf7\x20\xd6" - "\xfc\xf4\x74\x28\xae\x08\xf7\x20\xd2\xfc\x80\x0c\xc4\xda\xfc\xf4" - "\x74\x7e\xd4\x08\xf0\x00\xc8\xda\xfc\xf5\x00\x01\xe9\x22\xc8\xda" - "\xfc\xf5\x00\x02\xe8\x03\xfc\x8e\x00\xf4\x74\xf9\xec\x40\x80\x02" - "\xf0\x20\xc8\x84\x80\xc0\x9c\x81\xf4\xd0\x28\xd1\x40\xf0\x01\xfe" - "\xcc\xda\xfc\xf7\x00\xfe\xff\xc4\xda\xfc\xcc\x44\xfc\xf7\x00\xfe" - "\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b\x80\xd8\x01\xe9\x02\x7c" - "\x04\xf4\x75\xc4\xd0\x40\x51\x20\x71\x34\xf4\x7d\xc1\x85\x08\xe9" - "\x12\xf4\x75\x2c\xd1\x40\x80\x01\x14\xcc\xda\xfc\xf7\x00\xf7\xff" - "\xc4\xda\xfc\xfe\xf7\x10\xff\xf7\x21\xf4\x79\x00\xf0\x00\xe9\x0e" - "\x80\x00\xf4\xc9\x2c\xd1\x40\xd9\x00\xe9\x03\xf5\x10\x09\x21\xd9" - "\x06\xe9\x0f\x61\x06\xf4\xc8\x2c\xd1\x40\xd8\x00\xe9\x02\xd5\x06" - "\x41\x06\xf4\xe0\x3c\xdd\xc7\xcc\xda\xfc\xf7\x00\xfd\xff\xc4\xda" - "\xfc\xcc\x44\xfc\xf7\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc" - "\x5b\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x20\xd1\x40\x51\x20\xfe" - "\xa0\xf4\xe0\x67\xd7\xc7\x00\x00\x74\x0a\x08\x00\x00\x00\x00\x00" + "\xf4\xe1\xa5\x38\xc7\xdc\x00\x80\xf4\x71\x2a\xea\x08\x80\x6e\xf4" + "\xe1\x13\x5f\xc7\xdc\x6e\x80\xa0\xf8\xb8\x01\xf4\xe1\x29\x5f\xc7" + "\xf4\x74\x47\xd0\x40\xf7\x20\x4c\x80\xf4\x74\xdb\xa7\x08\xf7\x20" + "\xd6\xfc\xf4\x74\x28\xae\x08\xf7\x20\xd2\xfc\x80\x0c\xc4\xda\xfc" + "\xf4\x74\x7e\xd4\x08\xf0\x00\xc8\xda\xfc\xf5\x00\x01\xe9\x22\xc8" + "\xda\xfc\xf5\x00\x02\xe8\x03\xfc\x8e\x00\xf4\x74\xf9\xec\x40\x80" + "\x02\xf0\x20\xc8\x84\x80\xc0\x9c\x81\xf4\xd0\x18\xd1\x40\xf0\x01" + "\xfe\xcc\xda\xfc\xf7\x00\xfe\xff\xc4\xda\xfc\xcc\x44\xfc\xf7\x00" + "\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b\x80\xd8\x01\xe9\x02" + "\x7c\x04\xf4\x75\xb5\xd0\x40\x51\x20\x71\x34\xf4\x7d\xc1\x85\x08" + "\xe9\x12\xf4\x75\x1c\xd1\x40\x80\x01\x14\xcc\xda\xfc\xf7\x00\xf7" + "\xff\xc4\xda\xfc\xfe\xf7\x10\xff\xf7\x21\xf4\x79\x00\xf0\x00\xe9" + "\x0e\x80\x00\xf4\xc9\x1c\xd1\x40\xd9\x00\xe9\x03\xf5\x10\x09\x21" + "\xd9\x06\xe9\x0f\x61\x06\xf4\xc8\x1c\xd1\x40\xd8\x00\xe9\x02\xd5" + "\x06\x41\x06\xf4\xe0\x4b\xdd\xc7\xcc\xda\xfc\xf7\x00\xfd\xff\xc4" + "\xda\xfc\xcc\x44\xfc\xf7\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04" + "\xcc\x5b\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x11\xd1\x40\x51\x20" + "\xfe\xa0\xf4\xe0\x76\xd7\xc7\x00\x74\x0a\x08\x00\x00\x00\x00\x00" "" ; -const int drive_20020402_firmware_size = 304; +const int drive_20020402_firmware_size = 288; |
From: <he...@us...> - 2005-05-17 20:08:47
|
Update of /cvsroot/gc-linux/linux/drivers/block/gcn-di In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10355 Modified Files: Makefile gcn-di.c Added Files: drive_all.S Removed Files: drive_20020402.asm Log Message: Added (untested) support for drive 06 and 08 too. --- NEW FILE: drive_all.S --- /* * DVD-R compatible "cactus" firmware extensions * Copyright (C) 2005 The GameCube Linux Team * Copyright (C) 2005 Albert Herranz * * Based on analysis of Cobra 1.0 drive code released by tmbinc on dextrose. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * */ /* * This code is compatible with binutils 2.15 limited mn10200 support. * */ .equ NMICR, 0xfc40 .equ UNICR, 0xfc44 .equ UNID, (1<<0) .equ ADB0, 0xfcd2 .equ ADB1, 0xfcd6 .equ ADBCTL, 0xfcda .equ ADB0CK, (1<<0) .equ ADB1CK, (1<<1) .equ ADB0ON, (1<<2) .equ ADB1ON, (1<<3) .equ irq_handler_vector, 0x804c /* 04, 06, 08 */ .equ irq_depth, 0x805b /* 04, 06, 08 */ #if DRIVE_MODEL == 0x20020402 /* 04 */ .equ dicmdbuf0, 0x80b4 .equ entry_return_address, 0x08d47e .equ data1, 0x008000 .equ data1_size, 0x6e .equ data1_copy_from, 0x08ea2a .equ bss, 0x00806e .equ bss_size, 0x1b8 .equ cactus, 0x40ecf9 .equ bert, 0x8084 .equ ernie, 0x819c .section absolute .org 0x0808aa /* 04, 06, 08 */ initialize_drive: .org 0x082f27 /* 04, 08 */ memcpy: .org 0x082f49 /* 04, 08 */ memset: .equ adb1_break_address, 0x08a7db .org 0x08a88d adb1_fixup_exit: .equ adb0_break_address, 0x08ae28 .org 0x08ae33 adb0_fixup_exit: .equ disable_extensions_when_called_from, 0x0885c1 /* 04, 08 */ #elif DRIVE_MODEL == 0x20010608 /* 06 */ .equ dicmdbuf0, 0x80a8 .equ entry_return_address, 0x08d41e .equ data1, 0x008000 .equ data1_size, 0x6e .equ data1_copy_from, 0x08e9c8 .equ bss, 0x00806e .equ bss_size, 0x1ac .equ cactus, 0x40ed02 .equ bert, 0x8078 .equ ernie, 0x8190 .section absolute .org 0x0808aa /* 04, 06, 08 */ initialize_drive: .org 0x082f2e memcpy: .org 0x082f50 memset: .equ adb1_break_address, 0x08aaf0 .org 0x08aba2 adb1_fixup_exit: .equ adb0_break_address, 0x08b145 .org 0x08b150 adb0_fixup_exit: .equ disable_extensions_when_called_from, 0x0885b9 #elif DRIVE_MODEL == 0x20020823 /* 08 */ .equ dicmdbuf0, 0x80b0 .equ entry_return_address, 0x08d4d9 .equ data1, 0x008000 .equ data1_size, 0x6e .equ data1_copy_from, 0x08ea7c .equ bss, 0x00806e .equ bss_size, 0x1b6 .equ cactus, 0x40ecf5 .equ bert, 0x8080 .equ ernie, 0x8198 .section absolute .org 0x0808aa /* 04, 06, 08 */ initialize_drive: .org 0x082f27 /* 04, 08 */ memcpy: .org 0x082f49 /* 04, 08 */ memset: .equ adb1_break_address, 0x08a828 .org 0x08a8da adb1_fixup_exit: .equ adb0_break_address, 0x08ae75 .org 0x08ae80 adb0_fixup_exit: .equ disable_extensions_when_called_from, 0x0885c1 /* 04, 08 */ #else #error Sorry, unsupported drive. #endif .section .text .global _start .global _exit /* * Our entry point is a bit special. We start executing for the first time * from the interrupt handler. */ _start: _main: /* * We reinitialize the hardware here, just like the firmware does. */ jsr initialize_drive /* relocate initialized data */ mov data1, a0 mov data1_copy_from, d1 mov data1_size, d0 jsr memcpy /* zero out the bss */ mov bss, a0 sub d0, d0 mov bss_size, d0 jsr memset /* replace the current irq handler with ours */ mov our_irq_handler, a0 mov a0, (irq_handler_vector) /* setup our extending functions ... */ mov adb1_break_address, a0 mov a0, (ADB1) mov adb0_break_address, a0 mov a0, (ADB0) /* ... and enable them */ mov ADB1ON|ADB0ON, d0 movb d0, (ADBCTL) mov entry_return_address, a0 jmp (a0) our_irq_handler: /* check for Address Break 0 */ mov (ADBCTL), d0 and ADB0CK, d0 bne adb0_break_handler /* check for Address Break 1 */ mov (ADBCTL), d0 and ADB1CK, d0 bne adb1_break_handler /* tell the drive to please accept the disk */ mov cactus, a0 mov 2, d0 bset d0, (a0) /* this seems to avoid errors if the drive idles for too long */ mov (bert), d0 mov d0, (ernie) /* call the original handler */ mov (saved_irq_handler), a0 jsr (a0) rts /* * This is how the stacks look like when our interrupt handler is called. * * Our interrupt handler is in fact not the real interrupt handler, but * just a subroutine called by the real interrupt handler. * That's why we just RTS and not RTI from our interrupt handler. * * | | | | * 00| d0 0| <- old a3 | | * 02| 8| | | * 04| d1 6| | | * 06| 4| | | * 08| d2 2| | | * 0a| 0| | | * 0c| d3 8| | | * 0e| 6| | | * 10| a0 4| | | * 12| 2| | | * 14| a1 0| | | * 16| 8| | | * 18| a2 6| | | * 1a| 4| | | * 1c| MDR 2| | | * 1e| PSW | | | * 20| PC lo | | PC lo | <- a3 * 22| PC hi | | PC hi | * : : | old a3 | * | ... | | | * +--------+ +--------+ <- (0x8ea1c) for drive 04 * normal context stack interrupt context stack * */ adb0_break_handler: /* ack the interrupt */ movbu (ADBCTL), d0 and ~ADB0CK, d0 movb d0, (ADBCTL) movbu (UNICR), d0 and ~UNID, d0 movb d0, (UNICR) /* point to the previous stack pointer */ mov a3, a0 add 4, a0 /* * Special case. When entering interrupt context the first time, * the old stack is pushed in the interrupt stack before calling us. */ movbu (irq_depth), d0 cmp 1, d0 bne 1f mov (4, a3), a0 /* get the old stack pointer */ 1: /* overwrite the original return address (look at the stack layout) */ mov adb0_fixup, a1 mov a1, (0x20, a0) /* * We disable the extensions when an original disc is found. * * We do that by checking if we were called from a piece of * code reached only when original discs are inserted. Tricky. */ /* 0x20 + 0x10 + 0x04 = 0x34 */ mov (0x34, a0), a1 cmp disable_extensions_when_called_from, a1 bne 1f di_disable_extensions: mov disable_extensions, a1 mov 1, d0 movb d0, (a1) movbu (ADBCTL), d0 and ~ADB1ON, d0 movb d0, (ADBCTL) 1: rts adb0_fixup: /* disable interrupts */ and 0xf7ff, psw /* deal with the dvd seed */ mov (a0), d1 cmp 0x00f000, d1 bne 1f mov 0x00, d0 movbu (disable_extensions), d1 cmp 0, d1 bne 1f movb d0, (0x09, a0) 1: /* skip the extra field */ mov (a0), d1 cmp 0x06, d1 bne 1f mov (0x06, a0), d1 movbu (disable_extensions), d0 cmp 0, d0 bne 2f add 6, d1 2: mov d1, (0x06, a0) 1: jmp adb0_fixup_exit adb1_break_handler: /* ack the interrupt */ movbu (ADBCTL), d0 and ~ADB1CK, d0 movb d0, (ADBCTL) movbu (UNICR), d0 and ~UNID, d0 movb d0, (UNICR) /* point to the previous stack pointer */ mov a3, a0 add 4, a0 /* * Special case. When entering interrupt context the first time, * the old stack is pushed in the interrupt stack before calling us. */ movbu (irq_depth), d0 cmp 1, d0 bne 1f mov (4, a3), a0 /* get the old stack pointer */ 1: /* overwrite the original return address (look at the stack layout) */ mov adb1_fixup, a1 mov a1, (0x20, a0) rts adb1_fixup: /* no disk id */ sub d0, d0 jmp adb1_fixup_exit .align 2 saved_irq_handler: .long 0x00080A74 /* 04, 06, 08 */ disable_extensions: .byte 0x00 _exit: Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile 14 May 2005 21:40:12 -0000 1.1 +++ Makefile 17 May 2005 20:08:38 -0000 1.2 @@ -1,8 +1,10 @@ obj-$(CONFIG_GAMECUBE_DI) += gcn-di.o -$(obj)/gcn-di.o: $(obj)/drive_20020402.h +$(obj)/gcn-di.o: $(obj)/drive_20020402.h \ + $(obj)/drive_20010608.h \ + $(obj)/drive_20020823.h -#CONFIG_GAMECUBE_DI_BUILD_FIRMWARE=y +CONFIG_GAMECUBE_DI_BUILD_FIRMWARE=y ifeq ($(CONFIG_GAMECUBE_DI_BUILD_FIRMWARE),y) @@ -12,17 +14,29 @@ quiet_cmd_build_difw = BLD FW $@ cmd_build_difw = \ - $(ASMN102) -o $(obj)/$(<F).o $<; \ + $(CPP) -DDRIVE_MODEL=$(DRIVE_MODEL) $< > $(obj)/$(@F).s; \ + $(ASMN102) -o $(obj)/$(@F).o $(obj)/$(@F).s; \ $(LDMN102) --section-start absolute=0 -Ttext=0x40d000 \ - -o $(obj)/$(<F).elf -e 0x40d000 $(obj)/$(<F).o; \ - $(OCMN102) -I elf32-mn10200 -O binary $(obj)/$(<F).elf \ - $(obj)/$(<F).bin; \ - (echo "static "; cat $(obj)/$(<F).bin | scripts/bin2c "$(subst .asm,,$(<F))_firmware") > $@; \ - rm -f $(obj)/$(<F).o $(obj)/$(<F).elf $(obj)/$(<F).bin + -o $(obj)/$(@F).elf -e 0x40d000 $(obj)/$(@F).o; \ + $(OCMN102) -I elf32-mn10200 -O binary $(obj)/$(@F).elf \ + $(obj)/$(@F).bin; \ + (echo "static "; cat $(obj)/$(@F).bin | scripts/bin2c "$(subst .h,,$(@F))_firmware") > $@; \ + rm -f $(obj)/$(@F).o $(obj)/$(@F).elf $(obj)/$(@F).bin $(obj)/$(@F).s targets += drive_20020402.h -$(obj)/drive_20020402.h: $(src)/drive_20020402.asm FORCE +$(obj)/drive_20020402.h: DRIVE_MODEL := 0x20020402 +$(obj)/drive_20020402.h: $(src)/drive_all.S FORCE + $(call if_changed,build_difw) + +targets += drive_20010608.h +$(obj)/drive_20010608.h: DRIVE_MODEL := 0x20010608 +$(obj)/drive_20010608.h: $(src)/drive_all.S FORCE + $(call if_changed,build_difw) + +targets += drive_20020823.h +$(obj)/drive_20020823.h: DRIVE_MODEL := 0x20020823 +$(obj)/drive_20020823.h: $(src)/drive_all.S FORCE $(call if_changed,build_difw) endif Index: gcn-di.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/gcn-di.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gcn-di.c 14 May 2005 21:40:12 -0000 1.1 +++ gcn-di.c 17 May 2005 20:08:38 -0000 1.2 @@ -249,13 +249,29 @@ * Drive 06 (XXX) firmware extensions. */ -/* XXX TODO */ +#include "drive_20010608.h" + +static struct di_drive_code drive_20010608[] = { + [0] = { + .address = DI_DRIVE_CODE_BASE, + .len = sizeof(drive_20010608_firmware), + .code = (u8 *)drive_20010608_firmware, + }, +}; /* - * Drive 08 (XXX) firmware extensions. + * Drive 08 (20020823) firmware extensions. */ -/* XXX TODO */ +#include "drive_20020823.h" + +static struct di_drive_code drive_20020823[] = { + [0] = { + .address = DI_DRIVE_CODE_BASE, + .len = sizeof(drive_20020823_firmware), + .code = (u8 *)drive_20020823_firmware, + }, +}; /* @@ -879,6 +895,18 @@ di_patch(ddev, &generic_drive_code_trigger, 1); ddev->flags |= DI_INTEROPERABLE; break; + case 0x20010608: + di_patch(ddev, drive_20010608, + ARRAY_SIZE(drive_20010608)); + di_patch(ddev, &generic_drive_code_trigger, 1); + ddev->flags |= DI_INTEROPERABLE; + break; + case 0x20020823: + di_patch(ddev, drive_20020823, + ARRAY_SIZE(drive_20020823)); + di_patch(ddev, &generic_drive_code_trigger, 1); + ddev->flags |= DI_INTEROPERABLE; + break; default: di_printk(KERN_ERR, "sorry, drive %x is not yet" " supported\n", --- drive_20020402.asm DELETED --- |
From: <he...@us...> - 2005-05-14 21:40:21
|
Update of /cvsroot/gc-linux/linux/drivers/block/gcn-di In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15497/drivers/block/gcn-di Added Files: Makefile drive_20020402.asm drive_20020402.h gcn-di.c Log Message: Added an alternate DVD driver. This driver allows using DVD-R media like in a normal DVD drive. Currently, only drive 04 (20020402) is supported. Support for drive 06 and 08 should be easily added. By default, the driver will reject original media. --- NEW FILE: Makefile --- obj-$(CONFIG_GAMECUBE_DI) += gcn-di.o $(obj)/gcn-di.o: $(obj)/drive_20020402.h #CONFIG_GAMECUBE_DI_BUILD_FIRMWARE=y ifeq ($(CONFIG_GAMECUBE_DI_BUILD_FIRMWARE),y) ASMN102 = mn10200-linux-as LDMN102 = mn10200-linux-ld OCMN102 = mn10200-linux-objcopy quiet_cmd_build_difw = BLD FW $@ cmd_build_difw = \ $(ASMN102) -o $(obj)/$(<F).o $<; \ $(LDMN102) --section-start absolute=0 -Ttext=0x40d000 \ -o $(obj)/$(<F).elf -e 0x40d000 $(obj)/$(<F).o; \ $(OCMN102) -I elf32-mn10200 -O binary $(obj)/$(<F).elf \ $(obj)/$(<F).bin; \ (echo "static "; cat $(obj)/$(<F).bin | scripts/bin2c "$(subst .asm,,$(<F))_firmware") > $@; \ rm -f $(obj)/$(<F).o $(obj)/$(<F).elf $(obj)/$(<F).bin targets += drive_20020402.h $(obj)/drive_20020402.h: $(src)/drive_20020402.asm FORCE $(call if_changed,build_difw) endif --- NEW FILE: drive_20020402.asm --- /* * drive 04 (20020402) DVD-R compatible "cactus" firmware extensions * Copyright (C) 2005 The GameCube Linux Team * Copyright (C) 2005 Albert Herranz * * Based on analysis of Cobra 1.0 drive code released by tmbinc on dextrose. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * */ /* * This code is compatible with binutils 2.15 limited mn10200 support. * */ .equ irq_handler_vector, 0x804c .equ irq_depth, 0x805b .equ dicmdbuf0, 0x80b4 .equ NMICR, 0xfc40 .equ UNICR, 0xfc44 .equ UNID, (1<<0) .equ ADB0, 0xfcd2 .equ ADB1, 0xfcd6 .equ ADBCTL, 0xfcda .equ ADB0CK, (1<<0) .equ ADB1CK, (1<<1) .equ ADB0ON, (1<<2) .equ ADB1ON, (1<<3) /* we jump here on return from our entry point */ .equ entry_return_address, 0x08d47e .equ data1, 0x08ea2a .equ data1_size, 0x10 .equ data2, 0x08ea3a .equ data2_size, 0x5e .equ bss_size, 0x1b8 .equ cactus, 0x40ecf9 .section absolute .org 0x0808aa initialize_drive: .org 0x082f27 memcpy: .org 0x082f49 memset: .equ adb1_break_address, 0x08a7db .org 0x08a88d adb1_fixup_exit: .equ disable_extensions_when_called_from, 0x0885c1 .equ adb0_break_address, 0x08ae28 .org 0x08ae33 adb0_fixup_exit: .section .text .global _start .global _exit /* * Our entry point is a bit special. We start executing for the first time * from the interrupt handler. */ _start: _main: /* * We reinitialize the hardware here, just like the firmware does. */ jsr initialize_drive /* relocate initialized data */ mov 0x8000, a0 mov data1, d1 mov data1_size, d0 jsr memcpy mov 0x8010, a0 mov data2, d1 mov data2_size, d0 jsr memcpy /* zero out the bss */ mov 0x806e, a0 sub d0, d0 mov bss_size, d0 jsr memset /* replace the current irq handler with ours */ mov our_irq_handler, a0 mov a0, (irq_handler_vector) /* setup our extending functions ... */ mov adb1_break_address, a0 mov a0, (ADB1) mov adb0_break_address, a0 mov a0, (ADB0) /* ... and enable them */ mov ADB1ON|ADB0ON, d0 movb d0, (ADBCTL) mov entry_return_address, a0 jmp (a0) our_irq_handler: /* check for Address Break 0 */ mov (ADBCTL), d0 and ADB0CK, d0 bne adb0_break_handler /* check for Address Break 1 */ mov (ADBCTL), d0 and ADB1CK, d0 bne adb1_break_handler /* tell the drive to please accept the disk */ mov cactus, a0 mov 2, d0 bset d0, (a0) /* not sure about this ... */ mov (0x8084), d0 mov d0, (0x819c) /* call the original handler */ mov (saved_irq_handler), a0 jsr (a0) rts /* * This is how the stacks look like when our interrupt handler is called. * * Our interrupt handler is in fact not the real interrupt handler, but * just a subroutine called by the real interrupt handler. * That's why we just RTS and not RTI from our interrupt handler. * * | | | | * 00| d0 0| <- old a3 | | * 02| 8| | | * 04| d1 6| | | * 06| 4| | | * 08| d2 2| | | * 0a| 0| | | * 0c| d3 8| | | * 0e| 6| | | * 10| a0 4| | | * 12| 2| | | * 14| a1 0| | | * 16| 8| | | * 18| a2 6| | | * 1a| 4| | | * 1c| MDR 2| | | * 1e| PSW | | | * 20| PC lo | | PC lo | <- a3 * 22| PC hi | | PC hi | * : : | old a3 | * | ... | | | * +--------+ +--------+ <- 0x8ea1c * normal context stack interrupt context stack * */ adb0_break_handler: /* ack the interrupt */ movbu (ADBCTL), d0 and ~ADB0CK, d0 movb d0, (ADBCTL) movbu (UNICR), d0 and ~UNID, d0 movb d0, (UNICR) /* point to the previous stack pointer */ mov a3, a0 add 4, a0 /* * Special case. When entering interrupt context the first time, * the old stack is pushed in the interrupt stack before calling us. */ movbu (irq_depth), d0 cmp 1, d0 bne 1f mov (4, a3), a0 /* get the old stack pointer */ 1: /* overwrite the original return address (look at the stack layout) */ mov adb0_fixup, a1 mov a1, (0x20, a0) /* * We disable the extensions when an original disc is found. * * We do that by checking if we were called from a piece of * code reached only when original discs are inserted. Tricky. */ /* 0x20 + 0x10 + 0x04 = 0x34 */ mov (0x34, a0), a1 cmp disable_extensions_when_called_from, a1 bne 1f di_disable_extensions: mov disable_extensions, a1 mov 1, d0 movb d0, (a1) movbu (ADBCTL), d0 and ~ADB1ON, d0 movb d0, (ADBCTL) 1: rts adb0_fixup: /* disable interrupts */ and 0xf7ff, psw /* deal with the dvd seed */ mov (a0), d1 cmp 0x00f000, d1 bne 1f mov 0x00, d0 movbu (disable_extensions), d1 cmp 0, d1 bne 1f movb d0, (0x09, a0) 1: /* skip the extra field */ mov (a0), d1 cmp 0x06, d1 bne 1f mov (0x06, a0), d1 movbu (disable_extensions), d0 cmp 0, d0 bne 2f add 6, d1 2: mov d1, (0x06, a0) 1: jmp adb0_fixup_exit adb1_break_handler: /* ack the interrupt */ movbu (ADBCTL), d0 and ~ADB1CK, d0 movb d0, (ADBCTL) movbu (UNICR), d0 and ~UNID, d0 movb d0, (UNICR) /* point to the previous stack pointer */ mov a3, a0 add 4, a0 /* * Special case. When entering interrupt context the first time, * the old stack is pushed in the interrupt stack before calling us. */ movbu (irq_depth), d0 cmp 1, d0 bne 1f mov (4, a3), a0 /* get the old stack pointer */ 1: /* overwrite the original return address (look at the stack layout) */ mov adb1_fixup, a1 mov a1, (0x20, a0) rts adb1_fixup: /* no disk id */ sub d0, d0 jmp adb1_fixup_exit .align 2 saved_irq_handler: .long 0x00080A74 disable_extensions: .byte 0x00 _exit: --- NEW FILE: drive_20020402.h --- static const char drive_20020402_firmware[] = "\xf4\xe1\xa5\x38\xc7\xdc\x00\x80\xf4\x71\x2a\xea\x08\x80\x10\xf4" "\xe1\x13\x5f\xc7\xdc\x10\x80\xf4\x71\x3a\xea\x08\x80\x5e\xf4\xe1" "\x04\x5f\xc7\xdc\x6e\x80\xa0\xf8\xb8\x01\xf4\xe1\x1a\x5f\xc7\xf4" "\x74\x56\xd0\x40\xf7\x20\x4c\x80\xf4\x74\xdb\xa7\x08\xf7\x20\xd6" "\xfc\xf4\x74\x28\xae\x08\xf7\x20\xd2\xfc\x80\x0c\xc4\xda\xfc\xf4" "\x74\x7e\xd4\x08\xf0\x00\xc8\xda\xfc\xf5\x00\x01\xe9\x22\xc8\xda" "\xfc\xf5\x00\x02\xe8\x03\xfc\x8e\x00\xf4\x74\xf9\xec\x40\x80\x02" "\xf0\x20\xc8\x84\x80\xc0\x9c\x81\xf4\xd0\x28\xd1\x40\xf0\x01\xfe" "\xcc\xda\xfc\xf7\x00\xfe\xff\xc4\xda\xfc\xcc\x44\xfc\xf7\x00\xfe" "\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc\x5b\x80\xd8\x01\xe9\x02\x7c" "\x04\xf4\x75\xc4\xd0\x40\x51\x20\x71\x34\xf4\x7d\xc1\x85\x08\xe9" "\x12\xf4\x75\x2c\xd1\x40\x80\x01\x14\xcc\xda\xfc\xf7\x00\xf7\xff" "\xc4\xda\xfc\xfe\xf7\x10\xff\xf7\x21\xf4\x79\x00\xf0\x00\xe9\x0e" "\x80\x00\xf4\xc9\x2c\xd1\x40\xd9\x00\xe9\x03\xf5\x10\x09\x21\xd9" "\x06\xe9\x0f\x61\x06\xf4\xc8\x2c\xd1\x40\xd8\x00\xe9\x02\xd5\x06" "\x41\x06\xf4\xe0\x3c\xdd\xc7\xcc\xda\xfc\xf7\x00\xfd\xff\xc4\xda" "\xfc\xcc\x44\xfc\xf7\x00\xfe\xff\xc4\x44\xfc\xf2\x7c\xd0\x04\xcc" "\x5b\x80\xd8\x01\xe9\x02\x7c\x04\xf4\x75\x20\xd1\x40\x51\x20\xfe" "\xa0\xf4\xe0\x67\xd7\xc7\x00\x00\x74\x0a\x08\x00\x00\x00\x00\x00" "" ; const int drive_20020402_firmware_size = 304; --- NEW FILE: gcn-di.c --- /* * drivers/block/gcn-di/gcn-di.c * * Nintendo GameCube DVD Interface driver * Copyright (C) 2005 The GameCube Linux Team * Copyright (C) 2005 Albert Herranz * * Portions based on previous work by Scream|CT. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> [...1526 lines suppressed...] return retval; } /* * Module de-initialization routine. */ static void __exit di_exit_module(void) { platform_device_unregister(&di_device.pdev); driver_unregister(&di_driver); } module_init(di_init_module); module_exit(di_exit_module); MODULE_AUTHOR(DRV_AUTHOR); MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_LICENSE("GPL"); |
From: <he...@us...> - 2005-05-14 21:40:20
|
Update of /cvsroot/gc-linux/linux/drivers/block In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15497/drivers/block Modified Files: Kconfig Makefile Log Message: Added an alternate DVD driver. This driver allows using DVD-R media like in a normal DVD drive. Currently, only drive 04 (20020402) is supported. Support for drive 06 and 08 should be easily added. By default, the driver will reject original media. Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/Kconfig,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Kconfig 8 Apr 2005 14:39:16 -0000 1.13 +++ Kconfig 14 May 2005 21:40:12 -0000 1.14 @@ -61,9 +61,20 @@ To compile this driver as a module, choose M here: the module will be called z2ram. +config GAMECUBE_DI + tristate "Nintendo Gamecube (alternate) DVD support" + depends on GAMECUBE && !GAMECUBE_DVDCOVER && EXPERIMENTAL + help + This enables support for using DVD-R media on + the Nintendo GameCube DVD drive. + Say Y if you want to include this driver in the kernel. + + To compile this driver as a module, choose M here: the + module will be called gcn-di. + config GAMECUBE_DVD tristate "Nintendo Gamecube DVD" - depends on GAMECUBE + depends on GAMECUBE && !GAMECUBE_DI && !GAMECUBE_DVDCOVER help This enables support for using the mini-DVD drive on the Nintendo Gamecube. Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/Makefile,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile 8 Apr 2005 14:39:16 -0000 1.11 +++ Makefile 14 May 2005 21:40:12 -0000 1.12 @@ -28,10 +28,11 @@ obj-$(CONFIG_ATARI_ACSI) += acsi.o obj-$(CONFIG_ATARI_SLM) += acsi_slm.o obj-$(CONFIG_AMIGA_Z2RAM) += z2ram.o +obj-$(CONFIG_GAMECUBE_DI) += gcn-di/ +obj-$(CONFIG_GAMECUBE_DVD) += gcn-dvd/ obj-$(CONFIG_GAMECUBE_ARAM) += gcn-aram.o obj-$(CONFIG_GAMECUBE_MEMCARD) += gcn-memcard.o obj-$(CONFIG_GAMECUBE_SD) += gcn-sd.o -obj-$(CONFIG_GAMECUBE_DVD) += gcn-dvd/ obj-$(CONFIG_BLK_DEV_RAM) += rd.o obj-$(CONFIG_BLK_DEV_LOOP) += loop.o obj-$(CONFIG_BLK_DEV_PS2) += ps2esdi.o |
From: <he...@us...> - 2005-05-14 21:34:41
|
Update of /cvsroot/gc-linux/linux/arch/ppc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15070/arch/ppc Modified Files: Kconfig Log Message: Do not build by default the dvd cover driver. It is becoming obsolete. Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/ppc/Kconfig,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Kconfig 13 Mar 2005 21:51:37 -0000 1.24 +++ Kconfig 14 May 2005 21:34:33 -0000 1.25 @@ -684,7 +684,7 @@ config GAMECUBE_DVDCOVER tristate "Nintendo GameCube DVD cover" depends on GAMECUBE - default y + default n help If you say yes to this option, support will be included for the DVD cover of the Nintendo GameCube. |
From: <he...@us...> - 2005-05-14 21:33:01
|
Update of /cvsroot/gc-linux/linux/drivers/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14786/drivers/misc Modified Files: gcn-mi.c Log Message: Initialize the spin lock used by the driver. Index: gcn-mi.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/misc/gcn-mi.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gcn-mi.c 24 Feb 2005 21:39:30 -0000 1.2 +++ gcn-mi.c 14 May 2005 21:32:52 -0000 1.3 @@ -221,6 +221,7 @@ } priv->last_address_faults = 0; */ + spin_lock_init(&priv->lock); priv->device = device; dev_set_drvdata(priv->device, priv); |
From: <he...@us...> - 2005-05-14 19:36:42
|
Update of /cvsroot/gc-linux/linux/drivers/block/gcn-di In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29067/gcn-di Log Message: Directory /cvsroot/gc-linux/linux/drivers/block/gcn-di added to the repository |
From: <he...@us...> - 2005-05-14 00:24:26
|
Update of /cvsroot/gc-linux/linux/include/asm-ppc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10435/include/asm-ppc Modified Files: io.h Log Message: Got rid of some more pci stuff. Index: io.h =================================================================== RCS file: /cvsroot/gc-linux/linux/include/asm-ppc/io.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- io.h 3 Mar 2005 21:12:52 -0000 1.6 +++ io.h 14 May 2005 00:24:16 -0000 1.7 @@ -32,7 +32,7 @@ #include <asm/mpc8260.h> #elif defined(CONFIG_85xx) #include <asm/mpc85xx.h> -#elif defined(CONFIG_APUS) +#elif defined(CONFIG_APUS) || defined(CONFIG_GAMECUBE) #define _IO_BASE 0 #define _ISA_MEM_BASE 0 #define PCI_DRAM_OFFSET 0 |
From: <he...@us...> - 2005-04-25 19:34:59
|
Update of /cvsroot/gc-linux/linux/arch/ppc/platforms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28400/arch/ppc/platforms Modified Files: gcn-rtc.c Log Message: set_rtc_time may be called from interrupt context. The RTC driver now deals with that case. Index: gcn-rtc.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/ppc/platforms/gcn-rtc.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gcn-rtc.c 13 Mar 2005 21:51:39 -0000 1.3 +++ gcn-rtc.c 25 Apr 2005 19:34:48 -0000 1.4 @@ -62,6 +62,7 @@ /* * Loads the SRAM contents. + * Context: user. */ static void sram_load(struct exi_device *dev) { @@ -70,63 +71,75 @@ u32 req; /* select the SRAM device */ - exi_dev_select(dev); - - /* send the appropriate command */ - req = 0x20000100; - exi_dev_write(dev, &req, sizeof(req)); + if (exi_dev_select(dev) == 0) { + /* send the appropriate command */ + req = 0x20000100; + exi_dev_write(dev, &req, sizeof(req)); - /* read the SRAM data */ - exi_dev_read(dev, sram, sizeof(*sram)); + /* read the SRAM data */ + exi_dev_read(dev, sram, sizeof(*sram)); - /* deselect the SRAM device */ - exi_dev_deselect(dev); + /* deselect the SRAM device */ + exi_dev_deselect(dev); + } return; } /* * Gets the hardware clock date and time. + * Context: user. */ static unsigned long rtc_get_time(struct exi_device *dev) { - unsigned long a; + unsigned long a = 0; /* select the RTC device */ - exi_dev_select(dev); - - /* send the appropriate command */ - a = 0x20000000; - exi_dev_write(dev, &a, sizeof(a)); + if (exi_dev_select(dev) == 0) { + /* send the appropriate command */ + a = 0x20000000; + exi_dev_write(dev, &a, sizeof(a)); - /* read the time and date value */ - exi_dev_read(dev, &a, sizeof(a)); + /* read the time and date value */ + exi_dev_read(dev, &a, sizeof(a)); - /* deselect the RTC device */ - exi_dev_deselect(dev); + /* deselect the RTC device */ + exi_dev_deselect(dev); + } return a; } /* * Sets the hardware clock date and time to @aval. + * Context: user, interrupt (adjtimex). */ -static void rtc_set_time(struct exi_device *dev, unsigned long aval) +static int rtc_set_time(struct exi_device *dev, unsigned long aval) { u32 req; + int retval; - /* select the RTC device */ - exi_dev_select(dev); + /* + * We may get called from the timer interrupt. In that case, + * we could fail if the exi channel used to access the RTC + * is busy. If this happens, we just return an error. The timer + * interrupt code is prepared to deal with such case. + */ - /* send the appropriate command */ - req = 0xa0000000; - exi_dev_write(dev, &req, sizeof(req)); + /* select the RTC device */ + retval = exi_dev_select(dev); + if (!retval) { + /* send the appropriate command */ + req = 0xa0000000; + exi_dev_write(dev, &req, sizeof(req)); - /* set the new time and date value */ - exi_dev_write(dev, &aval, sizeof(aval)); + /* set the new time and date value */ + exi_dev_write(dev, &aval, sizeof(aval)); - /* deselect the RTC device */ - exi_dev_deselect(dev); + /* deselect the RTC device */ + exi_dev_deselect(dev); + } + return retval; } /** @@ -147,9 +160,7 @@ { struct rtc_private *priv = &rtc_private; - rtc_set_time(priv->dev, nowtime - RTC_OFFSET - priv->sram.bias); - - return 1; + return rtc_set_time(priv->dev, nowtime - RTC_OFFSET - priv->sram.bias); } /** |
From: <he...@us...> - 2005-04-25 19:30:28
|
Update of /cvsroot/gc-linux/linux/include/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23915/include/linux Modified Files: exi.h Log Message: An exi select while a channel is already selected could be now a "expected" case, and not a bug, in some particular scenarios. (This may happen when called directly from interrupt context, without any provision, like the in the RTC driver case). The select primitive now returns an error if the channel is already busy, otherwise succeeds like before. Index: exi.h =================================================================== RCS file: /cvsroot/gc-linux/linux/include/linux/exi.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- exi.h 20 Mar 2005 17:10:39 -0000 1.10 +++ exi.h 25 Apr 2005 19:29:43 -0000 1.11 @@ -237,7 +237,7 @@ extern u32 exi_get_id(struct exi_channel *exi_channel, unsigned int device, unsigned int freq); -void exi_select(struct exi_device *exi_device); +int exi_select(struct exi_device *exi_device); void exi_deselect(struct exi_channel *exi_channel); void exi_transfer(struct exi_channel *exi_channel, void *data, size_t len, int opcode); @@ -293,11 +293,11 @@ exi_hw_exit(); } -static inline void exi_lite_select(int channel, int device, int freq) +static inline int exi_lite_select(int channel, int device, int freq) { struct exi_channel *exi_channel = to_exi_channel(channel); struct exi_device *exi_device = exi_get_exi_device(exi_channel, device); - exi_select(exi_device); + return exi_select(exi_device); } static inline void exi_lite_deselect(int channel) |
From: <he...@us...> - 2005-04-25 19:30:27
|
Update of /cvsroot/gc-linux/linux/drivers/exi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23915/drivers/exi Modified Files: exi-hw.c Log Message: An exi select while a channel is already selected could be now a "expected" case, and not a bug, in some particular scenarios. (This may happen when called directly from interrupt context, without any provision, like the in the RTC driver case). The select primitive now returns an error if the channel is already busy, otherwise succeeds like before. Index: exi-hw.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/exi/exi-hw.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- exi-hw.c 20 Mar 2005 17:10:38 -0000 1.8 +++ exi-hw.c 25 Apr 2005 19:29:43 -0000 1.9 @@ -403,13 +403,22 @@ * Internal. Perform a select. * Caller holds the channel lock. */ -static inline void exi_cmd_select(struct exi_command *cmd) +static inline int exi_cmd_select(struct exi_command *cmd) { struct exi_channel *exi_channel = cmd->exi_channel; struct exi_device *exi_device; + int retval = 0; BUG_ON(cmd->data == NULL); - BUG_ON(exi_is_selected(exi_channel)); + if (unlikely(exi_is_selected(exi_channel))) { + /* + * This may happen when called directly from interrupt context, + * without using the EXI event handler system. + * In such cases, the caller _should_ be able to deal with that. + */ + retval = -EBUSY; + goto out; + } spin_lock(&exi_channel->select_lock); @@ -425,6 +434,8 @@ exi_select_raw(exi_channel, exi_device->eid.device, exi_device->frequency); +out: + return retval; } /* @@ -639,7 +650,7 @@ !exi_is_selected(exi_channel)); spin_lock_irqsave(&exi_channel->lock, flags); } - exi_cmd_select(cmd); + retval = exi_cmd_select(cmd); break; case EXI_OP_DESELECT: exi_cmd_deselect(cmd); @@ -685,17 +696,20 @@ static int exi_run_command_and_wait(struct exi_command *cmd) { DECLARE_COMPLETION(complete); + int retval; cmd->done_data = &complete; cmd->done = exi_wait_done; - if (exi_run_command(cmd) > 0) { + retval = exi_run_command(cmd); + if (retval > 0) { if (in_atomic() || irqs_disabled()) { exi_wait_for_dma_transfer(cmd->exi_channel); } else { wait_for_completion(&complete); } + retval = 0; } - return 0; + return retval; } @@ -705,12 +719,12 @@ * * Selects a given EXI device. */ -void exi_select(struct exi_device *exi_device) +int exi_select(struct exi_device *exi_device) { struct exi_command cmd; exi_op_select(&cmd, exi_device); - exi_run_command(&cmd); + return exi_run_command(&cmd); } /** |
From: <a.o...@bl...> - 2005-04-09 01:04:52
|
On Fri, Apr 08, 2005 at 07:39:18AM -0700, pal...@us... wrote: > Update of /cvsroot/gc-linux/linux/drivers/block/gcn-dvd > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15523/drivers/block/gcn-dvd > > Added Files: > Makefile main.c request.c request.h > Log Message: > Addition of DVD driver since some mods replace the DVD interface with something > more interesting (IDE,SATA, etc) Forgot to kill of arch/ppc/platforms/gcn-dvd.c and related entries in Kconfig/Makefile? |
From: <he...@us...> - 2005-04-08 20:19:16
|
Update of /cvsroot/gc-linux/htdocs/xml/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7267 Modified Files: news.xml Log Message: 8 April 2005, DVD block driver Index: news.xml =================================================================== RCS file: /cvsroot/gc-linux/htdocs/xml/en/news.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- news.xml 22 Mar 2005 19:13:11 -0000 1.34 +++ news.xml 8 Apr 2005 20:19:08 -0000 1.35 @@ -2,6 +2,11 @@ <?xml-stylesheet href="news.xsl" type="text/xsl"?> <news> <item> + <date>8 April 2005</date> + <title>DVD block driver</title> + <text>Scream|CT finally committed his GameCube DVD block driver. In its current form, it allows raw access to original GameCube disks. The code is available on CVS. </text> + </item> + <item> <date>22 March 2005</date> <title>psolore</title> <text>The psoload reloader, aka psolore, is a simple command line tool to reload code on a GameCube previously booted with PSOload or SDload, just like psoload -r does. It works on Linux and comes with source code. Look at the <a href="down/isobel/psolore/readme.txt">readme</a> for more information, or download the <a href="down/isobel/psolore/psolore.tgz">tarball</a>.</text> |
From: <he...@us...> - 2005-04-08 19:42:51
|
Update of /cvsroot/gc-linux/linux/drivers/block/gcn-dvd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19369 Modified Files: main.c Log Message: Fixed small typos in spinlocks hidden by macros. Index: main.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-dvd/main.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- main.c 8 Apr 2005 14:39:16 -0000 1.1 +++ main.c 8 Apr 2005 19:42:42 -0000 1.2 @@ -631,7 +631,7 @@ } /* ok we have an interrupt, now process our queue */ /* lock our structure */ - spin_lock_irqsave(interrupt_queue.lock,flags); + spin_lock_irqsave(&interrupt_queue.lock,flags); /* now look at our structure and call appropriate callback if necessary */ if (!list_empty(&interrupt_queue.queue)) { /* first unlink the queue item */ @@ -650,7 +650,7 @@ interrupt_queue.queue.next); } /* unlock the lock */ - spin_unlock_irqrestore(interrupt_queue.lock,flags); + spin_unlock_irqrestore(&interrupt_queue.lock,flags); /* determine the correct interrupt status */ if (reason & REASON_FLAG_COVER) { if (reason & DI_DICVR_CVR) { @@ -675,7 +675,7 @@ } } else { - spin_unlock_irqrestore(interrupt_queue.lock,flags); + spin_unlock_irqrestore(&interrupt_queue.lock,flags); DPRINTK("Received interrupt but nothing was waiting for it\n"); } |
From: <pal...@us...> - 2005-04-08 14:39:25
|
Update of /cvsroot/gc-linux/linux/drivers/block/gcn-dvd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15523/drivers/block/gcn-dvd Added Files: Makefile main.c request.c request.h Log Message: Addition of DVD driver since some mods replace the DVD interface with something more interesting (IDE,SATA, etc) --- NEW FILE: Makefile --- obj-$(CONFIG_GAMECUBE_DVD) := gcn-dvd.o gcn-dvd-objs := main.o request.o --- NEW FILE: main.c --- /* * drivers/block/gcn-dvd/main.c * * Nintendo GameCube DVD driver * Copyright (C) 2005 The GameCube Linux Team * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * */ #include <linux/major.h> #include <linux/vmalloc.h> #include <linux/init.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/blkdev.h> #include <linux/delay.h> #include <linux/cdrom.h> #include <linux/wait.h> #include <asm/setup.h> #include <asm/bitops.h> #include <asm/pgtable.h> #include <asm/cacheflush.h> #include <asm/cache.h> #include <linux/interrupt.h> #include <linux/fcntl.h> /* O_ACCMODE */ #include <linux/hdreg.h> /* HDIO_GETGEO */ #include <asm/io.h> #include "request.h" #define DEVICE_NAME "DVD" #define DVD_MAJOR 60 #define LINUX_SECTOR_SIZE 512 #define LINUX_SECTOR_SHIFT 9 #define DVD_SECTOR_SIZE 2048 #define DVD_SECTOR_SHIFT 11 #define DVD_MAX_SECTORS 712880 #define DMA_ALIGNMENT_MASK 0x1F #define DVD_REGISTER_INIT ((void* __iomem)0xCC003024) #define DVD_REGISTER_BLOCK_BASE 0xCC006000 #define DVD_REGISTER_BLOCK_LENGTH 0x40 #define DVD_GAMECODE_U32 0x80000000 /* Gamecode */ #define DVD_COMPANY_U16 0x80000004 /* Game company id */ #define DVD_DISK_ID_U8 0x80000006 /* Disk id */ #define DVD_DISK_VERSION_U8 0x80000007 /* Disk version */ #define DVD_IRQ 2 /* DI Status Register */ #define DI_DISR ((void * __iomem)0xCC006000) #define DI_DISR_BRKINT (1<<6) #define DI_DISR_BRKINTMASK (1<<5) #define DI_DISR_TCINT (1<<4) #define DI_DISR_TCINTMASK (1<<3) #define DI_DISR_DEINT (1<<2) #define DI_DISR_DEINTMASK (1<<1) #define DI_DISR_BRK (1<<0) /* DI Cover Register */ #define DI_DICVR ((void * __iomem)0xCC006004) #define DI_DICVR_CVRINT (1<<2) #define DI_DICVR_CVRINTMASK (1<<1) #define DI_DICVR_CVR (1<<0) /* DI Command Buffer 0 */ #define DI_DICMDBUF0 ((void * __iomem)0xCC006008) #define DI_DICMDBUF0_CMD 24 #define DI_DICMDBUF0_SUBCMD1 16 #define DI_DICMDBUF0_SUBCMD2 0 /* DI Command Buffer 1 */ #define DI_DICMDBUF1 ((void * __iomem)0xCC00600C) /* DI Command Buffer 2 */ #define DI_DICMDBUF2 ((void * __iomem)0xCC006010) /* DMA Memory Address Register */ #define DI_DIMAR ((void * __iomem)0xCC006014) /* DI DMA Transfer Length Register */ #define DI_DILENGTH ((void * __iomem)0xCC006018) /* DI Control Register */ #define DI_DICR ((void * __iomem)0xCC00601C) #define DI_DICR_RW (1<<2) #define DI_DICR_DMA (1<<1) #define DI_DICR_TSTART (1<<0) /* DI Immediate Data Buffer */ #define DI_DIIMMBUF ((void * __iomem)0xCC006020) #define DI_CMD_REZERO 0x01 #define DI_CMD_INQUIRY 0x12 #define DI_CMD_READ 0xA8 #define DI_CMD_SEEK 0xAB #define DI_CMD_READTOC 0x43 #define DI_CMD_STOP 0xE3 /* This is a fake command, don't send to the hardware */ #define DI_CMD_INITIALIZE 0xFF #define IS_CMD_TYPE(cmd,type) (((cmd) >> DI_DICMDBUF0_CMD) == (type)) static struct gendisk *dvd_gendisk; static struct request_queue *dvd_queue; static spinlock_t dvd_queue_lock = SPIN_LOCK_UNLOCKED; static struct _taginterrupt_queue { spinlock_t lock; int drive_initialized; struct list_head queue; } interrupt_queue; static struct _tagdvdinfo { spinlock_t lock; unsigned long refCount; unsigned int media_changed; unsigned long numDVDSectors; unsigned long numLinuxSectors; /* disc info */ struct _tagdvdid { u32 gamecode; u16 company; u8 id; u8 version; } disc; } dvd_info; #define LOCK(flags) spin_lock_irqsave(&dvd_info.lock,flags) #define UNLOCK(flags) spin_unlock_irqrestore(&dvd_info.lock,flags) /* Must be 0x20 in size = 32 bytes */ #pragma pack(1) struct gc_dvd_drive_info { u32 head; u32 middle; u32 last; u8 padding[20]; }; struct gc_dvd_disc_info { u16 revision; u16 device_code; u32 release_date; u8 padding[24]; }; #pragma pack() struct dma_buffer { size_t size; void *ptr; void *alignedPtr; dma_addr_t handle; }; #ifdef DEBUG #define DPRINTK(fmt,args...) printk(KERN_INFO "%s (%u): " fmt,__FUNCTION__,__LINE__,## args) #else #define DPRINTK(fmt,args...) #endif static int alloc_dma_buffer(size_t size,struct dma_buffer *pRet) { /* allocate space for the aligned memory */ pRet->size = DMA_ALIGNMENT_MASK + size; if (!(pRet->ptr = kmalloc(pRet->size,GFP_KERNEL | GFP_DMA))) { DPRINTK("Cannot allocate DMA memory of size %i\n",pRet->size); return -ENOMEM; } /* align the pointer */ if ((unsigned long)pRet->ptr & DMA_ALIGNMENT_MASK) { pRet->alignedPtr = (void*)(((unsigned long)pRet->ptr + DMA_ALIGNMENT_MASK) & ~DMA_ALIGNMENT_MASK); /* adjust the size if not aligned */ pRet->size -= (pRet->alignedPtr - pRet->ptr); } else { pRet->alignedPtr = pRet->ptr; } /* get the dma mapping */ pRet->handle = virt_to_phys(pRet->alignedPtr); return 0; } inline static void sync_dma_buffer(struct dma_buffer *pRet) { invalidate_dcache_range((unsigned long)pRet->alignedPtr, (unsigned long)pRet->alignedPtr + pRet->size); } inline static void free_dma_buffer(struct dma_buffer *pRet) { kfree(pRet->ptr); } /* hardware talk */ static void gc_dvd_enable_interrupts(int enable) { unsigned long outval; /* enable main interrupts */ if (enable) { outval = DI_DISR_BRKINT | DI_DISR_TCINT | DI_DISR_DEINT | DI_DISR_BRKINTMASK | DI_DISR_TCINTMASK | DI_DISR_DEINTMASK; } else { outval = DI_DISR_BRKINT | DI_DISR_TCINT | DI_DISR_DEINT; } writel(outval,DI_DISR); /* This enables cover interrupts */ if (enable) { outval = DI_DICVR_CVRINT | DI_DICVR_CVRINTMASK; } else { outval = DI_DICVR_CVRINT; } writel(outval,DI_DICVR); } static void gc_dvd_execute_queue_command(struct gc_dvd_command *cmd) { u32 val; /* if they're doing a read and the drive is not initialized */ if (!interrupt_queue.drive_initialized && IS_CMD_TYPE(cmd->r_DI_DICMDBUF0,DI_CMD_READ)) { /* insert an initialize queue item BEFORE this one */ static struct gc_dvd_command init_cmd = { .r_DI_DICMDBUF0 = DI_CMD_INITIALIZE << DI_DICMDBUF0_CMD, .completion_routine = NULL, .param = NULL, }; /* insert before this item */ list_add_tail(&init_cmd.list,&cmd->list); /* now execute the initialize routine */ val = (readl(DVD_REGISTER_INIT) & ~4) | 1; writel(val,DVD_REGISTER_INIT); udelay(100); val |= (4 | 1); writel(val,DVD_REGISTER_INIT); udelay(100); /* it will return an interrupt when we're done, our queue item will pick it up */ } else if (cmd) { writel(cmd->r_DI_DICMDBUF0,DI_DICMDBUF0); writel(cmd->r_DI_DICMDBUF1,DI_DICMDBUF1); writel(cmd->r_DI_DICMDBUF2,DI_DICMDBUF2); writel((unsigned long)cmd->r_DI_DIMAR,DI_DIMAR); writel(cmd->r_DI_DILENGTH,DI_DILENGTH); writel(cmd->r_DI_DICR,DI_DICR); } } static int gc_dvd_queue_command(struct gc_dvd_command *cmd) { unsigned long flags; int execute_immediately; spin_lock_irqsave(&interrupt_queue.lock,flags); cmd->int_status = is_still_running; /* add to the tail of the list */ execute_immediately = list_empty(&interrupt_queue.queue); list_add_tail(&cmd->list,&interrupt_queue.queue); if (execute_immediately) { gc_dvd_execute_queue_command(cmd); } /* release lock so interrupt handler can get it */ spin_unlock_irqrestore(&interrupt_queue.lock,flags); return 0; } /* This function is called from an IRQ context, we just wake up the queue */ static void gc_dvd_queue_completion_wake_up(struct gc_dvd_command *cmd) { wake_up_interruptible(((wait_queue_head_t*)cmd->param)); } static int gc_dvd_execute_blocking_command(unsigned int di_cmd,unsigned int sz,struct dma_buffer *buf) { struct gc_dvd_command cmd; wait_queue_head_t wait_queue; if ((sz > 0) && alloc_dma_buffer(sz,buf)) { return -ENOMEM; } init_waitqueue_head(&wait_queue); cmd.flags = 0; cmd.r_DI_DICMDBUF0 = di_cmd; cmd.r_DI_DICMDBUF1 = 0; cmd.r_DI_DICMDBUF2 = sz; cmd.r_DI_DIMAR = (sz > 0) ? (void*)buf->handle : NULL; cmd.r_DI_DILENGTH = sz; cmd.r_DI_DICR = DI_DICR_TSTART | ((sz > 0) ? DI_DICR_DMA : 0); cmd.completion_routine = gc_dvd_queue_completion_wake_up; cmd.param = &wait_queue; gc_dvd_queue_command(&cmd); /* wait for it to finish */ while (wait_event_interruptible(wait_queue,cmd.int_status != is_still_running)) ; return cmd.int_status; } static inline void gc_dvd_stop_motor(void) { gc_dvd_execute_blocking_command(DI_CMD_STOP << DI_DICMDBUF0_CMD,0,NULL); } static int gc_dvd_inquiry(void) { /* get status on disk */ struct dma_buffer buf; struct gc_dvd_drive_info *pdi; int is; is = gc_dvd_execute_blocking_command(DI_CMD_INQUIRY << DI_DICMDBUF0_CMD, sizeof(struct gc_dvd_drive_info), &buf); if (is == -ENOMEM) { return is; } else if (is != is_transfer_complete) { printk(KERN_ERR "Gamecube DVD: error in inquiry cmd\n"); is = -ENODEV; } else { sync_dma_buffer(&buf); pdi = (struct gc_dvd_drive_info*)buf.alignedPtr; printk(KERN_INFO "Gamecube DVD: 0x%x, 0x%x,0x%x\n",pdi->head,pdi->middle,pdi->last); is = 0; } free_dma_buffer(&buf); return is; } static int gc_dvd_read_toc(void) { struct dma_buffer buf; struct gc_dvd_disc_info *pdi; int i; i = gc_dvd_execute_blocking_command(DI_CMD_READ << DI_DICMDBUF0_CMD | 0x40, sizeof(struct gc_dvd_disc_info), &buf); if (i != is_transfer_complete) { dvd_info.numDVDSectors = 0; if (i != -ENOMEM) { free_dma_buffer(&buf); } else { i = -ENOMEDIUM; } printk(KERN_ERR "Gamecube DVD: error reading TOC - missing medium?\n"); } else { sync_dma_buffer(&buf); pdi = (struct gc_dvd_disc_info*)buf.alignedPtr; printk(KERN_INFO "Gamecube DVD: revision: %u, device_code %u, release_date: %u\n",pdi->revision,pdi->device_code,pdi->release_date); dvd_info.numDVDSectors = DVD_MAX_SECTORS; /* reset media_changed flag */ dvd_info.media_changed = 0; free_dma_buffer(&buf); i = 0; } /* inform the kernel of the size */ dvd_info.numLinuxSectors = dvd_info.numDVDSectors << (DVD_SECTOR_SHIFT - LINUX_SECTOR_SHIFT); set_capacity(dvd_gendisk,dvd_info.numLinuxSectors); return i; } /* Handlers */ static int gc_dvd_revalidate(struct gendisk *disk) { gc_dvd_read_toc(); return 0; } static int gc_dvd_open(struct inode *inode,struct file *filp) { unsigned long flags; /* we are read only */ if (filp->f_mode & FMODE_WRITE) { return -EROFS; } /* check the disc, only allow minor of 0 to be opened */ if (iminor(inode)) { return -ENODEV; } /* update information about the disc */ LOCK(flags); if (dvd_info.refCount > 0) { /* we only let one at a time */ UNLOCK(flags); return -EBUSY; } else { check_disk_change(inode->i_bdev); /* revalidate should be called if necessary, check results here */ if (dvd_info.numDVDSectors == 0) { UNLOCK(flags); return -ENOMEDIUM; } } dvd_info.refCount++; UNLOCK(flags); return 0; } static int gc_dvd_release(struct inode *inode,struct file *filp) { unsigned long flags; gc_dvd_stop_motor(); LOCK(flags); dvd_info.refCount--; /* force a media change so we re-read the toc and initialize the disc */ dvd_info.media_changed = 1; UNLOCK(flags); return 0; } static int gc_dvd_ioctl(struct inode *inode,struct file *filp, unsigned int cmd,unsigned long arg) { switch (cmd) { case CDROMMULTISESSION: /* struct cdrom_multisession */ break; case CDROMSTART: break; case CDROMSTOP: break; case CDROMREADTOCHDR: /* struct cdrom_tochdr */ break; case CDROMREADTOCENTRY: /* struct cdrom_tocentry */ break; case CDROMREADMODE2: case CDROMREADMODE1: case CDROMREADRAW: /* struct cdrom_read (1-2048, 2-2336,RAW-2352) */ break; case CDROM_GET_MCN: /* retrieve the universal product code */ /* struct cdrom_mcn */ break; case CDROMRESET: /* reset the drive */ break; case BLKRAGET: case BLKFRAGET: case BLKROGET: case BLKBSZGET: case BLKSSZGET: case BLKSECTGET: case BLKGETSIZE: case BLKGETSIZE64: case BLKFLSBUF: return ioctl_by_bdev(inode->i_bdev,cmd,arg); default: return -ENOTTY; } return -ENOTTY; } static int gc_dvd_media_changed(struct gendisk *disk) { /* return 1 if the disc has changed */ return (dvd_info.media_changed ? 1 : 0); } static void gc_dvd_read_request_callback(struct gc_dvd_command *cmd) { unsigned long flags; struct request *req = (struct request*)cmd->param; struct request_queue *rqueue = req->q; enum gc_dvd_interrupt_status int_status = cmd->int_status; /* since this was performed via DMA, invalidate the cache */ if (cmd->int_status == is_transfer_complete) { invalidate_dcache_range((unsigned int)req->buffer,(unsigned int)req->buffer + cmd->r_DI_DILENGTH); } /* free this item so another request can get it */ gc_dvd_request_release_data(cmd); /* now end the request and send back to block layer */ spin_lock_irqsave(rqueue->queue_lock,flags); if (!end_that_request_first(req, (int_status == is_transfer_complete), req->current_nr_sectors)) { add_disk_randomness(req->rq_disk); end_that_request_last(req); } /* start queue back up */ blk_start_queue(rqueue); spin_unlock_irqrestore(rqueue->queue_lock,flags); } static void gc_dvd_do_request(request_queue_t *q) { struct request *req; unsigned long start; unsigned long len; struct gc_dvd_command *cmd; while ((req = elv_next_request(q))) { /* check if they are reading beyond the limits */ if ((req->sector + req->current_nr_sectors) > dvd_info.numLinuxSectors) { printk(KERN_ERR "Gamecube DVD: reading past end\n"); end_request(req,0); } else if (rq_data_dir(req) == WRITE) { printk(KERN_ERR "Gamecube DVD: write attempted\n"); end_request(req,0); } else if (dvd_info.media_changed) { DPRINTK("media changed in read routine, aborting\n"); end_request(req,0); } else if (req->current_nr_sectors >= (1 << (DVD_SECTOR_SHIFT - LINUX_SECTOR_SHIFT))) { /* now schedule the read */ if (gc_dvd_request_get_data(&cmd) || !cmd) { /* we're full, stop the queue */ blk_stop_queue(q); return; } else { /* remove item from the queue */ blkdev_dequeue_request(req); /* setup my structure */ start = req->sector << LINUX_SECTOR_SHIFT; len = req->current_nr_sectors << LINUX_SECTOR_SHIFT; cmd->flags = 0; cmd->r_DI_DICMDBUF0 = DI_CMD_READ << DI_DICMDBUF0_CMD; cmd->r_DI_DICMDBUF1 = start >> (DVD_SECTOR_SHIFT - LINUX_SECTOR_SHIFT); cmd->r_DI_DICMDBUF2 = len; cmd->r_DI_DIMAR = (void*)virt_to_phys(req->buffer); cmd->r_DI_DILENGTH = len; cmd->r_DI_DICR = DI_DICR_TSTART | DI_DICR_DMA; cmd->completion_routine = gc_dvd_read_request_callback; cmd->param = req; gc_dvd_queue_command(cmd); } } } } static struct block_device_operations dvd_fops = { .owner = THIS_MODULE, .open = gc_dvd_open, .release = gc_dvd_release, .revalidate_disk = gc_dvd_revalidate, .media_changed = gc_dvd_media_changed, .ioctl = gc_dvd_ioctl, }; static irqreturn_t gc_dvd_irq_handler(int irq,void *dev_id,struct pt_regs *regs) { unsigned int reason; unsigned long flags; struct gc_dvd_command *cur_item; #define REASON_FLAG_COVER 0x80000000 /* try the main status */ if ((reason=readl(DI_DISR)) & (DI_DISR_BRKINT | DI_DISR_TCINT | DI_DISR_DEINT)) { /* acknowledge the interrupt */ writel(reason | DI_DISR_BRKINT | DI_DISR_TCINT | DI_DISR_DEINT,DI_DISR); } else if ((reason=readl(DI_DICVR)) & (DI_DICVR_CVRINT)) { /* acknowlegde the interrupt */ writel(reason | DI_DICVR_CVRINT,DI_DICVR); /* set media changed flag */ if (!(reason & DI_DICVR_CVR)) { dvd_info.media_changed = 1; } /* set flag to be used later on */ reason |= REASON_FLAG_COVER; } else { /* not for us, get out of here */ return IRQ_NONE; } /* ok we have an interrupt, now process our queue */ /* lock our structure */ spin_lock_irqsave(interrupt_queue.lock,flags); /* now look at our structure and call appropriate callback if necessary */ if (!list_empty(&interrupt_queue.queue)) { /* first unlink the queue item */ cur_item = (struct gc_dvd_command*)interrupt_queue.queue.next; list_del(&cur_item->list); /* do special checks on the command type to keep track of drive state */ if (IS_CMD_TYPE(cur_item->r_DI_DICMDBUF0,DI_CMD_STOP)) { interrupt_queue.drive_initialized = 0; } else if (IS_CMD_TYPE(cur_item->r_DI_DICMDBUF0,DI_CMD_INITIALIZE)) { interrupt_queue.drive_initialized = 1; } /* now execute the next request if we have one */ if (!list_empty(&interrupt_queue.queue)) { gc_dvd_execute_queue_command((struct gc_dvd_command*) interrupt_queue.queue.next); } /* unlock the lock */ spin_unlock_irqrestore(interrupt_queue.lock,flags); /* determine the correct interrupt status */ if (reason & REASON_FLAG_COVER) { if (reason & DI_DICVR_CVR) { cur_item->int_status = is_cover_opened; } else { cur_item->int_status = is_cover_closed; } } else if (reason & DI_DISR_TCINT) { cur_item->int_status = is_transfer_complete; } else if (reason & DI_DISR_DEINT) { cur_item->int_status = is_error; } else if (reason & DI_DISR_BRKINT) { cur_item->int_status = is_break; } /* call the callback */ if (cur_item->completion_routine) { cur_item->completion_routine(cur_item); } } else { spin_unlock_irqrestore(interrupt_queue.lock,flags); DPRINTK("Received interrupt but nothing was waiting for it\n"); } return IRQ_HANDLED; } static int __init gc_dvd_init(void) { int ret; printk(KERN_INFO "Gamecube DVD driver: init\n"); /* initialize the refcount */ memset(&dvd_info,0,sizeof(dvd_info)); dvd_info.media_changed = 1; /* initialize the interrupt_queue */ spin_lock_init(&interrupt_queue.lock); interrupt_queue.drive_initialized = 0; INIT_LIST_HEAD(&interrupt_queue.queue); spin_lock_init(&dvd_info.lock); /* initial the request queue */ gc_dvd_request_init(); /* first reserve our memory region to we can query hardware */ if (check_mem_region(DVD_REGISTER_BLOCK_BASE,DVD_REGISTER_BLOCK_LENGTH) || !request_mem_region(DVD_REGISTER_BLOCK_BASE,DVD_REGISTER_BLOCK_LENGTH,"Gamecube DVD")) { printk(KERN_ERR "Couldn't reserve memory area for DVD\n"); return -ENOMEM; } if ((ret=request_irq(DVD_IRQ,gc_dvd_irq_handler,SA_INTERRUPT,"Gamecube DVD",0))) { printk(KERN_ERR "Unable to reserve DVD IRQ\n"); goto delete_mem_region; } /* enable interrupts */ gc_dvd_enable_interrupts(1); /* query the drive first */ if ((ret=gc_dvd_inquiry())) { goto delete_irq; } /* now stop the dvd motor */ gc_dvd_stop_motor(); if ((ret=register_blkdev(DVD_MAJOR,DEVICE_NAME))) { goto delete_irq; } if (!(dvd_gendisk = alloc_disk(1))) { ret = -ENOMEM; goto unreg_blkdev; } if (!(dvd_queue = blk_init_queue(gc_dvd_do_request,&dvd_queue_lock))) { ret = -ENOMEM; goto delete_gendisk; } dvd_gendisk->major = DVD_MAJOR; dvd_gendisk->first_minor = 0; dvd_gendisk->fops = &dvd_fops; strcpy(dvd_gendisk->disk_name,"dvd"); strcpy(dvd_gendisk->devfs_name,dvd_gendisk->disk_name); dvd_gendisk->queue = dvd_queue; /* ok now setup the desired parameters, like block size, hardsect size, max hardware sectors to read at once, read ahead, etc */ /* Hardware sector size */ blk_queue_hardsect_size(dvd_queue,DVD_SECTOR_SIZE); /* Maximum sectors that can be read per request, hardware limit */ blk_queue_max_phys_segments(dvd_queue,1); blk_queue_max_hw_segments(dvd_queue,1); /* Max size of coalesced segment */ /* blk_queue_max_segment_size(dvd_queue,size); */ /* Set the dma alignment */ blk_queue_dma_alignment(dvd_queue,DMA_ALIGNMENT_MASK); set_disk_ro(dvd_gendisk,1); add_disk(dvd_gendisk); return 0; delete_gendisk: del_gendisk(dvd_gendisk); put_disk(dvd_gendisk); dvd_gendisk = NULL; unreg_blkdev: unregister_blkdev(DVD_MAJOR,DEVICE_NAME); delete_irq: free_irq(DVD_IRQ,0); delete_mem_region: release_mem_region(DVD_REGISTER_BLOCK_BASE,DVD_REGISTER_BLOCK_LENGTH); return ret; } static void __exit gc_dvd_exit(void) { printk(KERN_INFO "Gamecube DVD driver: exit\n"); /* TODO send a break/interrupt to the device */ gc_dvd_stop_motor(); gc_dvd_enable_interrupts(0); free_irq(DVD_IRQ, 0); release_mem_region(DVD_REGISTER_BLOCK_BASE,DVD_REGISTER_BLOCK_LENGTH); blk_unregister_region(MKDEV(DVD_MAJOR,0),256); unregister_blkdev(DVD_MAJOR,DEVICE_NAME); if (dvd_gendisk) { del_gendisk(dvd_gendisk); put_disk(dvd_gendisk); dvd_gendisk = NULL; } if (dvd_queue) { blk_cleanup_queue(dvd_queue); dvd_queue = NULL; } } MODULE_AUTHOR("Scream|CT"); MODULE_DESCRIPTION("Gamecube DVD driver"); MODULE_LICENSE("GPL"); module_init(gc_dvd_init); module_exit(gc_dvd_exit); --- NEW FILE: request.c --- /* * drivers/block/gcn-dvd/request.c * * Nintendo GameCube DVD driver * Copyright (C) 2005 The GameCube Linux Team * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * */ #include <linux/types.h> #include <linux/errno.h> #include <linux/list.h> #include <linux/spinlock.h> #include "request.h" struct data_item { struct list_head list; struct gc_dvd_command data; }; // define array of data items static struct data_item data[MAX_ITEMS]; static spinlock_t lock; static struct list_head lfree; void gc_dvd_request_init(void) { int i; INIT_LIST_HEAD(&lfree); spin_lock_init(&lock); for (i=0;i<MAX_ITEMS;++i) { list_add_tail(&data[i].list,&lfree); } } int gc_dvd_request_get_data(struct gc_dvd_command **ppcmd) { unsigned long flags; struct data_item *pdi; // get the first object and remove from the free list spin_lock_irqsave(&lock,flags); if (list_empty(&lfree)) { spin_unlock_irqrestore(&lock,flags); return -ENOMEM; } pdi = (struct data_item*)lfree.next; list_del(&pdi->list); spin_unlock_irqrestore(&lock,flags); // return it *ppcmd = &pdi->data; return 0; } void gc_dvd_request_release_data(struct gc_dvd_command *pcmd) { unsigned long flags; struct data_item *pdi; /* return the item */ spin_lock_irqsave(&lock,flags); pdi = (struct data_item*)((u8*)pcmd - sizeof(struct list_head)); list_add_tail(&pdi->list,&lfree); spin_unlock_irqrestore(&lock,flags); } --- NEW FILE: request.h --- /* * drivers/block/gcn-dvd/request.h * * Nintendo GameCube DVD driver * Copyright (C) 2005 The GameCube Linux Team * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * */ #ifndef __request___ #define __request___ #define MAX_ITEMS 8 enum gc_dvd_interrupt_status { is_still_running, is_transfer_complete, is_error, is_break, is_cover_closed, is_cover_opened}; struct gc_dvd_command { struct list_head list; u32 flags; enum gc_dvd_interrupt_status int_status; u32 r_DI_DICMDBUF0; u32 r_DI_DICMDBUF1; u32 r_DI_DICMDBUF2; void *r_DI_DIMAR; u32 r_DI_DILENGTH; u32 r_DI_DICR; void *param; void (*completion_routine)(struct gc_dvd_command *cmd); }; void gc_dvd_request_init(void); int gc_dvd_request_get_data(struct gc_dvd_command **ppcmd); void gc_dvd_request_release_data(struct gc_dvd_command *pcmd); #endif |
From: <pal...@us...> - 2005-04-08 14:39:24
|
Update of /cvsroot/gc-linux/linux/drivers/block In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15523/drivers/block Modified Files: Kconfig Makefile Log Message: Addition of DVD driver since some mods replace the DVD interface with something more interesting (IDE,SATA, etc) Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/Kconfig,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Kconfig 13 Mar 2005 21:53:32 -0000 1.12 +++ Kconfig 8 Apr 2005 14:39:16 -0000 1.13 @@ -61,6 +61,17 @@ To compile this driver as a module, choose M here: the module will be called z2ram. +config GAMECUBE_DVD + tristate "Nintendo Gamecube DVD" + depends on GAMECUBE + help + This enables support for using the mini-DVD drive on the + Nintendo Gamecube. + Say Y if you want to include this driver in the kernel. + + To compile this driver as a module, choose M here: the + module will be called gcn-dvd + config GAMECUBE_ARAM tristate "Nintendo GameCube ARAM" depends on GAMECUBE Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile 4 Jan 2005 21:39:29 -0000 1.10 +++ Makefile 8 Apr 2005 14:39:16 -0000 1.11 @@ -31,6 +31,7 @@ obj-$(CONFIG_GAMECUBE_ARAM) += gcn-aram.o obj-$(CONFIG_GAMECUBE_MEMCARD) += gcn-memcard.o obj-$(CONFIG_GAMECUBE_SD) += gcn-sd.o +obj-$(CONFIG_GAMECUBE_DVD) += gcn-dvd/ obj-$(CONFIG_BLK_DEV_RAM) += rd.o obj-$(CONFIG_BLK_DEV_LOOP) += loop.o obj-$(CONFIG_BLK_DEV_PS2) += ps2esdi.o |
From: <pal...@us...> - 2005-04-08 14:33:25
|
Update of /cvsroot/gc-linux/linux/drivers/block/gcn-dvd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12297/gcn-dvd Log Message: Directory /cvsroot/gc-linux/linux/drivers/block/gcn-dvd added to the repository |
From: <he...@us...> - 2005-03-22 20:39:41
|
Update of /cvsroot/gc-linux/linux/drivers/block In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3454 Modified Files: gcn-aram.c Log Message: Do not accidentally ack AI and DSP interrupts in the ARAM driver. Index: gcn-aram.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-aram.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- gcn-aram.c 20 Mar 2005 22:35:14 -0000 1.6 +++ gcn-aram.c 22 Mar 2005 20:39:14 -0000 1.7 @@ -455,12 +455,16 @@ static void aram_quiesce(struct aram_device *adev) { u16 __iomem *csr_reg = adev->io_base + DSP_CSR; + u16 csr; unsigned long flags; - /* disable ARAM interrupts */ + /* + * Disable ARAM interrupts, but do not accidentally ack non-ARAM ones. + */ spin_lock_irqsave(&adev->io_lock, flags); - writew(readw(csr_reg) & ~DSP_CSR_ARINTMASK, - csr_reg); + csr = readw(csr_reg); + csr &= ~(DSP_CSR_AIDINT | DSP_CSR_DSPINT | DSP_CSR_ARINTMASK); + writew(csr, csr_reg); spin_unlock_irqrestore(&adev->io_lock, flags); /* wait until pending transfers are finished */ @@ -474,6 +478,7 @@ static int aram_init_irq(struct aram_device *adev) { u16 __iomem *csr_reg = adev->io_base + DSP_CSR; + u16 csr; unsigned long flags; int retval; @@ -486,9 +491,15 @@ goto out; } - /* enable ARAM interrupts, and route them to the processor */ + /* + * Enable ARAM interrupts, and route them to the processor. + * As in the other cases, preserve the AI and DSP interrupts. + */ spin_lock_irqsave(&adev->io_lock, flags); - writew(readw(csr_reg) | DSP_CSR_ARINTMASK | DSP_CSR_PIINT, csr_reg); + csr = readw(csr_reg); + csr |= (DSP_CSR_ARINT | DSP_CSR_ARINTMASK | DSP_CSR_PIINT); + csr &= ~(DSP_CSR_AIDINT | DSP_CSR_DSPINT); + writew(csr, csr_reg); spin_unlock_irqrestore(&adev->io_lock, flags); out: |