]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/drivers-frst/of/include/of_if.h
update
[l4.git] / l4 / pkg / drivers-frst / of / include / of_if.h
1 #include <l4/drivers/of.h>
2 #include <stdio.h>
3
4 namespace L4_drivers
5 {
6 class Of_if : public Of
7 {
8 private:
9   phandle_t _chosen;
10   ihandle_t _root;
11
12   phandle_t get_device(const char*, const char *prop = "device_type");
13   unsigned long cpu_detect(const char *prop);
14
15 public:
16   Of_if() : Of(), _chosen(0), _root(0) {}
17   unsigned long detect_ramsize();
18   unsigned long detect_cpu_freq();
19   unsigned long detect_bus_freq();
20   unsigned long detect_time_freq();
21   bool detect_devices(unsigned long *start_addr, unsigned long *length);
22   void boot_finish();
23
24   phandle_t get_chosen()
25     {
26       if(handle_valid(_chosen)) return _chosen;
27       _chosen = (phandle_t)prom_call("finddevice", 1, 1, "/chosen");
28       return _chosen;
29     }
30
31   ihandle_t get_root()
32     {
33       if(handle_valid(_root)) return _root;
34       _root = (ihandle_t)prom_call("finddevice", 1, 1, "/");
35       return _root;
36     }
37
38   void vesa_set_mode(int mode);
39 };
40 }