diff --git a/repos/os/include/platform/rpi/platform_session/client.h b/repos/os/include/platform/rpi/platform_session/client.h
index d2a2855992..cadad0e234 100644
--- a/repos/os/include/platform/rpi/platform_session/client.h
+++ b/repos/os/include/platform/rpi/platform_session/client.h
@@ -15,7 +15,7 @@
#define _INCLUDE__PLATFORM_SESSION__CLIENT_H_
#include
-#include
+#include
#include
namespace Platform { struct Client; }
@@ -33,6 +33,9 @@ struct Platform::Client : Genode::Rpc_client
void power_state(Power power, bool enable) override {
call(power, enable); }
+
+ uint32_t clock_rate(Clock clock) {
+ return call(clock); }
};
#endif /* _INCLUDE__PLATFORM_SESSION__CLIENT_H_ */
diff --git a/repos/os/include/platform/rpi/platform_session/platform_session.h b/repos/os/include/platform/rpi/platform_session/platform_session.h
index b7c579cf88..dc078caf22 100644
--- a/repos/os/include/platform/rpi/platform_session/platform_session.h
+++ b/repos/os/include/platform/rpi/platform_session/platform_session.h
@@ -60,6 +60,13 @@ struct Platform::Session : Genode::Session
*/
virtual void power_state(Power, bool enable) = 0;
+ enum Clock { CLOCK_EMMC = 1 };
+
+ /**
+ * Request clock rate
+ */
+ virtual uint32_t clock_rate(Clock) = 0;
+
/*********************
** RPC declaration **
@@ -68,9 +75,10 @@ struct Platform::Session : Genode::Session
GENODE_RPC(Rpc_setup_framebuffer, void, setup_framebuffer, Framebuffer_info &);
GENODE_RPC(Rpc_get_power_state, bool, power_state, Power);
GENODE_RPC(Rpc_set_power_state, void, power_state, Power, bool);
+ GENODE_RPC(Rpc_get_clock_rate, uint32_t, clock_rate, Clock);
GENODE_RPC_INTERFACE(Rpc_setup_framebuffer, Rpc_set_power_state,
- Rpc_get_power_state);
+ Rpc_get_power_state, Rpc_get_clock_rate);
};
#endif /* _INCLUDE__PLATFORM_SESSION__PLATFORM_SESSION_H_ */
diff --git a/repos/os/src/drivers/platform/rpi/main.cc b/repos/os/src/drivers/platform/rpi/main.cc
index e25da65027..425ae3093a 100644
--- a/repos/os/src/drivers/platform/rpi/main.cc
+++ b/repos/os/src/drivers/platform/rpi/main.cc
@@ -73,6 +73,14 @@ class Platform::Session_component : public Genode::Rpc_object
msg.append_no_response(id, enable, true);
_mbox.call();
}
+
+ uint32_t clock_rate(Clock id)
+ {
+ auto &msg = _mbox.message();
+ auto const &res = msg.append(id);
+ _mbox.call();
+ return res.hz;
+ }
};
diff --git a/repos/os/src/drivers/platform/rpi/property_command.h b/repos/os/src/drivers/platform/rpi/property_command.h
index e9be42503a..efd7ddad8f 100644
--- a/repos/os/src/drivers/platform/rpi/property_command.h
+++ b/repos/os/src/drivers/platform/rpi/property_command.h
@@ -62,6 +62,24 @@ namespace Property_command {
};
};
+ struct Get_clock_rate
+ {
+ static uint32_t opcode() { return 0x00030002; };
+
+ struct Request
+ {
+ uint32_t const clock_id;
+
+ Request(uint32_t clock_id) : clock_id(clock_id) { }
+ };
+
+ struct Response
+ {
+ uint32_t const clock_id = 0;
+ uint32_t const hz = 0;
+ };
+ };
+
struct Allocate_buffer
{
static uint32_t opcode() { return 0x00040001; };