mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-26 06:30:39 +00:00
ARM: bcm283x mbox: Fix send status register
Before we can send a message to the mailbox we have to check that there is space to do so. Therefore we poll the status register. But up to now the wrong status register, the one of mailbox 0, was checked. Fix this by polling the status regiser of mailbox 1. Signed-off-by: Fabian Vogt <fvogt@suse.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> [mb: rename registers and update commit message] Signed-off-by: Matthias Brugger <mbrugger@suse.com>
This commit is contained in:
parent
d39221f33f
commit
49822442ed
2 changed files with 8 additions and 5 deletions
|
@ -46,9 +46,12 @@
|
|||
struct bcm2835_mbox_regs {
|
||||
u32 read;
|
||||
u32 rsvd0[5];
|
||||
u32 status;
|
||||
u32 config;
|
||||
u32 mail0_status;
|
||||
u32 mail0_config;
|
||||
u32 write;
|
||||
u32 rsvd1[5];
|
||||
u32 mail1_status;
|
||||
u32 mail1_config;
|
||||
};
|
||||
|
||||
#define BCM2835_MBOX_STATUS_WR_FULL 0x80000000
|
||||
|
|
|
@ -27,7 +27,7 @@ int bcm2835_mbox_call_raw(u32 chan, u32 send, u32 *recv)
|
|||
/* Drain any stale responses */
|
||||
|
||||
for (;;) {
|
||||
val = readl(®s->status);
|
||||
val = readl(®s->mail0_status);
|
||||
if (val & BCM2835_MBOX_STATUS_RD_EMPTY)
|
||||
break;
|
||||
if (get_timer(0) >= endtime) {
|
||||
|
@ -40,7 +40,7 @@ int bcm2835_mbox_call_raw(u32 chan, u32 send, u32 *recv)
|
|||
/* Wait for space to send */
|
||||
|
||||
for (;;) {
|
||||
val = readl(®s->status);
|
||||
val = readl(®s->mail1_status);
|
||||
if (!(val & BCM2835_MBOX_STATUS_WR_FULL))
|
||||
break;
|
||||
if (get_timer(0) >= endtime) {
|
||||
|
@ -58,7 +58,7 @@ int bcm2835_mbox_call_raw(u32 chan, u32 send, u32 *recv)
|
|||
/* Wait for the response */
|
||||
|
||||
for (;;) {
|
||||
val = readl(®s->status);
|
||||
val = readl(®s->mail0_status);
|
||||
if (!(val & BCM2835_MBOX_STATUS_RD_EMPTY))
|
||||
break;
|
||||
if (get_timer(0) >= endtime) {
|
||||
|
|
Loading…
Reference in a new issue