Minimal GPU setup

Christian König christian.koenig at amd.com
Sun Feb 6 16:57:24 UTC 2022


Hi Amol,

Am 05.02.22 um 10:47 schrieb Amol:
> Hello,
>
> I am learning to program Radeon HD 7350 by reading the radeon
> driver source in Linux, and the guides/manuals from AMD.
>
> I understand the general flow of initialization the driver performs. I
> have also been able to understand and re-implement the ATOM
> BIOS virtual machine.

That sounds like you already came pretty far.

> I am trying to program the device up from scratch (i.e. bare-metal).
> Do I need to perform all those steps that the driver does? Reading
> the evergreen_gpu_init function is demotivating; it initializes many
> fields and registers which I suspect may not be required for a minimal
> setup.
>
> Is posting the BIOS and loading the microcode enough to get me started
> with running basic tasks (DMA transfers, simple packet processing, etc.)?

Well yes and no. As bare minimum you need the following:
1. Firmware loading
2. Memory management
3. Ring buffer setup
4. Hardware initialization

When that is done you can write commands into the ring buffers of the CP 
or SDMA and see if they are executed (see the *_ring_test() functions in 
the driver). SDMA is usually easier to get working.

When you got that working you can worry about IB (indirect buffers) 
which are basically subroutines calls written into the ring buffers.

Most commands (like copy from A to B, fill something, write value X to 
memory or write X into register Y) can be used from the ring buffers 
directly, but IIRC some context switching commands which are part of the 
rendering process require special handling.

But keep in mind that all of this will just be horrible slow because the 
ASIC runs with the bootup clocks which are something like 100Mhz or even 
only 17Mhz on very old models. To change that you need to implement 
power management, interrupt handling etc etc....

Good luck,
Christian.

>
> Thanks,
> Amol



More information about the amd-gfx mailing list