summaryrefslogtreecommitdiff
path: root/bsp/raspberry-pi
diff options
context:
space:
mode:
authorbigamgic <[email protected]>2020-09-11 16:55:10 +0800
committerbigamgic <[email protected]>2020-09-11 16:55:10 +0800
commit627dc2a898bb2dc66920aaed3eaadd54e04df444 (patch)
tree35e8b60ef602894d179fb2918d674250c2e3f5f6 /bsp/raspberry-pi
parent65fa8c92cabe6516dcea3f39884c87a6b7a64579 (diff)
rename function
Diffstat (limited to 'bsp/raspberry-pi')
-rw-r--r--bsp/raspberry-pi/raspi4-32/driver/mbox.c36
-rw-r--r--bsp/raspberry-pi/raspi4-32/driver/mbox.h40
2 files changed, 40 insertions, 36 deletions
diff --git a/bsp/raspberry-pi/raspi4-32/driver/mbox.c b/bsp/raspberry-pi/raspi4-32/driver/mbox.c
index 5e03c5e28d..402855bc0d 100644
--- a/bsp/raspberry-pi/raspi4-32/driver/mbox.c
+++ b/bsp/raspberry-pi/raspi4-32/driver/mbox.c
@@ -51,7 +51,7 @@ int mbox_call(unsigned char ch, int mmu_enable)
return 0;
}
-int bcm283x_mbox_hardware_get_model(void)
+int bcm271x_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 bcm283x_mbox_hardware_get_revison(void)
+int bcm271x_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 bcm283x_mbox_hardware_get_mac_address(uint8_t * mac)
+int bcm271x_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 bcm283x_mbox_hardware_get_serial(rt_uint64_t* sn)
+int bcm271x_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 bcm283x_mbox_hardware_get_arm_memory(rt_uint32_t * base, rt_uint32_t * size)
+int bcm271x_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 bcm283x_mbox_hardware_get_vc_memory(rt_uint32_t * base, rt_uint32_t * size)
+int bcm271x_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 bcm283x_mbox_clock_get_turbo(void)
+int bcm271x_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 bcm283x_mbox_clock_set_turbo(int level)
+int bcm271x_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 bcm283x_mbox_clock_get_state(int id)
+int bcm271x_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 bcm283x_mbox_clock_set_state(int id, int state)
+int bcm271x_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 bcm283x_mbox_clock_get_rate(int id)
+int bcm271x_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 bcm283x_mbox_clock_set_rate(int id, int rate)
+int bcm271x_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 bcm283x_mbox_clock_get_max_rate(int id)
+int bcm271x_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 bcm283x_mbox_clock_get_min_rate(int id)
+int bcm271x_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 bcm283x_mbox_power_get_state(int id)
+int bcm271x_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 bcm283x_mbox_power_set_state(int id, int state)
+int bcm271x_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 bcm283x_mbox_temp_get(void)
+int bcm271x_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 bcm283x_mbox_temp_get_max(void)
+int bcm271x_mbox_temp_get_max(void)
{
mbox[0] = 8*4; // length of the message
mbox[1] = MBOX_REQUEST; // this is a request message
diff --git a/bsp/raspberry-pi/raspi4-32/driver/mbox.h b/bsp/raspberry-pi/raspi4-32/driver/mbox.h
index baf5cbf387..bf9ac0e96d 100644
--- a/bsp/raspberry-pi/raspi4-32/driver/mbox.h
+++ b/bsp/raspberry-pi/raspi4-32/driver/mbox.h
@@ -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 bcm283x_mbox_hardware_get_model(void);
-int bcm283x_mbox_hardware_get_revison(void);
-int bcm283x_mbox_hardware_get_mac_address(uint8_t * mac);
-int bcm283x_mbox_hardware_get_serial(rt_uint64_t* sn);
-int bcm283x_mbox_hardware_get_arm_memory(rt_uint32_t * base, rt_uint32_t * size);
-int bcm283x_mbox_hardware_get_vc_memory(rt_uint32_t * base, rt_uint32_t * size);
-int bcm283x_mbox_clock_get_turbo(void);
-int bcm283x_mbox_clock_set_turbo(int level);
-int bcm283x_mbox_clock_get_state(int id);
-int bcm283x_mbox_clock_set_state(int id, int state);
-int bcm283x_mbox_clock_get_rate(int id);
-int bcm283x_mbox_clock_set_rate(int id, int rate);
-int bcm283x_mbox_clock_get_max_rate(int id);
-int bcm283x_mbox_clock_get_min_rate(int id);
-int bcm283x_mbox_power_get_state(int id);
-int bcm283x_mbox_power_set_state(int id, int state);
-int bcm283x_mbox_temp_get(void);
-int bcm283x_mbox_temp_get_max(void);
+int bcm271x_mbox_hardware_get_model(void);
+int bcm271x_mbox_hardware_get_revison(void);
+int bcm271x_mbox_hardware_get_mac_address(uint8_t * mac);
+int bcm271x_mbox_hardware_get_serial(rt_uint64_t* sn);
+int bcm271x_mbox_hardware_get_arm_memory(rt_uint32_t * base, rt_uint32_t * size);
+int bcm271x_mbox_hardware_get_vc_memory(rt_uint32_t * base, rt_uint32_t * size);
+int bcm271x_mbox_clock_get_turbo(void);
+int bcm271x_mbox_clock_set_turbo(int level);
+int bcm271x_mbox_clock_get_state(int id);
+int bcm271x_mbox_clock_set_state(int id, int state);
+int bcm271x_mbox_clock_get_rate(int id);
+int bcm271x_mbox_clock_set_rate(int id, int rate);
+int bcm271x_mbox_clock_get_max_rate(int id);
+int bcm271x_mbox_clock_get_min_rate(int id);
+int bcm271x_mbox_power_get_state(int id);
+int bcm271x_mbox_power_set_state(int id, int state);
+int bcm271x_mbox_temp_get(void);
+int bcm271x_mbox_temp_get_max(void);
#endif