mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-12 21:53:28 +00:00
nova: support mbi2 framebuffer
- export framebuffer information as platform_info ROM by core Issue #2242
This commit is contained in:
parent
f48e71e070
commit
615f2ba2da
@ -91,6 +91,7 @@ namespace Nova {
|
||||
struct Mem_desc
|
||||
{
|
||||
enum Type {
|
||||
FRAMEBUFFER = -5,
|
||||
ACPI_XSDT = -4,
|
||||
ACPI_RSDT = -3,
|
||||
MULTIBOOT_MODULE = -2,
|
||||
|
@ -1 +1 @@
|
||||
d303aea094b6576a9bb0ba350c7cf4eb648e5ca4
|
||||
a2edf3c16d4d5ab39ba62641aa6ed1fea3227c5c
|
||||
|
@ -4,7 +4,7 @@ DOWNLOADS := nova.git
|
||||
|
||||
# r9 branch - use r9_debug for more verbose kernel messages
|
||||
URL(nova) := https://github.com/alex-ab/NOVA.git
|
||||
REV(nova) := 9a3605ead755be8b5820de3ae6015d6de8baaaf5
|
||||
REV(nova) := 402338722a991ea9f203e098484af6748cb1f14d
|
||||
DIR(nova) := src/kernel/nova
|
||||
|
||||
PATCHES := $(wildcard $(REP_DIR)/patches/*.patch)
|
||||
|
@ -567,12 +567,14 @@ Platform::Platform() :
|
||||
if (mem_desc->type == Hip::Mem_desc::AVAILABLE_MEMORY) continue;
|
||||
if (mem_desc->type == Hip::Mem_desc::ACPI_RSDT) continue;
|
||||
if (mem_desc->type == Hip::Mem_desc::ACPI_XSDT) continue;
|
||||
if (mem_desc->type == Hip::Mem_desc::FRAMEBUFFER) continue;
|
||||
|
||||
Hip::Mem_desc * mem_d = (Hip::Mem_desc *)mem_desc_base;
|
||||
for (unsigned j = 0; j < num_mem_desc; j++, mem_d++) {
|
||||
if (mem_d->type == Hip::Mem_desc::AVAILABLE_MEMORY) continue;
|
||||
if (mem_d->type == Hip::Mem_desc::ACPI_RSDT) continue;
|
||||
if (mem_d->type == Hip::Mem_desc::ACPI_XSDT) continue;
|
||||
if (mem_d->type == Hip::Mem_desc::FRAMEBUFFER) continue;
|
||||
if (mem_d == mem_desc) continue;
|
||||
|
||||
/* if regions are disjunct all is fine */
|
||||
@ -596,11 +598,35 @@ Platform::Platform() :
|
||||
uint64_t rsdt = 0UL;
|
||||
uint64_t xsdt = 0UL;
|
||||
|
||||
struct mbfb_t {
|
||||
uint64_t addr = 0;
|
||||
union {
|
||||
uint64_t size;
|
||||
struct {
|
||||
uint32_t height;
|
||||
uint32_t width;
|
||||
};
|
||||
};
|
||||
union {
|
||||
uint32_t aux;
|
||||
struct {
|
||||
uint8_t bpp;
|
||||
uint8_t type;
|
||||
uint8_t reserved[2];
|
||||
};
|
||||
};
|
||||
} mbi_fb;
|
||||
|
||||
/* build ROM file system */
|
||||
mem_desc = (Hip::Mem_desc *)mem_desc_base;
|
||||
for (unsigned i = 0; i < num_mem_desc; i++, mem_desc++) {
|
||||
if (mem_desc->type == Hip::Mem_desc::ACPI_RSDT) rsdt = mem_desc->addr;
|
||||
if (mem_desc->type == Hip::Mem_desc::ACPI_XSDT) xsdt = mem_desc->addr;
|
||||
if (mem_desc->type == Hip::Mem_desc::FRAMEBUFFER) {
|
||||
mbi_fb.addr = mem_desc->addr;
|
||||
mbi_fb.size = mem_desc->size;
|
||||
mbi_fb.aux = mem_desc->aux;
|
||||
}
|
||||
if (mem_desc->type != Hip::Mem_desc::MULTIBOOT_MODULE) continue;
|
||||
if (!mem_desc->addr || !mem_desc->size) continue;
|
||||
|
||||
@ -642,6 +668,16 @@ Platform::Platform() :
|
||||
if (xsdt)
|
||||
xml.attribute("xsdt", String<32>(Hex(xsdt)));
|
||||
});
|
||||
xml.node("boot", [&] () {
|
||||
if (mbi_fb.addr) {
|
||||
xml.node("framebuffer", [&] () {
|
||||
xml.attribute("phys", String<32>(Hex(mbi_fb.addr)));
|
||||
xml.attribute("width", mbi_fb.width);
|
||||
xml.attribute("height", mbi_fb.height);
|
||||
xml.attribute("bpp", mbi_fb.bpp);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
unmap_local(__main_thread_utcb, core_local_addr, pages);
|
||||
|
Loading…
x
Reference in New Issue
Block a user