Configuring the gem0 to petalinux and gem3 to bare metal application

bala

New Member
Joined
Aug 21, 2025
Messages
4
Reaction score
0
Credits
41
Hi,



I’m working on a Zynq UltraScale+ MPSoC project using PetaLinux 2020.1. I’m trying to run PetaLinux on 3 of the A53 cores while running a bare-metal application on the 4th core. In my setup, PetaLinux uses GEM0 for networking, and the bare-metal app uses GEM3, which is configured to use lwIP in Vitis. I’ve set this up in the petalinux project, I’ve disabled GEM3 in the device tree using (status = "disabled";) in system-user.dtsi.



I generate the BOOT.BIN with FSBL, PMUFW, ATF, the bare-metal ELF, and the Linux components (u-boot, etc.). What I’m seeing is that the bare-metal app comes up first and I’m able to ping it through GEM3 just fine. But once Linux starts booting beyond U-Boot, I lose the ping. If I stop at the U-Boot prompt, the ping continues to work. So it looks like something in Linux is still interfering with GEM3, even though it’s disabled in the device tree. Has anyone seen this before or know what might be going on? Is there anything else I should do to stop Linux or U-Boot from touching GEM3?



If anyone have experience in configuring this help me out. If you want further more details and boot logs means I am ready to provide.



Regards,

Bala
 

Attachments



I see your MDIO bus in the uboot_log.
Is that bus shared?

No, I haven't seen this as I haven't tried it. Sorry.

Whatever it is that Linux isn't configured to or adjusted for (just my thinking) that your suspicious of, is most likely the culprit.
Sometimes you have to adjust things however don't forget to copy or write down the original config before you change it.

Since "status =disable" isn't working you may have to try other practices.

-:- Remove GEM3 from Uboot build.
-:-Use #undef to disable the features of GEM3 initialization. An example to remove network support.
Code:
#undef CONFIG_DRIVER_TI_EMAC
-:- Rebuild / compile Uboot after the changes
-:- Disable GEM3 in the kernel if it's supported.
Check kernel support for dynamic Device Trees.Some kernels support modifying the device tree at runtime.
If dynamic device trees are supported, you might be able to disable GEM3 via kernel boot arguments. Just a few ideas.

See here:

I'm not sure if any of our Generals or Captains here are dabbling in a gem project with Peta linux as you are. So.....I've flagged them in the hope that they may know what the culprit is and how to fix it-

@osprey, @wizardfromoz , @KGIII or @f33dm3bits may know.

Cheers,
Alex
 
Hi Alex,

I have removed the entire node of gem3 from device tree and I have verified that in the dts file.

I see your MDIO bus in the uboot_log.
Is that bus shared?

The MDIO bus is configured with gem0 (MDIO0) and in gem3 MDIO3 is unselected, since both are having the same MDIO lines (76 & 77).
1755841157874.png



Check kernel support for dynamic Device Trees.Some kernels support modifying the device tree at runtime.
Device tree overlay is already enabled in the kernel.

what I am suspecting is this because of the MDIO lines?

Regards,
Bala
 
@osprey, @wizardfromoz , @KGIII or @f33dm3bits may know.
This looks far from a main stream Linux distributions so I doubt anyone here will have had experience with this and be able to help, from what I can tell is for a development kit for embedded systems which I have never done anything with.
 
Hi Alex,

I have removed the entire node of gem3 from device tree and I have verified that in the dts file.

I see your MDIO bus in the uboot_log.
Is that bus shared?

The MDIO bus is configured with gem0 (MDIO0) and in gem3 MDIO3 is unselected, since both are having the same MDIO lines (76 & 77).
View attachment 27447


Check kernel support for dynamic Device Trees.Some kernels support modifying the device tree at runtime.
Device tree overlay is already enabled in the kernel.

what I am suspecting is this because of the MDIO lines?

Regards,
Bala
Have you gotten errors thus rendering the GEM3 unavailable in Linux?

If so, enable only the GEM in the MDIO bus tree and disable the others.
I see that you have gem3 already checked.

If your MDIO isn't configured correctly and I understand this effectively, it will lead to gems not functioning properly <or> it won't show as a active internet interface in Linux.

If your Gem3 for example is relying on a PHY accessed through GEMS MDIO and GEM0 is disabled, Gem3 won't work.

As you are probably already aware that the kernels Ethernet driver/module interacts with your MDIO interface and manages the PHY's, you'll need correctly implemented MDIO accesses with the driver. Is your network interface stable?
Maybe give the mdio-tools a spin?

Maybe join the developers on Git Hub to rectify this development. It appears that these configurations can be tricky to manage as I have thus so far read and seen. :)

 
If so, enable only the GEM in the MDIO bus tree and disable the others.
I see that you have gem3 already checked
Hi Alex,

I haven't got any errors of gem3 in linux. The network interace lwip is stable and I am able to ping continously.

Regards,
Bala
 
Hi Alex,

I haven't got any errors of gem3 in linux. The network interace lwip is stable and I am able to ping continously.

Regards,
Bala
Good to hear.
What did you change?
 
Hi Alex,
Sorry for the inconvenience, I meant lwip is stable when I am programming only the bare metal. Still I am having the same problem.
 
Hi Alex,
Sorry for the inconvenience, I meant lwip is stable when I am programming only the bare metal. Still I am having the same problem.
Ok, thanks.

I'm sorry I'm not sure what else you could try to fix/change the same problem.
It might be worth a shot to see what the devs are saying on Git Hub or join a discussion to ask what they think.
 


Follow Linux.org

Staff online


Top