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.
13 #include <asm/blackfin.h>
14 #include "bf533-stamp.h"
16 void cf_outb(unsigned char val, volatile unsigned char *addr)
18 /* "ETHERNET" means the expansion memory banks */
27 unsigned char cf_inb(volatile unsigned char *addr)
41 void cf_insw(unsigned short *sect_buf, unsigned short *addr, int words)
47 for (i = 0; i < words; i++) {
48 *(sect_buf + i) = *addr;
55 void cf_outsw(unsigned short *addr, unsigned short *sect_buf, int words)
61 for (i = 0; i < words; i++) {
62 *addr = *(sect_buf + i);
69 void cf_ide_init(void)
73 /* Check whether CF card is inserted */
74 bfin_write_FIO_EDGE(FIO_EDGE_CF_BITS);
75 bfin_write_FIO_POLAR(FIO_POLAR_CF_BITS);
76 for (i = 0; i < 0x300; i++)
79 cf_stat = bfin_read_FIO_FLAG_S() & CF_STAT_BITS;
81 bfin_write_FIO_EDGE(FIO_EDGE_BITS);
82 bfin_write_FIO_POLAR(FIO_POLAR_BITS);
85 for (i = 0; i < 0x3000; i++)