diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-08-01 10:43:45 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-08-01 10:43:45 +0000 |
commit | 174c7abdff92dbb35ec3524279444913d6e5fbf1 (patch) | |
tree | c0f80edae9b26cdba7733f1c771fba5233129ba6 /firmware | |
parent | abf3435ca724bf6201c663f33c2e4394ae48156d (diff) |
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
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/ata.c | 6 | ||||
-rw-r--r-- | firmware/export/pp5002.h | 10 | ||||
-rw-r--r-- | firmware/export/pp5020.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/ata-target.h | 40 |
4 files changed, 25 insertions, 33 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index e9e567761b..2c8033a533 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -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) diff --git a/firmware/export/pp5002.h b/firmware/export/pp5002.h index 082fc1c9cc..83f8456bf0 100644 --- a/firmware/export/pp5002.h +++ b/firmware/export/pp5002.h @@ -30,13 +30,13 @@ #define IISFIFO_WR (*(volatile unsigned long *)(0xc0002540)) #define IISFIFO_RD (*(volatile unsigned long *)(0xc0002580)) -#define I2C_BASE 0xc0008000 +#define IDE_BASE 0xc0003000 + +#define IDE_CFG_STATUS (*(volatile unsigned long *)(0xc0003024)) -/* The PortalPlayer USB controller uses base address 0xc5000000 */ -#define USB_BASE 0xc5000000 +#define USB_BASE 0xc0005000 -#define USB2D_IDENT (*(volatile unsigned long *)(0xc5000000)) -#define USB_STATUS (*(volatile unsigned long *)(0xc50001a4)) +#define I2C_BASE 0xc0008000 #define GPIOA_ENABLE (*(volatile unsigned char *)(0xcf000000)) #define GPIOB_ENABLE (*(volatile unsigned char *)(0xcf000004)) diff --git a/firmware/export/pp5020.h b/firmware/export/pp5020.h index 873d5c849e..b2c7f4d0d2 100644 --- a/firmware/export/pp5020.h +++ b/firmware/export/pp5020.h @@ -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)) diff --git a/firmware/target/arm/ata-target.h b/firmware/target/arm/ata-target.h index d65a7b2822..f8755c38b3 100644 --- a/firmware/target/arm/ata-target.h +++ b/firmware/target/arm/ata-target.h @@ -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 |