PP5002 ATA driver needs to wait for the controller to be ready again before writing the next control register value. Makes check_registers() not fail in the bootloader.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14153 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2007-08-03 09:34:42 +00:00
parent 564d249e66
commit 1fbf847eed

View file

@ -19,20 +19,6 @@
#ifdef CPU_PP
#if (CONFIG_CPU == PP5002)
/* Plain C reading and writing. See comment in ata-as-arm.S */
#elif defined CPU_PP502x
/* asm optimized reading and writing */
#define ATA_OPTIMIZED_READING
#define ATA_OPTIMIZED_WRITING
void copy_read_sectors(unsigned char* buf, int wordcount);
void copy_write_sectors(const unsigned char* buf, int wordcount);
#endif /* CONFIG_CPU */
/* primary channel */
#define ATA_DATA (*((volatile unsigned short*)(IDE_BASE + 0x1e0)))
#define ATA_ERROR (*((volatile unsigned char*)(IDE_BASE + 0x1e4)))
@ -66,9 +52,28 @@ void copy_write_sectors(const unsigned char* buf, int wordcount);
#define READ_PATTERN3_MASK 0xff
#define READ_PATTERN4_MASK 0xff
#if (CONFIG_CPU == PP5002)
#define SET_REG(reg,val) do { reg = (val); \
while (!(IDE_CFG_STATUS & 0x40)); \
} while (0)
#define SET_16BITREG(reg,val) reg = (val)
/* Plain C reading and writing. See comment in ata-as-arm.S */
#elif defined CPU_PP502x
#define SET_REG(reg,val) reg = (val)
#define SET_16BITREG(reg,val) reg = (val)
/* asm optimized reading and writing */
#define ATA_OPTIMIZED_READING
#define ATA_OPTIMIZED_WRITING
void copy_read_sectors(unsigned char* buf, int wordcount);
void copy_write_sectors(const unsigned char* buf, int wordcount);
#endif /* CONFIG_CPU */
#endif
void ata_reset(void);