add raspi3 mbox driver
This commit is contained in:
parent
d5f8397009
commit
0279daeeee
|
@ -6,6 +6,7 @@ cwd = GetCurrentDir()
|
||||||
src = Split('''
|
src = Split('''
|
||||||
board.c
|
board.c
|
||||||
drv_uart.c
|
drv_uart.c
|
||||||
|
mbox.c
|
||||||
''')
|
''')
|
||||||
CPPPATH = [cwd]
|
CPPPATH = [cwd]
|
||||||
|
|
||||||
|
|
|
@ -99,6 +99,7 @@ void rt_hw_board_init(void)
|
||||||
armv8_map(0x3f200000, 0x3f200000, 0x16000, MEM_ATTR_IO);//uart
|
armv8_map(0x3f200000, 0x3f200000, 0x16000, MEM_ATTR_IO);//uart
|
||||||
armv8_map(0x40000000, 0x40000000, 0x1000, MEM_ATTR_IO);//core timer
|
armv8_map(0x40000000, 0x40000000, 0x1000, MEM_ATTR_IO);//core timer
|
||||||
armv8_map(0x3F300000, 0x3F300000, 0x1000, MEM_ATTR_IO);//sdio
|
armv8_map(0x3F300000, 0x3F300000, 0x1000, MEM_ATTR_IO);//sdio
|
||||||
|
armv8_map(0xc00000, 0xc00000, 0x1000, MEM_ATTR_IO);//mbox
|
||||||
mmu_enable();
|
mmu_enable();
|
||||||
|
|
||||||
/* initialize hardware interrupt */
|
/* initialize hardware interrupt */
|
||||||
|
|
|
@ -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
|
* 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)
|
int mbox_call(unsigned char ch, int mmu_enable)
|
||||||
{
|
{
|
||||||
unsigned int r = (((MBOX_ADDR)&~0xF) | (ch&0xF));
|
unsigned int r = (((MBOX_ADDR)&~0xF) | (ch&0xF));
|
||||||
|
|
Loading…
Reference in New Issue