Skip to content

Commit 627dc2a

Browse files
committed
rename function
1 parent 65fa8c9 commit 627dc2a

File tree

2 files changed

+40
-36
lines changed

2 files changed

+40
-36
lines changed

bsp/raspberry-pi/raspi4-32/driver/mbox.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ int mbox_call(unsigned char ch, int mmu_enable)
5151
return 0;
5252
}
5353

54-
int bcm283x_mbox_hardware_get_model(void)
54+
int bcm271x_mbox_hardware_get_model(void)
5555
{
5656
mbox[0] = 8*4; // length of the message
5757
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -69,7 +69,7 @@ int bcm283x_mbox_hardware_get_model(void)
6969
return mbox[5];
7070
}
7171

72-
int bcm283x_mbox_hardware_get_revison(void)
72+
int bcm271x_mbox_hardware_get_revison(void)
7373
{
7474
mbox[0] = 8*4; // length of the message
7575
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -87,7 +87,7 @@ int bcm283x_mbox_hardware_get_revison(void)
8787
return mbox[5];
8888
}
8989

90-
int bcm283x_mbox_hardware_get_mac_address(uint8_t * mac)
90+
int bcm271x_mbox_hardware_get_mac_address(uint8_t * mac)
9191
{
9292
mbox[0] = 8*4; // length of the message
9393
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -113,7 +113,7 @@ int bcm283x_mbox_hardware_get_mac_address(uint8_t * mac)
113113
}
114114

115115

116-
int bcm283x_mbox_hardware_get_serial(rt_uint64_t* sn)
116+
int bcm271x_mbox_hardware_get_serial(rt_uint64_t* sn)
117117
{
118118
mbox[0] = 8*4; // length of the message
119119
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -133,7 +133,7 @@ int bcm283x_mbox_hardware_get_serial(rt_uint64_t* sn)
133133
return 0;
134134
}
135135

136-
int bcm283x_mbox_hardware_get_arm_memory(rt_uint32_t * base, rt_uint32_t * size)
136+
int bcm271x_mbox_hardware_get_arm_memory(rt_uint32_t * base, rt_uint32_t * size)
137137
{
138138
mbox[0] = 8*4; // length of the message
139139
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)
155155

156156
}
157157

158-
int bcm283x_mbox_hardware_get_vc_memory(rt_uint32_t * base, rt_uint32_t * size)
158+
int bcm271x_mbox_hardware_get_vc_memory(rt_uint32_t * base, rt_uint32_t * size)
159159
{
160160
mbox[0] = 8*4; // length of the message
161161
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)
176176
return 0;
177177
}
178178

179-
int bcm283x_mbox_clock_get_turbo(void)
179+
int bcm271x_mbox_clock_get_turbo(void)
180180
{
181181
mbox[0] = 8*4; // length of the message
182182
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -199,7 +199,7 @@ int bcm283x_mbox_clock_get_turbo(void)
199199
return mbox[6];
200200
}
201201

202-
int bcm283x_mbox_clock_set_turbo(int level)
202+
int bcm271x_mbox_clock_set_turbo(int level)
203203
{
204204
mbox[0] = 8*4; // length of the message
205205
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -222,7 +222,7 @@ int bcm283x_mbox_clock_set_turbo(int level)
222222
return mbox[6];
223223
}
224224

225-
int bcm283x_mbox_clock_get_state(int id)
225+
int bcm271x_mbox_clock_get_state(int id)
226226
{
227227
mbox[0] = 8*4; // length of the message
228228
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -245,7 +245,7 @@ int bcm283x_mbox_clock_get_state(int id)
245245
return (mbox[6] & 0x3);
246246
}
247247

248-
int bcm283x_mbox_clock_set_state(int id, int state)
248+
int bcm271x_mbox_clock_set_state(int id, int state)
249249
{
250250
mbox[0] = 8*4; // length of the message
251251
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -268,7 +268,7 @@ int bcm283x_mbox_clock_set_state(int id, int state)
268268
return (mbox[6] & 0x3);
269269
}
270270

271-
int bcm283x_mbox_clock_get_rate(int id)
271+
int bcm271x_mbox_clock_get_rate(int id)
272272
{
273273
mbox[0] = 8*4; // length of the message
274274
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -291,7 +291,7 @@ int bcm283x_mbox_clock_get_rate(int id)
291291
return mbox[6];
292292
}
293293

294-
int bcm283x_mbox_clock_set_rate(int id, int rate)
294+
int bcm271x_mbox_clock_set_rate(int id, int rate)
295295
{
296296
mbox[0] = 8*4; // length of the message
297297
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -314,7 +314,7 @@ int bcm283x_mbox_clock_set_rate(int id, int rate)
314314
return mbox[6];
315315
}
316316

317-
int bcm283x_mbox_clock_get_max_rate(int id)
317+
int bcm271x_mbox_clock_get_max_rate(int id)
318318
{
319319
mbox[0] = 8*4; // length of the message
320320
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -337,7 +337,7 @@ int bcm283x_mbox_clock_get_max_rate(int id)
337337
return mbox[6];
338338
}
339339

340-
int bcm283x_mbox_clock_get_min_rate(int id)
340+
int bcm271x_mbox_clock_get_min_rate(int id)
341341
{
342342
mbox[0] = 8*4; // length of the message
343343
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -360,7 +360,7 @@ int bcm283x_mbox_clock_get_min_rate(int id)
360360
return mbox[6];
361361
}
362362

363-
int bcm283x_mbox_power_get_state(int id)
363+
int bcm271x_mbox_power_get_state(int id)
364364
{
365365
mbox[0] = 8*4; // length of the message
366366
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -383,7 +383,7 @@ int bcm283x_mbox_power_get_state(int id)
383383
return (mbox[6] & 0x3);
384384
}
385385

386-
int bcm283x_mbox_power_set_state(int id, int state)
386+
int bcm271x_mbox_power_set_state(int id, int state)
387387
{
388388
mbox[0] = 8*4; // length of the message
389389
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -406,7 +406,7 @@ int bcm283x_mbox_power_set_state(int id, int state)
406406
return (mbox[6] & 0x3);
407407
}
408408

409-
int bcm283x_mbox_temp_get(void)
409+
int bcm271x_mbox_temp_get(void)
410410
{
411411
mbox[0] = 8*4; // length of the message
412412
mbox[1] = MBOX_REQUEST; // this is a request message
@@ -429,7 +429,7 @@ int bcm283x_mbox_temp_get(void)
429429
return mbox[6];
430430
}
431431

432-
int bcm283x_mbox_temp_get_max(void)
432+
int bcm271x_mbox_temp_get_max(void)
433433
{
434434
mbox[0] = 8*4; // length of the message
435435
mbox[1] = MBOX_REQUEST; // this is a request message

bsp/raspberry-pi/raspi4-32/driver/mbox.h

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#define __MBOX_H__
1313

1414
#include <rtthread.h>
15+
16+
//https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface
17+
//https://github.com/hermanhermitage/videocoreiv
18+
1519
/* a properly aligned buffer */
1620
extern volatile unsigned int* mbox;
1721

@@ -101,23 +105,23 @@ enum {
101105
#define MBOX_ADDR 0xc00000
102106

103107
int mbox_call(unsigned char ch, int mmu_enable);
104-
int bcm283x_mbox_hardware_get_model(void);
105-
int bcm283x_mbox_hardware_get_revison(void);
106-
int bcm283x_mbox_hardware_get_mac_address(uint8_t * mac);
107-
int bcm283x_mbox_hardware_get_serial(rt_uint64_t* sn);
108-
int bcm283x_mbox_hardware_get_arm_memory(rt_uint32_t * base, rt_uint32_t * size);
109-
int bcm283x_mbox_hardware_get_vc_memory(rt_uint32_t * base, rt_uint32_t * size);
110-
int bcm283x_mbox_clock_get_turbo(void);
111-
int bcm283x_mbox_clock_set_turbo(int level);
112-
int bcm283x_mbox_clock_get_state(int id);
113-
int bcm283x_mbox_clock_set_state(int id, int state);
114-
int bcm283x_mbox_clock_get_rate(int id);
115-
int bcm283x_mbox_clock_set_rate(int id, int rate);
116-
int bcm283x_mbox_clock_get_max_rate(int id);
117-
int bcm283x_mbox_clock_get_min_rate(int id);
118-
int bcm283x_mbox_power_get_state(int id);
119-
int bcm283x_mbox_power_set_state(int id, int state);
120-
int bcm283x_mbox_temp_get(void);
121-
int bcm283x_mbox_temp_get_max(void);
108+
int bcm271x_mbox_hardware_get_model(void);
109+
int bcm271x_mbox_hardware_get_revison(void);
110+
int bcm271x_mbox_hardware_get_mac_address(uint8_t * mac);
111+
int bcm271x_mbox_hardware_get_serial(rt_uint64_t* sn);
112+
int bcm271x_mbox_hardware_get_arm_memory(rt_uint32_t * base, rt_uint32_t * size);
113+
int bcm271x_mbox_hardware_get_vc_memory(rt_uint32_t * base, rt_uint32_t * size);
114+
int bcm271x_mbox_clock_get_turbo(void);
115+
int bcm271x_mbox_clock_set_turbo(int level);
116+
int bcm271x_mbox_clock_get_state(int id);
117+
int bcm271x_mbox_clock_set_state(int id, int state);
118+
int bcm271x_mbox_clock_get_rate(int id);
119+
int bcm271x_mbox_clock_set_rate(int id, int rate);
120+
int bcm271x_mbox_clock_get_max_rate(int id);
121+
int bcm271x_mbox_clock_get_min_rate(int id);
122+
int bcm271x_mbox_power_get_state(int id);
123+
int bcm271x_mbox_power_set_state(int id, int state);
124+
int bcm271x_mbox_temp_get(void);
125+
int bcm271x_mbox_temp_get_max(void);
122126

123127
#endif

0 commit comments

Comments
 (0)