summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbigmagic <[email protected]>2020-03-01 13:18:00 +0800
committerbigmagic <[email protected]>2020-03-02 20:49:27 +0800
commit0279daeeee7810525fa5eaec8793270055c97648 (patch)
treef00d17358ffeaf09bd67429e48eb82b47f12e5f5
parentd5f839700924211e2f3291bcb06525404d88aff3 (diff)
add raspi3 mbox driver
-rw-r--r--bsp/raspberry-pi/raspi3-64/driver/SConscript1
-rw-r--r--bsp/raspberry-pi/raspi3-64/driver/board.c1
-rw-r--r--bsp/raspberry-pi/raspi3-64/driver/mbox.c4
3 files changed, 2 insertions, 4 deletions
diff --git a/bsp/raspberry-pi/raspi3-64/driver/SConscript b/bsp/raspberry-pi/raspi3-64/driver/SConscript
index 484e20faff..c51b2c42bf 100644
--- a/bsp/raspberry-pi/raspi3-64/driver/SConscript
+++ b/bsp/raspberry-pi/raspi3-64/driver/SConscript
@@ -6,6 +6,7 @@ cwd = GetCurrentDir()
src = Split('''
board.c
drv_uart.c
+mbox.c
''')
CPPPATH = [cwd]
diff --git a/bsp/raspberry-pi/raspi3-64/driver/board.c b/bsp/raspberry-pi/raspi3-64/driver/board.c
index 35f90bf54f..19a232272f 100644
--- a/bsp/raspberry-pi/raspi3-64/driver/board.c
+++ b/bsp/raspberry-pi/raspi3-64/driver/board.c
@@ -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 */
diff --git a/bsp/raspberry-pi/raspi3-64/driver/mbox.c b/bsp/raspberry-pi/raspi3-64/driver/mbox.c
index 36ed95b429..1d995340d6 100644
--- a/bsp/raspberry-pi/raspi3-64/driver/mbox.c
+++ b/bsp/raspberry-pi/raspi3-64/driver/mbox.c
@@ -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));