Move framebuffer init past mmu_init and map the framebuffer.
Add more fields to arch framebuffer to hold the physical address and size of the framebuffer. Then fill these in when mapping the framebuffer to virtual memory.
This commit is contained in:
@@ -38,6 +38,8 @@ public:
|
||||
{ return B_OK; };
|
||||
|
||||
virtual addr_t Base() { return fBase; };
|
||||
addr_t PhysicalBase() { return fPhysicalBase; };
|
||||
size_t Size() { return fSize; };
|
||||
|
||||
int Width() { return fCurrentWidth; };
|
||||
int Height() { return fCurrentHeight; };
|
||||
@@ -46,6 +48,8 @@ public:
|
||||
|
||||
protected:
|
||||
addr_t fBase;
|
||||
addr_t fPhysicalBase;
|
||||
size_t fSize;
|
||||
int fCurrentWidth;
|
||||
int fCurrentHeight;
|
||||
int fCurrentDepth;
|
||||
|
||||
@@ -154,14 +154,12 @@ ArchFramebufferBCM2708::SetVideoMode(int width, int height, int depth)
|
||||
&& sFramebufferConfig.screen_size >= sFramebufferConfig.bytes_per_row
|
||||
* sFramebufferConfig.height);
|
||||
|
||||
#if 1
|
||||
fBase = BCM2708_BUS_TO_PHYSICAL(sFramebufferConfig.frame_buffer_address);
|
||||
#else
|
||||
// TODO: Enable when the MMU works.
|
||||
fBase = (addr_t)mmu_map_physical_memory(
|
||||
BCM2708_BUS_TO_PHYSICAL(sFramebufferConfig.frame_buffer_address),
|
||||
sFramebufferConfig.screen_size, MMU_L2_FLAG_AP_RW | MMU_L2_FLAG_C);
|
||||
#endif
|
||||
fPhysicalBase
|
||||
= BCM2708_BUS_TO_PHYSICAL(sFramebufferConfig.frame_buffer_address);
|
||||
fSize = sFramebufferConfig.screen_size;
|
||||
|
||||
fBase = (addr_t)mmu_map_physical_memory(fPhysicalBase, fSize,
|
||||
kDefaultPageFlags);
|
||||
|
||||
uint8* line = (uint8*)fBase;
|
||||
for (uint32 y = 0; y < sFramebufferConfig.height; y++) {
|
||||
|
||||
@@ -116,12 +116,10 @@ _start(void)
|
||||
// Flick on "OK" led, use pre-mmu firmware base
|
||||
gpio_write(gPeripheralBase + GPIO_BASE, 16, 0);
|
||||
|
||||
// Set up the framebuffer here to help debug the early boot.
|
||||
platform_init_video();
|
||||
|
||||
// To debug mmu, enable serial_init above me!
|
||||
mmu_init();
|
||||
|
||||
platform_init_video();
|
||||
serial_init();
|
||||
console_init();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user