Skip to content

Commit

Permalink
m68knommu: fix wrong register offsets used for ColdFire 5272 multi-fu…
Browse files Browse the repository at this point in the history
…nction pins

The registers used to configure and set the multifunction pins on the 5272
ColdFire are defined as absolute addresses. So the use of them does not need
to be offset relative to the peripheral region address.

Fix two cases of incorrect usage of these addresses. Both affect UART
initialization, one in the common UART pin setup code, the other in the
NETtel board specific UART signal handling.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
  • Loading branch information
Greg Ungerer committed Sep 27, 2012
1 parent 041a89a commit 4fb62ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
9 changes: 3 additions & 6 deletions arch/m68k/include/asm/nettel.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#ifdef CONFIG_COLDFIRE
#include <asm/coldfire.h>
#include <asm/mcfsim.h>
#include <asm/io.h>
#endif

/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -86,16 +87,12 @@ static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)
*/
static __inline__ unsigned int mcf_getppdata(void)
{
volatile unsigned short *pp;
pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDAT);
return((unsigned int) *pp);
return readw(MCFSIM_PBDAT);
}

static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)
{
volatile unsigned short *pp;
pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDAT);
*pp = (*pp & ~mask) | bits;
write((readw(MCFSIM_PBDAT) & ~mask) | bits, MCFSIM_PBDAT);
}
#endif

Expand Down
8 changes: 4 additions & 4 deletions arch/m68k/platform/coldfire/m5272.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ static void __init m5272_uarts_init(void)
u32 v;

/* Enable the output lines for the serial ports */
v = readl(MCF_MBAR + MCFSIM_PBCNT);
v = readl(MCFSIM_PBCNT);
v = (v & ~0x000000ff) | 0x00000055;
writel(v, MCF_MBAR + MCFSIM_PBCNT);
writel(v, MCFSIM_PBCNT);

v = readl(MCF_MBAR + MCFSIM_PDCNT);
v = readl(MCFSIM_PDCNT);
v = (v & ~0x000003fc) | 0x000002a8;
writel(v, MCF_MBAR + MCFSIM_PDCNT);
writel(v, MCFSIM_PDCNT);
}

/***************************************************************************/
Expand Down

0 comments on commit 4fb62ed

Please sign in to comment.