diff options
author | Pavel Herrmann <morpheus.ibis@gmail.com> | 2012-10-07 05:56:13 +0000 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2012-10-17 07:59:09 -0700 |
commit | 21d2bf426f15f4f2f184e9f4afcc279feeeba854 (patch) | |
tree | 9eaf02cf460d54f0c6f94dd84be4b41730c758ae /board/pcs440ep | |
parent | 4d1361d86773fce10352bd35729ce74036d5acb0 (diff) | |
download | u-boot-21d2bf426f15f4f2f184e9f4afcc279feeeba854.zip u-boot-21d2bf426f15f4f2f184e9f4afcc279feeeba854.tar.gz u-boot-21d2bf426f15f4f2f184e9f4afcc279feeeba854.tar.bz2 |
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>
Diffstat (limited to 'board/pcs440ep')
-rw-r--r-- | board/pcs440ep/pcs440ep.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/board/pcs440ep/pcs440ep.c b/board/pcs440ep/pcs440ep.c index 52da053..f8345dd 100644 --- a/board/pcs440ep/pcs440ep.c +++ b/board/pcs440ep/pcs440ep.c @@ -32,6 +32,7 @@ #include <sha1.h> #include <asm/io.h> #include <net.h> +#include <ata.h> DECLARE_GLOBAL_DATA_PTR; @@ -713,3 +714,58 @@ void ide_set_reset (int idereset) udelay (10000); } #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 |