diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-03-28 09:25:07 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-03-28 09:25:07 +0100 |
commit | aa11df6e89ae807e377c760c2b5117738e1bdbdb (patch) | |
tree | dc6abc447736dc185d9defb02e1ffd1c6dc59953 /c/src/lib/libbsp/powerpc/gen5200 | |
parent | bsp/gen5200: Use fatal error instead of assert (diff) | |
download | rtems-aa11df6e89ae807e377c760c2b5117738e1bdbdb.tar.bz2 |
bsp/gen5200: Use busy wait
The usage of rtems_task_wake_after() is invalid during the
driver initialization.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/gen5200')
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen5200/ide/ata.c | 7 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen5200/include/ata.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/c/src/lib/libbsp/powerpc/gen5200/ide/ata.c b/c/src/lib/libbsp/powerpc/gen5200/ide/ata.c index 88150928f2..2706f1db56 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/ide/ata.c +++ b/c/src/lib/libbsp/powerpc/gen5200/ide/ata.c @@ -19,6 +19,8 @@ #include <bsp.h> #include <bsp/mpc5200.h> +#include <libcpu/powerpc-utility.h> + bool ata_execute_io_command(uint8_t command, uint32_t lba, uint32_t sector_count_32) { assert(sector_count_32 >= 1); @@ -68,10 +70,11 @@ bool ata_execute_io_command(uint8_t command, uint32_t lba, uint32_t sector_count void ata_reset_device(void) { + /* ATA/ATAPI-7 V2, 11.2 Software reset protocol */ ATA->write.control = DCTRL_SRST; - rtems_task_wake_after(1); + rtems_bsp_delay(5); ATA->write.control = 0; - rtems_task_wake_after(RTEMS_MILLISECONDS_TO_TICKS(2)); + rtems_bsp_delay(2000); ata_wait_for_not_busy(); } diff --git a/c/src/lib/libbsp/powerpc/gen5200/include/ata.h b/c/src/lib/libbsp/powerpc/gen5200/include/ata.h index 38cd536af0..5693e35d75 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/include/ata.h +++ b/c/src/lib/libbsp/powerpc/gen5200/include/ata.h @@ -176,7 +176,7 @@ static inline void ata_flush_sector(uint16_t *begin) rtems_cache_flush_multiple_data_lines(begin, ATA_SECTOR_SIZE); } -void ata_reset_device(); +void ata_reset_device(void); bool ata_set_transfer_mode(uint8_t mode); |