Fix framebuffer configuration race #40
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #5, fixes #28
Details
Previously the arm9 tried to use the framebuffer configuration passed in from the previous bootloader stage. However, the arm11 reconfigured the framebuffer to a new location shortly after power up. This led to the arm9 writing to a memory area which no longer displayed anything on the screen. And since the arm9 was no longer initializing the actual framebuffer random data was displayed on screen.
The fix was to introduce another synchronization point between the arm9 and arm11. The arm9 start.S now waits for the arm11 to have reconfigured the framebuffer before entering main.
This still left a minor flicker of unitialized data between the time that the arm11 moved the framebuffer memory location and when the arm9 initialized that memory - so an additional change in this commit is to have the arm11 initialize that memory before updating the framebuffer location.
Testing
Before:
Rather than displaying the output of firm_linux_loader, random data is displayed up until the time that linux takes over each screen.
IMG_6104-1.mov
After:
The frame buffer is properly initialized, output of firm_linux_loader is visible up until the time that linux takes over each screen.
IMG_6106-1.mov