From: Sonic Zhang Date: Tue, 15 May 2012 08:20:33 +0000 (+0800) Subject: blackfin: bf60x: twi: work around temporary anomaly 0501001 X-Git-Tag: v3.5-rc1~186^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c41704f509d1649f7ba0815c8d47c9563ff9b107;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git blackfin: bf60x: twi: work around temporary anomaly 0501001 Disable IRQ when reading MMR rcv_data8 and rcv_data16. Signed-off-by: Sonic Zhang Signed-off-by: Bob Liu --- diff --git a/arch/blackfin/include/asm/bfin_twi.h b/arch/blackfin/include/asm/bfin_twi.h index 7209210..87e6007 100644 --- a/arch/blackfin/include/asm/bfin_twi.h +++ b/arch/blackfin/include/asm/bfin_twi.h @@ -83,8 +83,35 @@ DEFINE_TWI_REG(FIFO_CTL, fifo_ctl) DEFINE_TWI_REG(FIFO_STAT, fifo_stat) DEFINE_TWI_REG(XMT_DATA8, xmt_data8) DEFINE_TWI_REG(XMT_DATA16, xmt_data16) +#if !ANOMALY_05001001 DEFINE_TWI_REG(RCV_DATA8, rcv_data8) DEFINE_TWI_REG(RCV_DATA16, rcv_data16) +#else +static inline u16 read_RCV_DATA8(struct bfin_twi_iface *iface) +{ + u16 ret; + unsigned long flags; + + flags = hard_local_irq_save(); + ret = iface->regs_base->rcv_data8; + hard_local_irq_restore(flags); + + return ret; +} + +static inline u16 read_RCV_DATA16(struct bfin_twi_iface *iface) +{ + u16 ret; + unsigned long flags; + + flags = hard_local_irq_save(); + ret = iface->regs_base->rcv_data16; + hard_local_irq_restore(flags); + + return ret; +} +#endif + /* ******************** TWO-WIRE INTERFACE (TWI) MASKS ***********************/ /* TWI_CLKDIV Macros (Use: *pTWI_CLKDIV = CLKLOW(x)|CLKHI(y); ) */