Skip to content

Fix ZCU board.py paddr_top constant.#705

Merged
Ivan-Velickovic merged 1 commit intomainfrom
callumb/fix_zcu102_top_paddr
Apr 16, 2026
Merged

Fix ZCU board.py paddr_top constant.#705
Ivan-Velickovic merged 1 commit intomainfrom
callumb/fix_zcu102_top_paddr

Conversation

@cazb2
Copy link
Copy Markdown
Contributor

@cazb2 cazb2 commented Apr 15, 2026

See line 2115 in zcu102.dts

PS. Why do we not parse the dts to retrieve information like this?

See line 2115 in zcu102.dts

PS. Why do we not parse the dts to retrieve information like this?

Signed-off-by: Callum <c.berry@student.unsw.edu.au>
@cazb2 cazb2 requested a review from Ivan-Velickovic April 15, 2026 11:56
@midnightveil
Copy link
Copy Markdown
Contributor

Was there a particular reason you are running into the issue with this paddr_top? The value we use does not necessarily have to be the actual paddr top.

And yes, sdfgen should really parse the DTS for this information.

But actually: it should not need to know the memory layout of the platform for RAM memories at all, otherwise we end up having to emulate the behaviour of the microkit tool. It's only because at the moment when we use sdfgen for generating the configs it expects to itself know the physical addresses of e.g. DMA buffer regions, when really that should be something we learn from microkit at runtime. This is why it doesn't work for x86 for example.

@cazb2
Copy link
Copy Markdown
Contributor Author

cazb2 commented Apr 16, 2026

Was there a particular reason you are running into the issue with this paddr_top? The value we use does not necessarily have to be the actual paddr top.

I assume it has to be <= the actual paddr top though...
When running the ethernet driver the board will hang upon accessing the "dma" region

And yes, sdfgen should really parse the DTS for this information.

But actually: it should not need to know the memory layout of the platform for RAM memories at all, otherwise we end up having to emulate the behaviour of the microkit tool. It's only because at the moment when we use sdfgen for generating the configs it expects to itself know the physical addresses of e.g. DMA buffer regions, when really that should be something we learn from microkit at runtime. This is why it doesn't work for x86 for example.

Yep I totally agree idk, on top of that my understanding is if we use an IOMMU then microkit would not have to treat "DMA" regions any differently to normal memory avoiding this contiguous physical address requirement issue.

@midnightveil
Copy link
Copy Markdown
Contributor

I assume it has to be <= the actual paddr top though...

Ah, right. Yes I read the commit backwards, you're decreasing it. Unsure how anything ever worked then on the ZCU...?

If we use an IOMMU then microkit would not have to treat "DMA" regions any differently to normal memory avoiding this contiguous physical address requirement issue.

This isn't really anything to do with the IOMMU at all, just information flow from the build system configuration to the runtime address layout of the system.

@cazb2
Copy link
Copy Markdown
Contributor Author

cazb2 commented Apr 16, 2026

I assume it has to be <= the actual paddr top though...

Ah, right. Yes I read the commit backwards, you're decreasing it. Unsure how anything ever worked then on the ZCU...?

If we use an IOMMU then microkit would not have to treat "DMA" regions any differently to normal memory avoiding this contiguous physical address requirement issue.

This isn't really anything to do with the IOMMU at all, just information flow from the build system configuration to the runtime address layout of the system.

I'm not sure I follow but I believe you.

I guess on a tangential thought, at the moment in our systems we are forced to set a physical address for dma regions simply because the microkit/capdl only guarantees contiguity for physical addressable memory, however this is theoretically avoidable with an iommu since it can virtualise the address space for devices hence making non-contiguous physical memory look contiguous and therefore avoid the need to handle this as a special case... potentially...

@midnightveil
Copy link
Copy Markdown
Contributor

I guess on as a tangential thought, at the moment in our systems we are forced to set a physical address for dma regions simply because the microkit/capdl only guarantees contiguity for physical addressable memory

This really should be an explicit control, I think.

@Ivan-Velickovic
Copy link
Copy Markdown
Collaborator

Most of the time you don't care where the physical memory actually is, you just want a contiguous region. The only way to do that in the Microkit right now is to use setvar with region_paddr but that's not ideal for our case here where we have the configuration structs.

I think it's becoming clear that there needs to be a more generic way to give user-space the run-time determined value of things like memory region physical addresses. On x86 it's still more complicated because we now have to have a way for the capDL initialiser to also pass this kind of information at run-time to Microkit which is a bit annoying.

@Ivan-Velickovic
Copy link
Copy Markdown
Collaborator

Ah, right. Yes I read the commit backwards, you're decreasing it. Unsure how anything ever worked then on the ZCU...?

ZCU102 was only tested for timer/serial I believe where there's no DMA used so that's why it didn't get noticed I assume.

@Ivan-Velickovic
Copy link
Copy Markdown
Collaborator

And yes, sdfgen should really parse the DTS for this information.

The whole paddr_top thing was just a hack and I never got around to fixing it properly.

@Ivan-Velickovic Ivan-Velickovic merged commit 83276df into main Apr 16, 2026
14 checks passed
@Ivan-Velickovic Ivan-Velickovic deleted the callumb/fix_zcu102_top_paddr branch April 16, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants