1.1 --- a/test/testide.c Thu Dec 21 10:14:24 2006 +0000
1.2 +++ b/test/testide.c Fri Dec 29 00:23:16 2006 +0000
1.5 - * $Id: testide.c,v 1.4 2006-12-21 10:14:24 nkeynes Exp $
1.6 + * $Id: testide.c,v 1.5 2006-12-29 00:23:16 nkeynes Exp $
1.8 * IDE interface test cases. Covers all (known) IDE registers in the
1.9 * 5F7000 - 5F74FF range including DMA, but does not cover any GD-Rom
1.11 byte_write( IDE_COUNT, 0x0B );
1.12 byte_write( IDE_COMMAND, 0xEF );
1.14 - CHECK_INTRQ_CLEAR();
1.15 CHECK_REGS( post_set_feature_regs );
1.17 /** Set Multi-word DMA mode 2 */
1.25 * Test DMA transfer (using the Inquiry packet comand)
1.27 @@ -477,6 +478,41 @@
1.31 +int test_read_pio()
1.34 + char cmd[12] = {0x30, 0x28, 0, 0x2E, 0x4C, 0, 0, 0, 0, 0, 7, 0 };
1.35 + uint32_t read_pio_ready_regs[] =
1.36 + { IDE_ALTSTATUS, 0x58,
1.42 + IDE_STATUS, 0x58, 0, 0 };
1.44 + if( send_packet_command(cmd) != 0 ) {
1.48 + for( j=0; j<7; j++ ) {
1.49 + CHECK_REGS(read_pio_ready_regs);
1.50 + CHECK_INTRQ_CLEAR();
1.51 + for( i=0; i<0x0800; i+=2 ) {
1.52 + word_read(IDE_DATA); // throw away for now.
1.59 + read_pio_ready_regs[1] = 0x50;
1.60 + read_pio_ready_regs[5] = 0x03;
1.61 + read_pio_ready_regs[13] = 0x50;
1.62 + CHECK_REGS( read_pio_ready_regs );
1.67 * Test interaction of Read CD (0x30) with Status (0x40,1)
1.70 typedef int (*test_func_t)();
1.72 test_func_t test_fns[] = { test_enable, test_reset, test_packet,
1.73 - test_dma, test_dma_abort,
1.74 + test_dma, test_dma_abort, test_read_pio,
1.76 test_status1, NULL };