Add some new findings to the PP header files. * Clean up ata-target.h for PP. * check_registers() seems to work fine on PP5002.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14114 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
abf3435ca7
commit
174c7abdff
4 changed files with 26 additions and 34 deletions
|
@ -715,11 +715,6 @@ int ata_write_sectors(IF_MV2(int drive,)
|
|||
|
||||
static int check_registers(void)
|
||||
{
|
||||
#if (CONFIG_CPU == PP5002)
|
||||
/* This fails on the PP5002, but the ATA driver still works. This
|
||||
needs more investigation. */
|
||||
return 0;
|
||||
#else
|
||||
int i;
|
||||
if ( ATA_STATUS & STATUS_BSY )
|
||||
return -1;
|
||||
|
@ -737,7 +732,6 @@ static int check_registers(void)
|
|||
return 0;
|
||||
}
|
||||
return -2;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int freeze_lock(void)
|
||||
|
|
|
@ -30,14 +30,14 @@
|
|||
#define IISFIFO_WR (*(volatile unsigned long *)(0xc0002540))
|
||||
#define IISFIFO_RD (*(volatile unsigned long *)(0xc0002580))
|
||||
|
||||
#define IDE_BASE 0xc0003000
|
||||
|
||||
#define IDE_CFG_STATUS (*(volatile unsigned long *)(0xc0003024))
|
||||
|
||||
#define USB_BASE 0xc0005000
|
||||
|
||||
#define I2C_BASE 0xc0008000
|
||||
|
||||
/* The PortalPlayer USB controller uses base address 0xc5000000 */
|
||||
#define USB_BASE 0xc5000000
|
||||
|
||||
#define USB2D_IDENT (*(volatile unsigned long *)(0xc5000000))
|
||||
#define USB_STATUS (*(volatile unsigned long *)(0xc50001a4))
|
||||
|
||||
#define GPIOA_ENABLE (*(volatile unsigned char *)(0xcf000000))
|
||||
#define GPIOB_ENABLE (*(volatile unsigned char *)(0xcf000004))
|
||||
#define GPIOC_ENABLE (*(volatile unsigned char *)(0xcf000008))
|
||||
|
|
|
@ -299,6 +299,8 @@
|
|||
#define I2C_BASE 0x7000c000
|
||||
|
||||
/* EIDE Controller */
|
||||
#define IDE_BASE 0xc3000000
|
||||
|
||||
#define IDE0_PRI_TIMING0 (*(volatile unsigned long*)(0xc3000000))
|
||||
#define IDE0_PRI_TIMING1 (*(volatile unsigned long*)(0xc3000004))
|
||||
#define IDE0_SEC_TIMING0 (*(volatile unsigned long*)(0xc3000008))
|
||||
|
|
|
@ -23,9 +23,6 @@
|
|||
|
||||
/* Plain C reading and writing. See comment in ata-as-arm.S */
|
||||
|
||||
#define ATA_IOBASE 0xc00031e0
|
||||
#define ATA_CONTROL (*((volatile unsigned char*)(0xc00033f8)))
|
||||
|
||||
#elif defined CPU_PP502x
|
||||
|
||||
/* asm optimized reading and writing */
|
||||
|
@ -34,19 +31,18 @@
|
|||
void copy_read_sectors(unsigned char* buf, int wordcount);
|
||||
void copy_write_sectors(const unsigned char* buf, int wordcount);
|
||||
|
||||
#define ATA_IOBASE 0xc30001e0
|
||||
#define ATA_CONTROL (*((volatile unsigned char*)(0xc30003f8)))
|
||||
|
||||
#endif /* CONFIG_CPU */
|
||||
|
||||
#define ATA_DATA (*((volatile unsigned short*)(ATA_IOBASE)))
|
||||
#define ATA_ERROR (*((volatile unsigned char*)(ATA_IOBASE + 0x04)))
|
||||
#define ATA_NSECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x08)))
|
||||
#define ATA_SECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x0c)))
|
||||
#define ATA_LCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x10)))
|
||||
#define ATA_HCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x14)))
|
||||
#define ATA_SELECT (*((volatile unsigned char*)(ATA_IOBASE + 0x18)))
|
||||
#define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x1c)))
|
||||
/* primary channel */
|
||||
#define ATA_DATA (*((volatile unsigned short*)(IDE_BASE + 0x1e0)))
|
||||
#define ATA_ERROR (*((volatile unsigned char*)(IDE_BASE + 0x1e4)))
|
||||
#define ATA_NSECTOR (*((volatile unsigned char*)(IDE_BASE + 0x1e8)))
|
||||
#define ATA_SECTOR (*((volatile unsigned char*)(IDE_BASE + 0x1ec)))
|
||||
#define ATA_LCYL (*((volatile unsigned char*)(IDE_BASE + 0x1f0)))
|
||||
#define ATA_HCYL (*((volatile unsigned char*)(IDE_BASE + 0x1f4)))
|
||||
#define ATA_SELECT (*((volatile unsigned char*)(IDE_BASE + 0x1f8)))
|
||||
#define ATA_COMMAND (*((volatile unsigned char*)(IDE_BASE + 0x1fc)))
|
||||
#define ATA_CONTROL (*((volatile unsigned char*)(IDE_BASE + 0x3f8)))
|
||||
|
||||
#define STATUS_BSY 0x80
|
||||
#define STATUS_RDY 0x40
|
||||
|
@ -55,15 +51,15 @@ void copy_write_sectors(const unsigned char* buf, int wordcount);
|
|||
#define STATUS_ERR 0x01
|
||||
#define ERROR_ABRT 0x04
|
||||
|
||||
#define WRITE_PATTERN1 0xa5
|
||||
#define WRITE_PATTERN2 0x5a
|
||||
#define WRITE_PATTERN3 0xaa
|
||||
#define WRITE_PATTERN4 0x55
|
||||
#define WRITE_PATTERN1 0xa5
|
||||
#define WRITE_PATTERN2 0x5a
|
||||
#define WRITE_PATTERN3 0xaa
|
||||
#define WRITE_PATTERN4 0x55
|
||||
|
||||
#define READ_PATTERN1 0xa5
|
||||
#define READ_PATTERN2 0x5a
|
||||
#define READ_PATTERN3 0xaa
|
||||
#define READ_PATTERN4 0x55
|
||||
#define READ_PATTERN1 0xa5
|
||||
#define READ_PATTERN2 0x5a
|
||||
#define READ_PATTERN3 0xaa
|
||||
#define READ_PATTERN4 0x55
|
||||
|
||||
#define READ_PATTERN1_MASK 0xff
|
||||
#define READ_PATTERN2_MASK 0xff
|
||||
|
|
Loading…
Reference in a new issue