forked from Imagelibrary/rtems
bsp/gen5200: Use busy wait
The usage of rtems_task_wake_after() is invalid during the driver initialization.
This commit is contained in:
@@ -19,6 +19,8 @@
|
|||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
#include <bsp/mpc5200.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)
|
bool ata_execute_io_command(uint8_t command, uint32_t lba, uint32_t sector_count_32)
|
||||||
{
|
{
|
||||||
assert(sector_count_32 >= 1);
|
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)
|
void ata_reset_device(void)
|
||||||
{
|
{
|
||||||
|
/* ATA/ATAPI-7 V2, 11.2 Software reset protocol */
|
||||||
ATA->write.control = DCTRL_SRST;
|
ATA->write.control = DCTRL_SRST;
|
||||||
rtems_task_wake_after(1);
|
rtems_bsp_delay(5);
|
||||||
ATA->write.control = 0;
|
ATA->write.control = 0;
|
||||||
rtems_task_wake_after(RTEMS_MILLISECONDS_TO_TICKS(2));
|
rtems_bsp_delay(2000);
|
||||||
ata_wait_for_not_busy();
|
ata_wait_for_not_busy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ static inline void ata_flush_sector(uint16_t *begin)
|
|||||||
rtems_cache_flush_multiple_data_lines(begin, ATA_SECTOR_SIZE);
|
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);
|
bool ata_set_transfer_mode(uint8_t mode);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user