b2e00fa77c7b659a6147b79aa9dddde55b98658e
[lunaix-os.git] / lunaix-os / hal / LConfig
1 from . import char, bus, ahci
2
3 @"Devices & Peripherials"
4 def hal():
5     """ Lunaix hardware asbtraction layer """
6
7     @"Devicetree for hardware discovery"
8     def use_devicetree() -> bool:
9         """
10             Decide whether to use Devicetree for platform
11             resource topology sensing.
12
13             On some architecture, Lunaix will fallback to use
14             devicetree when ran out of options. For others, such
15             as those designed with embedded support in mind, 
16             devicetree might be mandatory and perhaps the only
17             way.
18         """
19         require(not arch_x86)
20
21         return False
22
23     @"Maximum size of device tree blob (in KiB)"
24     @readonly
25     def dtb_maxsize() -> int:
26         """
27             Maximum size for a firmware provided device tree blob
28         """
29         require(use_devicetree)
30
31         return 256