3 * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
5 * (C) Copyright 2000-2011
6 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
8 * See file CREDITS for list of people who contributed to this
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of
14 * the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 #define EIEIO __asm__ volatile ("eieio")
32 #define SYNC __asm__ volatile ("sync")
34 void ide_input_swap_data(int dev, ulong *sect_buf, int words)
37 volatile uchar *pbuf_even =
38 (uchar *) (ATA_CURR_BASE(dev) + ATA_DATA_EVEN);
39 volatile uchar *pbuf_odd =
40 (uchar *) (ATA_CURR_BASE(dev) + ATA_DATA_ODD);
41 ushort *dbuf = (ushort *) sect_buf;
44 for (i = 0; i < 2; i++) {
45 *(((uchar *) (dbuf)) + 1) = *pbuf_even;
46 *(uchar *) dbuf = *pbuf_odd;
52 void ide_input_data(int dev, ulong *sect_buf, int words)
55 volatile uchar *pbuf_even;
56 volatile uchar *pbuf_odd;
58 pbuf_even = (uchar *) (ATA_CURR_BASE(dev) + ATA_DATA_EVEN);
59 pbuf_odd = (uchar *) (ATA_CURR_BASE(dev) + ATA_DATA_ODD);
60 dbuf = (uchar *) sect_buf;
77 void ide_input_data_shorts(int dev, ushort *sect_buf, int shorts)
80 volatile uchar *pbuf_even;
81 volatile uchar *pbuf_odd;
83 pbuf_even = (uchar *) (ATA_CURR_BASE(dev) + ATA_DATA_EVEN);
84 pbuf_odd = (uchar *) (ATA_CURR_BASE(dev) + ATA_DATA_ODD);
85 dbuf = (uchar *) sect_buf;
94 void ide_output_data(int dev, const ulong *sect_buf, int words)
97 volatile uchar *pbuf_even;
98 volatile uchar *pbuf_odd;
100 pbuf_even = (uchar *) (ATA_CURR_BASE(dev) + ATA_DATA_EVEN);
101 pbuf_odd = (uchar *) (ATA_CURR_BASE(dev) + ATA_DATA_ODD);
102 dbuf = (uchar *) sect_buf;
105 *pbuf_even = *dbuf++;
109 *pbuf_even = *dbuf++;
115 void ide_output_data_shorts(int dev, ushort *sect_buf, int shorts)
118 volatile uchar *pbuf_even;
119 volatile uchar *pbuf_odd;
121 pbuf_even = (uchar *) (ATA_CURR_BASE(dev) + ATA_DATA_EVEN);
122 pbuf_odd = (uchar *) (ATA_CURR_BASE(dev) + ATA_DATA_ODD);
123 dbuf = (uchar *) sect_buf;
126 *pbuf_even = *dbuf++;