Broadcom releases SoC graphics driver source
Broadcom releases SoC graphics driver source
Posted Mar 1, 2014 8:05 UTC (Sat) by pabs (subscriber, #43278)In reply to: Broadcom releases SoC graphics driver source by pehjota
Parent article: Broadcom releases SoC graphics driver source
http://www.freelists.org/post/raspi-internals/Hey-look-QP...
Posted Mar 1, 2014 10:56 UTC (Sat)
by slp (guest, #95767)
[Link] (6 responses)
This means this source release will be very helpful for projects like https://github.com/hermanhermitage/videocoreiv which are working on reverse engineering VideoCore and building assemblers for its instruction set.
But to being able to run a 3D program without making use of any binary blobs, you'll still need to develop replacement for the RTOS, including the initialization code, all subsystems and an OpenGLES implementation (!). All of this without an architectural simulator or a proper toolchain.
On the bright side, ignoring the whole "replace the firmware" stuff, it's very probably that in a near future we'll be able to use the VPU for running custom code, which would be really useful for moving some heavy computing tasks there, relieving the burden of the little RPi's ARM core.
Posted Mar 1, 2014 12:43 UTC (Sat)
by excors (subscriber, #95769)
[Link] (4 responses)
In contrast, BCM21553 was a low-end design - it uses the same VideoCore name and has essentially the same 3D hardware block (though with far fewer QPUs, i.e. much lower performance), but as far as I'm aware it has very little else. In particular there is no VPU, so the 3D hardware had to be controlled directly from the ARM. I believe the 3D stack was originally written for the VPU without much consideration for platform-independence, and then got ported to the ARM, and that's what got released now. Any references in the code to VPU and RTOS are remnants of that porting that never got cleaned up properly.
Those remnants should be interesting to people reverse-engineering the VPU - e.g. there's a load of VPU vector assembly (which is a fun 16-way 2D-register-file SIMD design), and definitions of a lot of non-3D hardware registers - but you certainly couldn't compile any useful firmware from them.
If you port that BCM21553 code back to the RPi, then you'll still be relying on the binary blob to control the non-3D hardware, but the entire OpenGL ES stack (everything from libGLESv2.so and the shader compiler to the register poking) will be on the ARM.
Posted Mar 1, 2014 13:21 UTC (Sat)
by robclark (subscriber, #74945)
[Link] (3 responses)
btw, do you know if anyone has confirmed that you can access/control the gpu from the ARM? It sorta seems this whole exercise would be pointless if not, but wasn't sure if you would be relying on r-pi foundation or someone to provide a special boot-but-no-gpu firmware blob?
Posted Mar 1, 2014 14:14 UTC (Sat)
by sperl (subscriber, #5657)
[Link]
So you just have to iomap the range into your process range (kernel/user) and then you can start making use of it by poking values to it.
Actually the arm and vPU both make use of the same memory - so there can be an easy means to communicate between the two via memory access..
The full list of documented/undocumented registers can get found at:
This GitHub page contains a lot of other valuable information as well - including an assembler and links to development of other tool chain components...
Posted Mar 1, 2014 15:01 UTC (Sat)
by excors (subscriber, #95769)
[Link] (1 responses)
Posted Mar 1, 2014 15:36 UTC (Sat)
by sperl (subscriber, #5657)
[Link]
So some scheme will need to get used for access to the clocks and memory...
Seems as if the vPU has some semaphore/synchronization asm-commands - but know how these would play together with synchronization with the arm side.
But it could be in principle be possible to run the vPU side with a minimal linux system and use ballooning to give/return memory between those two linux systems...
And then run on this linux the gpu handling code but with communication with the arm...
The biggest problem seems to be still the issue of not knowing how to setup SRAM access during the boot-phase, as the vPU is starting up the arm, so it needs to configure the memory prior to kick starting the arm side - from then on both sides need to work together - similar to what they do right now via those mailbox mechanism.
As soon as the SRAM issue is understood - uboot might be the first step in the direction of a dual linux system with a total of 3 cores...
Posted Mar 2, 2014 4:12 UTC (Sun)
by gdt (subscriber, #6284)
[Link]
I rather view the Android source as part of the specification: as if they said "here are the specifications written by our technical writers, and here's known-good source code for another operating system to answer further questions".
Broadcom releases SoC graphics driver source
Broadcom releases SoC graphics driver source
Broadcom releases SoC graphics driver source
Broadcom releases SoC graphics driver source
Similar to the dma registers being accessible starting from: 0x7e007000 or spi at: 0x7e204000.
https://github.com/hermanhermitage/videocoreiv/wiki/Regis...
(Note that the gpu registers are not listed yet as they have not been discovered so far...)
Broadcom releases SoC graphics driver source
Broadcom releases SoC graphics driver source
But some - like the gpio set/reset are accessible without synchronization, but others - like setting input/output direction or alternative modes are not free of potential races when accessed from both sides
That is also why only about half the dma channels are available to the arm (see the dma mask command line argument to the kernel when booting the arm - also available via mailbox commands)
(Not sure if there is a mmu on the vPU...)
Broadcom releases SoC graphics driver source