summaryrefslogtreecommitdiff
path: root/cpu/i386/sc520/sc520_ssi.c
diff options
context:
space:
mode:
authorGraeme Russ <graeme.russ@gmail.com>2009-08-23 12:59:56 +1000
committerWolfgang Denk <wd@denx.de>2009-09-04 21:56:45 +0200
commited7a1b681de1e31d18d5b92e2767ae8df3241687 (patch)
tree9ff41a5e184dd262ff56c52a5274f513a380e8e2 /cpu/i386/sc520/sc520_ssi.c
parent9b32f96b5b92ba13fdb4b5eb637734752235f260 (diff)
downloadu-boot-imx-ed7a1b681de1e31d18d5b92e2767ae8df3241687.zip
u-boot-imx-ed7a1b681de1e31d18d5b92e2767ae8df3241687.tar.gz
u-boot-imx-ed7a1b681de1e31d18d5b92e2767ae8df3241687.tar.bz2
i386: Replace [read, write]_mmcr_[byte, word, long] with memory mapped structure
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
Diffstat (limited to 'cpu/i386/sc520/sc520_ssi.c')
-rw-r--r--cpu/i386/sc520/sc520_ssi.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/cpu/i386/sc520/sc520_ssi.c b/cpu/i386/sc520/sc520_ssi.c
index dd667ca..8dbe17a 100644
--- a/cpu/i386/sc520/sc520_ssi.c
+++ b/cpu/i386/sc520/sc520_ssi.c
@@ -61,32 +61,34 @@ int ssi_set_interface(int freq, int lsb_first, int inv_clock, int inv_phase)
temp |= PHS_INV_ENB;
}
- write_mmcr_byte(SC520_SSICTL, temp);
+ sc520_mmcr->ssictl = temp;
return 0;
}
u8 ssi_txrx_byte(u8 data)
{
- write_mmcr_byte(SC520_SSIXMIT, data);
- while ((read_mmcr_byte(SC520_SSISTA)) & SSISTA_BSY);
- write_mmcr_byte(SC520_SSICMD, SSICMD_CMD_SEL_XMITRCV);
- while ((read_mmcr_byte(SC520_SSISTA)) & SSISTA_BSY);
- return read_mmcr_byte(SC520_SSIRCV);
+ sc520_mmcr->ssixmit = data;
+ while (sc520_mmcr->ssista & SSISTA_BSY);
+ sc520_mmcr->ssicmd = SSICMD_CMD_SEL_XMITRCV;
+ while (sc520_mmcr->ssista & SSISTA_BSY);
+
+ return sc520_mmcr->ssircv;
}
void ssi_tx_byte(u8 data)
{
- write_mmcr_byte(SC520_SSIXMIT, data);
- while ((read_mmcr_byte(SC520_SSISTA)) & SSISTA_BSY);
- write_mmcr_byte(SC520_SSICMD, SSICMD_CMD_SEL_XMIT);
+ sc520_mmcr->ssixmit = data;
+ while (sc520_mmcr->ssista & SSISTA_BSY);
+ sc520_mmcr->ssicmd = SSICMD_CMD_SEL_XMIT;
}
u8 ssi_rx_byte(void)
{
- while ((read_mmcr_byte(SC520_SSISTA)) & SSISTA_BSY);
- write_mmcr_byte(SC520_SSICMD, SSICMD_CMD_SEL_RCV);
- while ((read_mmcr_byte(SC520_SSISTA)) & SSISTA_BSY);
- return read_mmcr_byte(SC520_SSIRCV);
+ while (sc520_mmcr->ssista & SSISTA_BSY);
+ sc520_mmcr->ssicmd = SSICMD_CMD_SEL_RCV;
+ while (sc520_mmcr->ssista & SSISTA_BSY);
+
+ return sc520_mmcr->ssircv;
}