summaryrefslogtreecommitdiff
path: root/doc/README.power-framework
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2019-05-02 16:53:38 +0200
committerStefan Roese <sr@denx.de>2019-05-03 08:14:39 +0200
commitd50e29662f78be5e0843ce1e0c5d818b6a74cc98 (patch)
tree469b26b73c4d61a4b7296742a00dcf726cc8c98f /doc/README.power-framework
parent539f0242f3c6398fe13cbbd584c23dc6cfb4ba04 (diff)
i2c: mvtwsi: fix reading status register after interrupt
The twsi_wait function reads the control register for interrupt flag, and if interrupt flag is present, it immediately reads status register. On our device this sometimes causes bad value being read from status register, as if the value was not yet updated. My theory is that the controller does approximately this: 1. sets interrupt flag in control register, 2. sets the value of status register, 3. causes an interrupt In U-Boot we do not use interrupts, so I think that it is possible that sometimes the status register in the twsi_wait function is read between points 1 and 2. The bug does not appear if I add a small delay before reading status register. Wait 100ns (which in U-Boot currently means 1 us, because ndelay(i) function calls udelay(DIV_ROUND_UP(i, 1000))) before reading the status register. Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Heiko Schocher <hs@denx.de> Reviewed-by: Stefan Roese <sr@denx.de> Cc: Mario Six <mario.six@gdsys.cc> Cc: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'doc/README.power-framework')
0 files changed, 0 insertions, 0 deletions