Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
okll00
rt-thread
提交
627dc2a8
R
rt-thread
项目概览
okll00
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
627dc2a8
编写于
9月 11, 2020
作者:
B
bigamgic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename function
上级
65fa8c92
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
40 addition
and
36 deletion
+40
-36
bsp/raspberry-pi/raspi4-32/driver/mbox.c
bsp/raspberry-pi/raspi4-32/driver/mbox.c
+18
-18
bsp/raspberry-pi/raspi4-32/driver/mbox.h
bsp/raspberry-pi/raspi4-32/driver/mbox.h
+22
-18
未找到文件。
bsp/raspberry-pi/raspi4-32/driver/mbox.c
浏览文件 @
627dc2a8
...
...
@@ -51,7 +51,7 @@ int mbox_call(unsigned char ch, int mmu_enable)
return
0
;
}
int
bcm2
83
x_mbox_hardware_get_model
(
void
)
int
bcm2
71
x_mbox_hardware_get_model
(
void
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -69,7 +69,7 @@ int bcm283x_mbox_hardware_get_model(void)
return
mbox
[
5
];
}
int
bcm2
83
x_mbox_hardware_get_revison
(
void
)
int
bcm2
71
x_mbox_hardware_get_revison
(
void
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -87,7 +87,7 @@ int bcm283x_mbox_hardware_get_revison(void)
return
mbox
[
5
];
}
int
bcm2
83
x_mbox_hardware_get_mac_address
(
uint8_t
*
mac
)
int
bcm2
71
x_mbox_hardware_get_mac_address
(
uint8_t
*
mac
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -113,7 +113,7 @@ int bcm283x_mbox_hardware_get_mac_address(uint8_t * mac)
}
int
bcm2
83
x_mbox_hardware_get_serial
(
rt_uint64_t
*
sn
)
int
bcm2
71
x_mbox_hardware_get_serial
(
rt_uint64_t
*
sn
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -133,7 +133,7 @@ int bcm283x_mbox_hardware_get_serial(rt_uint64_t* sn)
return
0
;
}
int
bcm2
83
x_mbox_hardware_get_arm_memory
(
rt_uint32_t
*
base
,
rt_uint32_t
*
size
)
int
bcm2
71
x_mbox_hardware_get_arm_memory
(
rt_uint32_t
*
base
,
rt_uint32_t
*
size
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -155,7 +155,7 @@ int bcm283x_mbox_hardware_get_arm_memory(rt_uint32_t * base, rt_uint32_t * size)
}
int
bcm2
83
x_mbox_hardware_get_vc_memory
(
rt_uint32_t
*
base
,
rt_uint32_t
*
size
)
int
bcm2
71
x_mbox_hardware_get_vc_memory
(
rt_uint32_t
*
base
,
rt_uint32_t
*
size
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -176,7 +176,7 @@ int bcm283x_mbox_hardware_get_vc_memory(rt_uint32_t * base, rt_uint32_t * size)
return
0
;
}
int
bcm2
83
x_mbox_clock_get_turbo
(
void
)
int
bcm2
71
x_mbox_clock_get_turbo
(
void
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -199,7 +199,7 @@ int bcm283x_mbox_clock_get_turbo(void)
return
mbox
[
6
];
}
int
bcm2
83
x_mbox_clock_set_turbo
(
int
level
)
int
bcm2
71
x_mbox_clock_set_turbo
(
int
level
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -222,7 +222,7 @@ int bcm283x_mbox_clock_set_turbo(int level)
return
mbox
[
6
];
}
int
bcm2
83
x_mbox_clock_get_state
(
int
id
)
int
bcm2
71
x_mbox_clock_get_state
(
int
id
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -245,7 +245,7 @@ int bcm283x_mbox_clock_get_state(int id)
return
(
mbox
[
6
]
&
0x3
);
}
int
bcm2
83
x_mbox_clock_set_state
(
int
id
,
int
state
)
int
bcm2
71
x_mbox_clock_set_state
(
int
id
,
int
state
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -268,7 +268,7 @@ int bcm283x_mbox_clock_set_state(int id, int state)
return
(
mbox
[
6
]
&
0x3
);
}
int
bcm2
83
x_mbox_clock_get_rate
(
int
id
)
int
bcm2
71
x_mbox_clock_get_rate
(
int
id
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -291,7 +291,7 @@ int bcm283x_mbox_clock_get_rate(int id)
return
mbox
[
6
];
}
int
bcm2
83
x_mbox_clock_set_rate
(
int
id
,
int
rate
)
int
bcm2
71
x_mbox_clock_set_rate
(
int
id
,
int
rate
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -314,7 +314,7 @@ int bcm283x_mbox_clock_set_rate(int id, int rate)
return
mbox
[
6
];
}
int
bcm2
83
x_mbox_clock_get_max_rate
(
int
id
)
int
bcm2
71
x_mbox_clock_get_max_rate
(
int
id
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -337,7 +337,7 @@ int bcm283x_mbox_clock_get_max_rate(int id)
return
mbox
[
6
];
}
int
bcm2
83
x_mbox_clock_get_min_rate
(
int
id
)
int
bcm2
71
x_mbox_clock_get_min_rate
(
int
id
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -360,7 +360,7 @@ int bcm283x_mbox_clock_get_min_rate(int id)
return
mbox
[
6
];
}
int
bcm2
83
x_mbox_power_get_state
(
int
id
)
int
bcm2
71
x_mbox_power_get_state
(
int
id
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -383,7 +383,7 @@ int bcm283x_mbox_power_get_state(int id)
return
(
mbox
[
6
]
&
0x3
);
}
int
bcm2
83
x_mbox_power_set_state
(
int
id
,
int
state
)
int
bcm2
71
x_mbox_power_set_state
(
int
id
,
int
state
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -406,7 +406,7 @@ int bcm283x_mbox_power_set_state(int id, int state)
return
(
mbox
[
6
]
&
0x3
);
}
int
bcm2
83
x_mbox_temp_get
(
void
)
int
bcm2
71
x_mbox_temp_get
(
void
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
@@ -429,7 +429,7 @@ int bcm283x_mbox_temp_get(void)
return
mbox
[
6
];
}
int
bcm2
83
x_mbox_temp_get_max
(
void
)
int
bcm2
71
x_mbox_temp_get_max
(
void
)
{
mbox
[
0
]
=
8
*
4
;
// length of the message
mbox
[
1
]
=
MBOX_REQUEST
;
// this is a request message
...
...
bsp/raspberry-pi/raspi4-32/driver/mbox.h
浏览文件 @
627dc2a8
...
...
@@ -12,6 +12,10 @@
#define __MBOX_H__
#include <rtthread.h>
//https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface
//https://github.com/hermanhermitage/videocoreiv
/* a properly aligned buffer */
extern
volatile
unsigned
int
*
mbox
;
...
...
@@ -101,23 +105,23 @@ enum {
#define MBOX_ADDR 0xc00000
int
mbox_call
(
unsigned
char
ch
,
int
mmu_enable
);
int
bcm2
83
x_mbox_hardware_get_model
(
void
);
int
bcm2
83
x_mbox_hardware_get_revison
(
void
);
int
bcm2
83
x_mbox_hardware_get_mac_address
(
uint8_t
*
mac
);
int
bcm2
83
x_mbox_hardware_get_serial
(
rt_uint64_t
*
sn
);
int
bcm2
83
x_mbox_hardware_get_arm_memory
(
rt_uint32_t
*
base
,
rt_uint32_t
*
size
);
int
bcm2
83
x_mbox_hardware_get_vc_memory
(
rt_uint32_t
*
base
,
rt_uint32_t
*
size
);
int
bcm2
83
x_mbox_clock_get_turbo
(
void
);
int
bcm2
83
x_mbox_clock_set_turbo
(
int
level
);
int
bcm2
83
x_mbox_clock_get_state
(
int
id
);
int
bcm2
83
x_mbox_clock_set_state
(
int
id
,
int
state
);
int
bcm2
83
x_mbox_clock_get_rate
(
int
id
);
int
bcm2
83
x_mbox_clock_set_rate
(
int
id
,
int
rate
);
int
bcm2
83
x_mbox_clock_get_max_rate
(
int
id
);
int
bcm2
83
x_mbox_clock_get_min_rate
(
int
id
);
int
bcm2
83
x_mbox_power_get_state
(
int
id
);
int
bcm2
83
x_mbox_power_set_state
(
int
id
,
int
state
);
int
bcm2
83
x_mbox_temp_get
(
void
);
int
bcm2
83
x_mbox_temp_get_max
(
void
);
int
bcm2
71
x_mbox_hardware_get_model
(
void
);
int
bcm2
71
x_mbox_hardware_get_revison
(
void
);
int
bcm2
71
x_mbox_hardware_get_mac_address
(
uint8_t
*
mac
);
int
bcm2
71
x_mbox_hardware_get_serial
(
rt_uint64_t
*
sn
);
int
bcm2
71
x_mbox_hardware_get_arm_memory
(
rt_uint32_t
*
base
,
rt_uint32_t
*
size
);
int
bcm2
71
x_mbox_hardware_get_vc_memory
(
rt_uint32_t
*
base
,
rt_uint32_t
*
size
);
int
bcm2
71
x_mbox_clock_get_turbo
(
void
);
int
bcm2
71
x_mbox_clock_set_turbo
(
int
level
);
int
bcm2
71
x_mbox_clock_get_state
(
int
id
);
int
bcm2
71
x_mbox_clock_set_state
(
int
id
,
int
state
);
int
bcm2
71
x_mbox_clock_get_rate
(
int
id
);
int
bcm2
71
x_mbox_clock_set_rate
(
int
id
,
int
rate
);
int
bcm2
71
x_mbox_clock_get_max_rate
(
int
id
);
int
bcm2
71
x_mbox_clock_get_min_rate
(
int
id
);
int
bcm2
71
x_mbox_power_get_state
(
int
id
);
int
bcm2
71
x_mbox_power_set_state
(
int
id
,
int
state
);
int
bcm2
71
x_mbox_temp_get
(
void
);
int
bcm2
71
x_mbox_temp_get_max
(
void
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录