split PCS440EP specific code from cmd_ide.c
Move specific ide_input_data and friends to board-specific file. Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
This commit is contained in:
parent
4d1361d867
commit
21d2bf426f
|
@ -32,6 +32,7 @@
|
||||||
#include <sha1.h>
|
#include <sha1.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
|
#include <ata.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
@ -713,3 +714,58 @@ void ide_set_reset (int idereset)
|
||||||
udelay (10000);
|
udelay (10000);
|
||||||
}
|
}
|
||||||
#endif /* defined (CONFIG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
|
#endif /* defined (CONFIG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
|
||||||
|
|
||||||
|
|
||||||
|
/* this is motly the same as it should, causing a little code duplication */
|
||||||
|
#if defined(CONFIG_CMD_IDE)
|
||||||
|
#define EIEIO __asm__ volatile ("eieio")
|
||||||
|
|
||||||
|
void ide_input_swap_data(int dev, ulong *sect_buf, int words)
|
||||||
|
{
|
||||||
|
volatile ushort *pbuf =
|
||||||
|
(ushort *) (ATA_CURR_BASE(dev) + ATA_DATA_REG);
|
||||||
|
ushort *dbuf = (ushort *) sect_buf;
|
||||||
|
|
||||||
|
debug("in input swap data base for read is %lx\n",
|
||||||
|
(unsigned long) pbuf);
|
||||||
|
|
||||||
|
while (words--) {
|
||||||
|
*dbuf++ = *pbuf;
|
||||||
|
*dbuf++ = *pbuf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ide_output_data(int dev, const ulong *sect_buf, int words)
|
||||||
|
{
|
||||||
|
ushort *dbuf;
|
||||||
|
volatile ushort *pbuf;
|
||||||
|
|
||||||
|
pbuf = (ushort *) (ATA_CURR_BASE(dev) + ATA_DATA_REG);
|
||||||
|
dbuf = (ushort *) sect_buf;
|
||||||
|
while (words--) {
|
||||||
|
EIEIO;
|
||||||
|
*pbuf = ld_le16(dbuf++);
|
||||||
|
EIEIO;
|
||||||
|
*pbuf = ld_le16(dbuf++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ide_input_data(int dev, ulong *sect_buf, int words)
|
||||||
|
{
|
||||||
|
ushort *dbuf;
|
||||||
|
volatile ushort *pbuf;
|
||||||
|
|
||||||
|
pbuf = (ushort *) (ATA_CURR_BASE(dev) + ATA_DATA_REG);
|
||||||
|
dbuf = (ushort *) sect_buf;
|
||||||
|
|
||||||
|
debug("in input data base for read is %lx\n", (unsigned long) pbuf);
|
||||||
|
|
||||||
|
while (words--) {
|
||||||
|
EIEIO;
|
||||||
|
*dbuf++ = ld_le16(pbuf);
|
||||||
|
EIEIO;
|
||||||
|
*dbuf++ = ld_le16(pbuf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -522,9 +522,6 @@ void __ide_input_swap_data(int dev, ulong *sect_buf, int words)
|
||||||
#ifdef __MIPS__
|
#ifdef __MIPS__
|
||||||
*dbuf++ = swab16p((u16 *) pbuf);
|
*dbuf++ = swab16p((u16 *) pbuf);
|
||||||
*dbuf++ = swab16p((u16 *) pbuf);
|
*dbuf++ = swab16p((u16 *) pbuf);
|
||||||
#elif defined(CONFIG_PCS440EP)
|
|
||||||
*dbuf++ = *pbuf;
|
|
||||||
*dbuf++ = *pbuf;
|
|
||||||
#else
|
#else
|
||||||
*dbuf++ = ld_le16(pbuf);
|
*dbuf++ = ld_le16(pbuf);
|
||||||
*dbuf++ = ld_le16(pbuf);
|
*dbuf++ = ld_le16(pbuf);
|
||||||
|
@ -543,18 +540,10 @@ void __ide_output_data(int dev, const ulong *sect_buf, int words)
|
||||||
pbuf = (ushort *) (ATA_CURR_BASE(dev) + ATA_DATA_REG);
|
pbuf = (ushort *) (ATA_CURR_BASE(dev) + ATA_DATA_REG);
|
||||||
dbuf = (ushort *) sect_buf;
|
dbuf = (ushort *) sect_buf;
|
||||||
while (words--) {
|
while (words--) {
|
||||||
#if defined(CONFIG_PCS440EP)
|
|
||||||
/* not tested, because CF was write protected */
|
|
||||||
EIEIO;
|
|
||||||
*pbuf = ld_le16(dbuf++);
|
|
||||||
EIEIO;
|
|
||||||
*pbuf = ld_le16(dbuf++);
|
|
||||||
#else
|
|
||||||
EIEIO;
|
EIEIO;
|
||||||
*pbuf = *dbuf++;
|
*pbuf = *dbuf++;
|
||||||
EIEIO;
|
EIEIO;
|
||||||
*pbuf = *dbuf++;
|
*pbuf = *dbuf++;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else /* ! CONFIG_IDE_SWAP_IO */
|
#else /* ! CONFIG_IDE_SWAP_IO */
|
||||||
|
@ -580,17 +569,10 @@ void __ide_input_data(int dev, ulong *sect_buf, int words)
|
||||||
debug("in input data base for read is %lx\n", (unsigned long) pbuf);
|
debug("in input data base for read is %lx\n", (unsigned long) pbuf);
|
||||||
|
|
||||||
while (words--) {
|
while (words--) {
|
||||||
#if defined(CONFIG_PCS440EP)
|
|
||||||
EIEIO;
|
|
||||||
*dbuf++ = ld_le16(pbuf);
|
|
||||||
EIEIO;
|
|
||||||
*dbuf++ = ld_le16(pbuf);
|
|
||||||
#else
|
|
||||||
EIEIO;
|
EIEIO;
|
||||||
*dbuf++ = *pbuf;
|
*dbuf++ = *pbuf;
|
||||||
EIEIO;
|
EIEIO;
|
||||||
*dbuf++ = *pbuf;
|
*dbuf++ = *pbuf;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else /* ! CONFIG_IDE_SWAP_IO */
|
#else /* ! CONFIG_IDE_SWAP_IO */
|
||||||
|
|
Loading…
Reference in New Issue