add raspi3 mbox driver

This commit is contained in:
bigmagic 2020-03-01 13:18:00 +08:00
parent d5f8397009
commit 0279daeeee
3 changed files with 2 additions and 4 deletions

View File

@ -6,6 +6,7 @@ cwd = GetCurrentDir()
src = Split('''
board.c
drv_uart.c
mbox.c
''')
CPPPATH = [cwd]

View File

@ -99,6 +99,7 @@ void rt_hw_board_init(void)
armv8_map(0x3f200000, 0x3f200000, 0x16000, MEM_ATTR_IO);//uart
armv8_map(0x40000000, 0x40000000, 0x1000, MEM_ATTR_IO);//core timer
armv8_map(0x3F300000, 0x3F300000, 0x1000, MEM_ATTR_IO);//sdio
armv8_map(0xc00000, 0xc00000, 0x1000, MEM_ATTR_IO);//mbox
mmu_enable();
/* initialize hardware interrupt */

View File

@ -17,10 +17,6 @@ volatile unsigned int *mbox = (volatile unsigned int *) MBOX_ADDR;
/**
* Make a mailbox call. Returns 0 on failure, non-zero on success
*/
void init_mbox_mmu_map(){
rt_hw_change_mmu_table(MBOX_ADDR, 96, MBOX_ADDR, STRONG_ORDER_MEM);
}
int mbox_call(unsigned char ch, int mmu_enable)
{
unsigned int r = (((MBOX_ADDR)&~0xF) | (ch&0xF));