Get rid of ages-old interdependency between ata.c and mas.c

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11519 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2006-11-12 14:17:49 +00:00
parent 7b30e50812
commit 8c3f0681b2
3 changed files with 9 additions and 14 deletions

View file

@ -124,7 +124,6 @@ int ata_io_address; /* 0x300 or 0x200, only valid on recorder */
static volatile unsigned char* ata_control; static volatile unsigned char* ata_control;
#endif #endif
bool old_recorder = false;
int ata_spinup_time = 0; int ata_spinup_time = 0;
#if CONFIG_LED == LED_REAL #if CONFIG_LED == LED_REAL
static bool ata_led_enabled = true; static bool ata_led_enabled = true;
@ -1415,13 +1414,11 @@ static void io_address_detect(void)
if (read_hw_mask() & ATA_ADDRESS_200) if (read_hw_mask() & ATA_ADDRESS_200)
{ {
ata_io_address = 0x200; /* For debug purposes only */ ata_io_address = 0x200; /* For debug purposes only */
old_recorder = false;
ata_control = ATA_CONTROL1; ata_control = ATA_CONTROL1;
} }
else else
{ {
ata_io_address = 0x300; /* For debug purposes only */ ata_io_address = 0x300; /* For debug purposes only */
old_recorder = true;
ata_control = ATA_CONTROL2; ata_control = ATA_CONTROL2;
} }
} }

View file

@ -83,7 +83,6 @@
#define DT_STOP_TRAN 0xfd #define DT_STOP_TRAN 0xfd
/* for compatibility */ /* for compatibility */
bool old_recorder = false; /* FIXME: get rid of this cross-dependency */
int ata_spinup_time = 0; int ata_spinup_time = 0;
long last_disk_activity = -1; long last_disk_activity = -1;

View file

@ -24,8 +24,7 @@
#include "mas.h" #include "mas.h"
#include "kernel.h" #include "kernel.h"
#include "system.h" #include "system.h"
#include "hwcompat.h"
extern bool old_recorder;
static int mas_devread(unsigned long *dest, int len); static int mas_devread(unsigned long *dest, int len);
@ -287,7 +286,14 @@ void mas_reset(void)
or_b(0x01, &PADRH); or_b(0x01, &PADRH);
sleep(HZ/5); sleep(HZ/5);
#elif (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) #elif (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
if(old_recorder) if (read_hw_mask() & ATA_ADDRESS_200)
{
and_b(~0x01, &PADRH);
sleep(HZ/100);
or_b(0x01, &PADRH);
sleep(HZ/5);
}
else
{ {
/* Older recorder models don't invert the POR signal */ /* Older recorder models don't invert the POR signal */
or_b(0x01, &PADRH); or_b(0x01, &PADRH);
@ -295,13 +301,6 @@ void mas_reset(void)
and_b(~0x01, &PADRH); and_b(~0x01, &PADRH);
sleep(HZ/5); sleep(HZ/5);
} }
else
{
and_b(~0x01, &PADRH);
sleep(HZ/100);
or_b(0x01, &PADRH);
sleep(HZ/5);
}
#endif #endif
} }