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:
Michael Lotz
2012-11-28 01:38:38 +01:00
parent 87cedaf493
commit 3c3b8858a1
3 changed files with 11 additions and 11 deletions
@@ -38,6 +38,8 @@ public:
{ return B_OK; }; { return B_OK; };
virtual addr_t Base() { return fBase; }; virtual addr_t Base() { return fBase; };
addr_t PhysicalBase() { return fPhysicalBase; };
size_t Size() { return fSize; };
int Width() { return fCurrentWidth; }; int Width() { return fCurrentWidth; };
int Height() { return fCurrentHeight; }; int Height() { return fCurrentHeight; };
@@ -46,6 +48,8 @@ public:
protected: protected:
addr_t fBase; addr_t fBase;
addr_t fPhysicalBase;
size_t fSize;
int fCurrentWidth; int fCurrentWidth;
int fCurrentHeight; int fCurrentHeight;
int fCurrentDepth; int fCurrentDepth;
@@ -154,14 +154,12 @@ ArchFramebufferBCM2708::SetVideoMode(int width, int height, int depth)
&& sFramebufferConfig.screen_size >= sFramebufferConfig.bytes_per_row && sFramebufferConfig.screen_size >= sFramebufferConfig.bytes_per_row
* sFramebufferConfig.height); * sFramebufferConfig.height);
#if 1 fPhysicalBase
fBase = BCM2708_BUS_TO_PHYSICAL(sFramebufferConfig.frame_buffer_address); = BCM2708_BUS_TO_PHYSICAL(sFramebufferConfig.frame_buffer_address);
#else fSize = sFramebufferConfig.screen_size;
// TODO: Enable when the MMU works.
fBase = (addr_t)mmu_map_physical_memory( fBase = (addr_t)mmu_map_physical_memory(fPhysicalBase, fSize,
BCM2708_BUS_TO_PHYSICAL(sFramebufferConfig.frame_buffer_address), kDefaultPageFlags);
sFramebufferConfig.screen_size, MMU_L2_FLAG_AP_RW | MMU_L2_FLAG_C);
#endif
uint8* line = (uint8*)fBase; uint8* line = (uint8*)fBase;
for (uint32 y = 0; y < sFramebufferConfig.height; y++) { for (uint32 y = 0; y < sFramebufferConfig.height; y++) {
@@ -116,12 +116,10 @@ _start(void)
// Flick on "OK" led, use pre-mmu firmware base // Flick on "OK" led, use pre-mmu firmware base
gpio_write(gPeripheralBase + GPIO_BASE, 16, 0); 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! // To debug mmu, enable serial_init above me!
mmu_init(); mmu_init();
platform_init_video();
serial_init(); serial_init();
console_init(); console_init();