Skip to content

Commit

Permalink
tinyide: fix IDE device detection on boot
Browse files Browse the repository at this point in the history
In my case (SC111 with SC145 and CF), the device signals DRDY before BSY
is 0, which leads to a timeout and failed disk detection. So wait for
BSY to be 0 in addition to DRDY before submitting the identify command.
  • Loading branch information
ra1fh committed Jun 10, 2024
1 parent 238d9b5 commit 41f1865
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Kernel/dev/tinyide_discard.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ static void ide_identify(int dev, uint8_t *buf)
ide_write(cmd, 0xEF);
}
#endif
if (ide_wait_nbusy() == -1)
return;
if (ide_wait_drdy() == -1)
return;
ide_write(cmd, 0xEC); /* Identify */
Expand Down

0 comments on commit 41f1865

Please sign in to comment.