summaryrefslogtreecommitdiff
path: root/firmware/drivers/ata.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r--firmware/drivers/ata.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 1e889a3339..4ba5829f56 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -33,7 +33,7 @@
33/* skip whole file for an MMC-based system, FIXME in makefile */ 33/* skip whole file for an MMC-based system, FIXME in makefile */
34#ifndef HAVE_MMC 34#ifndef HAVE_MMC
35 35
36#ifdef HAVE_SCF5249 36#if CONFIG_CPU == SCF5249
37 37
38/* don't use sh7034 assembler routines */ 38/* don't use sh7034 assembler routines */
39#define PREFER_C_READING 39#define PREFER_C_READING
@@ -43,7 +43,7 @@
43#define ATA_DATA (*((volatile unsigned short*)ATA_IOBASE)) 43#define ATA_DATA (*((volatile unsigned short*)ATA_IOBASE))
44#define ATA_CONTROL (*((volatile unsigned short*)ATA_IOBASE + 0xe)) 44#define ATA_CONTROL (*((volatile unsigned short*)ATA_IOBASE + 0xe))
45 45
46#elif defined HAVE_SH7034 46#elif CONFIG_CPU == SH7034
47 47
48#define ATA_IOBASE 0x06100100 48#define ATA_IOBASE 0x06100100
49#define ATA_DATA (*((volatile unsigned short*)0x06104100)) 49#define ATA_DATA (*((volatile unsigned short*)0x06104100))
@@ -879,7 +879,7 @@ int ata_hard_reset(void)
879{ 879{
880 int ret; 880 int ret;
881 881
882#ifdef HAVE_SH7034 882#if CONFIG_CPU == SH7034
883 /* state HRR0 */ 883 /* state HRR0 */
884 and_b(~0x02, &PADRH); /* assert _RESET */ 884 and_b(~0x02, &PADRH); /* assert _RESET */
885 sleep(1); /* > 25us */ 885 sleep(1); /* > 25us */
@@ -979,7 +979,7 @@ static int master_slave_detect(void)
979 return 0; 979 return 0;
980} 980}
981 981
982#ifdef HAVE_SH7034 /* special archos quirk */ 982#if CONFIG_CPU == SH7034 /* special archos quirk */
983static int io_address_detect(void) 983static int io_address_detect(void)
984{ /* now, use the HW mask instead of probing */ 984{ /* now, use the HW mask instead of probing */
985 if (read_hw_mask() & ATA_ADDRESS_200) 985 if (read_hw_mask() & ATA_ADDRESS_200)
@@ -1001,7 +1001,7 @@ static int io_address_detect(void)
1001 1001
1002void ata_enable(bool on) 1002void ata_enable(bool on)
1003{ 1003{
1004#ifdef HAVE_SH7034 1004#if CONFIG_CPU == SH7034
1005 if(on) 1005 if(on)
1006 and_b(~0x80, &PADRL); /* enable ATA */ 1006 and_b(~0x80, &PADRL); /* enable ATA */
1007 else 1007 else
@@ -1129,7 +1129,7 @@ int ata_init(void)
1129 1129
1130 led(false); 1130 led(false);
1131 1131
1132#ifdef HAVE_SH7034 1132#if CONFIG_CPU == SH7034
1133 /* Port A setup */ 1133 /* Port A setup */
1134 or_b(0x02, &PAIORH); /* output for ATA reset */ 1134 or_b(0x02, &PAIORH); /* output for ATA reset */
1135 or_b(0x02, &PADRH); /* release ATA reset */ 1135 or_b(0x02, &PADRH); /* release ATA reset */
@@ -1159,7 +1159,7 @@ int ata_init(void)
1159 if (rc) 1159 if (rc)
1160 return -10 + rc; 1160 return -10 + rc;
1161 1161
1162#ifdef HAVE_SH7034 1162#if CONFIG_CPU == SH7034
1163 rc = io_address_detect(); 1163 rc = io_address_detect();
1164 if (rc) 1164 if (rc)
1165 return -20 + rc; 1165 return -20 + rc;