2
* CF IDE addon card code
4
* Enter bugs at http://blackfin.uclinux.org/
6
* Copyright (c) 2005-2009 Analog Devices Inc.
8
* Licensed under the GPL-2 or later.
14
#include <asm/blackfin.h>
16
void cf_outb(unsigned char val, volatile unsigned char *addr)
22
unsigned char cf_inb(volatile unsigned char *addr)
24
volatile unsigned char c;
32
void cf_insw(unsigned short *sect_buf, unsigned short *addr, int words)
36
for (i = 0; i < words; i++)
37
*(sect_buf + i) = *(addr);
41
void cf_outsw(unsigned short *addr, unsigned short *sect_buf, int words)
45
for (i = 0; i < words; i++)
46
*(addr) = *(sect_buf + i);
50
void cf_ide_init(void)
52
#if defined(CONFIG_BFIN_TRUE_IDE)
53
/* Enable ATASEL when in True IDE mode */
54
printf("Using CF True IDE Mode\n");
55
cf_outb(0, (unsigned char *)CONFIG_CF_ATASEL_ENA);
57
#elif defined(CONFIG_BFIN_CF_IDE)
58
/* Disable ATASEL when we're in Common Memory Mode */
59
printf("Using CF Common Memory Mode\n");
60
cf_outb(0, (unsigned char *)CONFIG_CF_ATASEL_DIS);
62
#elif defined(CONFIG_BFIN_HDD_IDE)
63
printf("Using HDD IDE Mode\n");