/* Make a mailbox call. Returns 0 on failure, non-zero on success  */
int mbox_call(unsigned char ch, int mmu_enable)
/* Make a mailbox call. Returns 0 on failure, non-zero on success  */
int mbox_call(unsigned char ch, int mmu_enable)
{
    unsigned int r = ((((rt_uint32_t)MBOX_ADDR)&~0xF) | (ch&0xF));
    if(mmu_enable)
        r = BUS_ADDRESS(r);
    do
    {
        asm volatile("nop");
    } while (*MBOX_STATUS & MBOX_FULL);
    *MBOX_WRITE = r;
    while(1)
    {
        do
        {
            asm volatile("nop");
        } while (*MBOX_STATUS & MBOX_EMPTY);
        if (r == *MBOX_READ){
            return mbox[1] == MBOX_RESPONSE;
        }
    }
    return 0;
}