diff options
author | Scott McNutt <smcnutt@psyent.com> | 2010-03-21 21:24:43 -0400 |
---|---|---|
committer | Scott McNutt <smcnutt@psyent.com> | 2010-04-02 12:28:41 -0400 |
commit | 3ea0037f2337de692b5fd2b6a4449db1de3067a2 (patch) | |
tree | dc79b32082081baa60f5ef8e43ca774814e5eeba /cpu | |
parent | 64da04d24ea685483f9afa07088f76931b6c0e01 (diff) | |
download | u-boot-3ea0037f2337de692b5fd2b6a4449db1de3067a2.tar.gz u-boot-3ea0037f2337de692b5fd2b6a4449db1de3067a2.tar.xz u-boot-3ea0037f2337de692b5fd2b6a4449db1de3067a2.zip |
nios2: Fix outx/writex parameter order in io.h
The outx/writex macros were using writex(addr, val) rather than
the standard writex(val, addr), resulting in incompatibilty with
architecture independent components. This change set uses standard
parameter order.
Signed-off-by: Scott McNutt <smcnutt@psyent.com>
Diffstat (limited to 'cpu')
-rw-r--r-- | cpu/nios2/epcs.c | 6 | ||||
-rw-r--r-- | cpu/nios2/interrupts.c | 16 |
2 files changed, 11 insertions, 11 deletions
diff --git a/cpu/nios2/epcs.c b/cpu/nios2/epcs.c index a2e3fe3d16..ab7d746b5f 100644 --- a/cpu/nios2/epcs.c +++ b/cpu/nios2/epcs.c @@ -85,7 +85,7 @@ static int epcs_cs (int assert) if (assert) { tmp = readl (&epcs->control); - writel (&epcs->control, tmp | NIOS_SPI_SSO); + writel (tmp | NIOS_SPI_SSO, &epcs->control); } else { /* Let all bits shift out */ start = get_timer (0); @@ -93,7 +93,7 @@ static int epcs_cs (int assert) if (get_timer (start) > EPCS_TIMEOUT) return (-1); tmp = readl (&epcs->control); - writel (&epcs->control, tmp & ~NIOS_SPI_SSO); + writel (tmp & ~NIOS_SPI_SSO, &epcs->control); } return (0); } @@ -106,7 +106,7 @@ static int epcs_tx (unsigned char c) while ((readl (&epcs->status) & NIOS_SPI_TRDY) == 0) if (get_timer (start) > EPCS_TIMEOUT) return (-1); - writel (&epcs->txdata, c); + writel (c, &epcs->txdata); return (0); } diff --git a/cpu/nios2/interrupts.c b/cpu/nios2/interrupts.c index 1c3566ebf9..5c3b5e6146 100644 --- a/cpu/nios2/interrupts.c +++ b/cpu/nios2/interrupts.c @@ -81,7 +81,7 @@ void tmr_isr (void *arg) /* Interrupt is cleared by writing anything to the * status register. */ - writel (&tmr->status, 0); + writel (0, &tmr->status); timestamp += CONFIG_SYS_NIOS_TMRMS; #ifdef CONFIG_STATUS_LED status_led_tick(timestamp); @@ -92,16 +92,16 @@ static void tmr_init (void) { nios_timer_t *tmr =(nios_timer_t *)CONFIG_SYS_NIOS_TMRBASE; - writel (&tmr->status, 0); - writel (&tmr->control, 0); - writel (&tmr->control, NIOS_TIMER_STOP); + writel (0, &tmr->status); + writel (0, &tmr->control); + writel (NIOS_TIMER_STOP, &tmr->control); #if defined(CONFIG_SYS_NIOS_TMRCNT) - writel (&tmr->periodl, CONFIG_SYS_NIOS_TMRCNT & 0xffff); - writel (&tmr->periodh, (CONFIG_SYS_NIOS_TMRCNT >> 16) & 0xffff); + writel (CONFIG_SYS_NIOS_TMRCNT & 0xffff, &tmr->periodl); + writel ((CONFIG_SYS_NIOS_TMRCNT >> 16) & 0xffff, &tmr->periodh); #endif - writel (&tmr->control, NIOS_TIMER_ITO | NIOS_TIMER_CONT | - NIOS_TIMER_START ); + writel (NIOS_TIMER_ITO | NIOS_TIMER_CONT | NIOS_TIMER_START, + &tmr->control); irq_install_handler (CONFIG_SYS_NIOS_TMRIRQ, tmr_isr, (void *)tmr); } |