Skip to content

Commit

Permalink
ARM: pxa: fix mfpr_sync to read from valid offset
Browse files Browse the repository at this point in the history
Since mfpr_mmio_base[0] is not always valid on later SoCs,
fixed mpfr_sync() to read back from valid mfp offset always.

Signed-off-by: Yu Tang <ytang5@marvell.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
  • Loading branch information
Yu Tang authored and Eric Miao committed Feb 9, 2011
1 parent 100b33c commit 0c7fbbe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arch/arm/plat-pxa/mfp.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@ static const unsigned long mfpr_edge[] = {
#define mfp_configured(p) ((p)->config != -1)

/*
* perform a read-back of any MFPR register to make sure the
* perform a read-back of any valid MFPR register to make sure the
* previous writings are finished
*/
#define mfpr_sync() (void)__raw_readl(mfpr_mmio_base + 0)
static unsigned long mfpr_off_readback;
#define mfpr_sync() (void)__raw_readl(mfpr_mmio_base + mfpr_off_readback)

static inline void __mfp_config_run(struct mfp_pin *p)
{
Expand Down Expand Up @@ -248,6 +249,9 @@ void __init mfp_init_addr(struct mfp_addr_map *map)

spin_lock_irqsave(&mfp_spin_lock, flags);

/* mfp offset for readback */
mfpr_off_readback = map[0].offset;

for (p = map; p->start != MFP_PIN_INVALID; p++) {
offset = p->offset;
i = p->start;
Expand Down

0 comments on commit 0c7fbbe

Please sign in to comment.