PFE2 and PFE0 both using RGMII at the same time

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PFE2 and PFE0 both using RGMII at the same time

345 Views
vrathiraj
Contributor I

Hi

Working on a custom board, with the S32G3 where we have all 3 PFE controllers routed to 3 different phys using RGMII

I was able to get PFE0 and PFE1 working by modifying the TFA, and Linux kernel DTB of the RDB3
After getting these two working we wanted to bring up PFE2 the same way when I modify the linux DTB with the proper pinouts for RGMII and MDIO and I boot the device I can see the phy via ethtool but I cant communicate to it via ping

When I try to update the TFA with the proper RGMII pins, the boot process hangs after it gets to the point where it shows DRAM size

I did delete the USB pinouts from the TFA and linux kernel DTB as its muxed with PFE2 pins
i did disabled USBotg from the TFA and linux kernel DTB, but as soon as i modify the pins for pfe2_pins it hangs as described

Just wondering if there is any thoughts on why this is happening. Also wondering if all 3 RGMII PFE controllers can be used

Any help on this would be great

0 Kudos
Reply
4 Replies

329 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @vrathiraj 

Thanks for your post.

1. 3 PFE RGMII is supported.

2. May I know which version BSP you are working with?

3. Would you mind sharing the u-boot env used during the test?

 

BR

Chenyin 

0 Kudos
Reply

305 Views
vrathiraj
Contributor I

Current BSP version on the board: bsp46.0-2.10.25-3-g0f10410d1-dirty
Current U-Boot version: U-Boot 2022.04-dirty

Also, some more notes on the testing: I was able to correctly change the pin mapping for all the PFE ports in the Linux kernel DTB, and all ports are working correctly when using Linux. Therefore, the pin mapping should be correct, and the port configuration should also be correct.

I can communicate with all three PFE ports in Linux. However, when I apply those exact changes to the DTSI files for TF-A, it still hangs at the DRAM section during boot.

What I have done currently is not declare the PFE2 MDIO and PFE2 pins in the PFE pinctrl DT in TF-A. I also declared pfe_netif2 as disabled and pfe2_mdio as disabled. When I do all of this in TF-A, I can get through boot and into Linux. Since the Linux kernel DTB has the correct pin mapping, which is the same as TF-A, I can still use all three PFE ports.

I am just very confused about why TF-A is still hanging when it seems to work fine with the Linux DTB.

Just to clarify, I disabled USB OTG and deleted the pin declaration in TF-A in both scenarios: where it hangs and where it goes through boot.

0 Kudos
Reply

228 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @vrathiraj 

Thanks for your reply.

Previously I ever supported one customer with similar case, 3 PFE RGMII works fine in kernel, but we had not tested it in the uboot.

Since you had disabled USB and modified the corresponding pins, not sure if you had correctly set the PFE2 related clocks? 

Furthermore, you may try enabling the DEBUG output in TFA to help to located the accurate code where caused hung, to help to further debug on the issues.

 

BR

Chenyin 

0 Kudos
Reply

201 Views
vrathiraj
Contributor I

Hi @chenyin_h 

I found the issue in the u-boot repo in file /drivers/net/nxp_pfeng/pfeng_mdio.c

the pfeng_mdio_bind function had and if condition when id >= PFENG_EMAC2 (value 2) as the bind counter limit. Changing this to PFENG_EMACS_COUNT allowed me to continue with booting and use all 3 pfe ports in uboot below is the function and i highlighted the change

static int pfeng_mdio_bind(struct udevice *dev)
{
    static int id;
    char name[16];
    int ret;

    if (id >= PFENG_EMACS_COUNT) { //this was PFENG_EMAC2 orginally 
        dev_err(dev, "EMAC MDIO id out of range\n");
        return -ENODEV;
    }

    ret = snprintf(name, sizeof(name), "pfeng-mdio#%u", id++);
    if (ret >= sizeof(name) || ret < 0)
        return -ENOSPC;

    return device_set_name(dev, name);
}
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2356307%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EPFE2%20and%20PFE0%20both%20using%20RGMII%20at%20the%20same%20time%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2356307%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%3CBR%20%2F%3E%3CBR%20%2F%3EWorking%20on%20a%20custom%20board%2C%20with%20the%20S32G3%20where%20we%20have%20all%203%20PFE%20controllers%20routed%20to%203%20different%20phys%20using%20RGMII%3CBR%20%2F%3E%3CBR%20%2F%3EI%20was%20able%20to%20get%20PFE0%20and%20PFE1%20working%20by%20modifying%20the%20TFA%2C%20and%20Linux%20kernel%20DTB%20of%20the%20RDB3%3CBR%20%2F%3EAfter%20getting%20these%20two%20working%20we%20wanted%20to%20bring%20up%20PFE2%20the%20same%20way%20when%20I%20modify%20the%20linux%20DTB%20with%20the%20proper%20pinouts%20for%20RGMII%20and%20MDIO%20and%20I%20boot%20the%20device%20I%20can%20see%20the%20phy%20via%20ethtool%20but%20I%20cant%20communicate%20to%20it%20via%20ping%3CBR%20%2F%3E%3CBR%20%2F%3EWhen%20I%20try%20to%20update%20the%20TFA%20with%20the%20proper%20RGMII%20pins%2C%20the%20boot%20process%20hangs%20after%20it%20gets%20to%20the%20point%20where%20it%20shows%20DRAM%20size%3CBR%20%2F%3E%3CBR%20%2F%3EI%20did%20delete%20the%20USB%20pinouts%20from%20the%20TFA%20and%20linux%20kernel%20DTB%20as%20its%20muxed%20with%20PFE2%20pins%3CBR%20%2F%3Ei%20did%20disabled%20USBotg%20from%20the%20TFA%20and%20linux%20kernel%20DTB%2C%20but%20as%20soon%20as%20i%20modify%20the%20pins%20for%20pfe2_pins%20it%20hangs%20as%20described%3CBR%20%2F%3E%3CBR%20%2F%3EJust%20wondering%20if%20there%20is%20any%20thoughts%20on%20why%20this%20is%20happening.%20Also%20wondering%20if%20all%203%20RGMII%20PFE%20controllers%20can%20be%20used%3CBR%20%2F%3E%3CBR%20%2F%3EAny%20help%20on%20this%20would%20be%20great%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2356809%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PFE2%20and%20PFE0%20both%20using%20RGMII%20at%20the%20same%20time%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2356809%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECurrent%20BSP%20version%20on%20the%20board%3A%20bsp46.0-2.10.25-3-g0f10410d1-dirty%3CBR%20%2F%3ECurrent%20U-Boot%20version%3A%20U-Boot%202022.04-dirty%3C%2FP%3E%3CP%3EAlso%2C%20some%20more%20notes%20on%20the%20testing%3A%20I%20was%20able%20to%20correctly%20change%20the%20pin%20mapping%20for%20all%20the%20PFE%20ports%20in%20the%20Linux%20kernel%20DTB%2C%20and%20all%20ports%20are%20working%20correctly%20when%20using%20Linux.%20Therefore%2C%20the%20pin%20mapping%20should%20be%20correct%2C%20and%20the%20port%20configuration%20should%20also%20be%20correct.%3C%2FP%3E%3CP%3EI%20can%20communicate%20with%20all%20three%20PFE%20ports%20in%20Linux.%20However%2C%20when%20I%20apply%20those%20exact%20changes%20to%20the%20DTSI%20files%20for%20TF-A%2C%20it%20still%20hangs%20at%20the%20DRAM%20section%20during%20boot.%3C%2FP%3E%3CP%3EWhat%20I%20have%20done%20currently%20is%20not%20declare%20the%20PFE2%20MDIO%20and%20PFE2%20pins%20in%20the%20PFE%20pinctrl%20DT%20in%20TF-A.%20I%20also%20declared%20pfe_netif2%20as%20disabled%20and%20pfe2_mdio%20as%20disabled.%20When%20I%20do%20all%20of%20this%20in%20TF-A%2C%20I%20can%20get%20through%20boot%20and%20into%20Linux.%20Since%20the%20Linux%20kernel%20DTB%20has%20the%20correct%20pin%20mapping%2C%20which%20is%20the%20same%20as%20TF-A%2C%20I%20can%20still%20use%20all%20three%20PFE%20ports.%3C%2FP%3E%3CP%3EI%20am%20just%20very%20confused%20about%20why%20TF-A%20is%20still%20hanging%20when%20it%20seems%20to%20work%20fine%20with%20the%20Linux%20DTB.%3C%2FP%3E%3CP%3EJust%20to%20clarify%2C%20I%20disabled%20USB%20OTG%20and%20deleted%20the%20pin%20declaration%20in%20TF-A%20in%20both%20scenarios%3A%20where%20it%20hangs%20and%20where%20it%20goes%20through%20boot.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2356543%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PFE2%20and%20PFE0%20both%20using%20RGMII%20at%20the%20same%20time%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2356543%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F260765%22%20target%3D%22_blank%22%3E%40vrathiraj%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20post.%3C%2FP%3E%0A%3CP%3E1.%203%20PFE%20RGMII%20is%20supported.%3C%2FP%3E%0A%3CP%3E2.%20May%20I%20know%20which%20version%20BSP%20you%20are%20working%20with%3F%3C%2FP%3E%0A%3CP%3E3.%20Would%20you%20mind%20sharing%20the%20u-boot%20env%20used%20during%20the%20test%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EChenyin%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2358204%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PFE2%20and%20PFE0%20both%20using%20RGMII%20at%20the%20same%20time%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2358204%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F260765%22%20target%3D%22_blank%22%3E%40vrathiraj%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20reply.%3C%2FP%3E%0A%3CP%3EPreviously%20I%20ever%20supported%20one%20customer%20with%20similar%20case%2C%203%20PFE%20RGMII%20works%20fine%20in%20kernel%2C%20but%20we%20had%20not%20tested%20it%20in%20the%20uboot.%3C%2FP%3E%0A%3CP%3ESince%20you%20had%20disabled%20USB%20and%20modified%20the%20corresponding%20pins%2C%20not%20sure%20if%20you%20had%20correctly%20set%20the%20PFE2%20related%20clocks%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFurthermore%2C%20you%20may%20try%20enabling%20the%20DEBUG%20output%20in%20TFA%20to%20help%20to%20located%20the%20accurate%20code%20where%20caused%20hung%2C%20to%20help%20to%20further%20debug%20on%20the%20issues.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EChenyin%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2358779%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PFE2%20and%20PFE0%20both%20using%20RGMII%20at%20the%20same%20time%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2358779%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F24163%22%20target%3D%22_blank%22%3E%40chenyin_h%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EI%20found%20the%20issue%20in%20the%20u-boot%20repo%20in%20file%20%2Fdrivers%2Fnet%2Fnxp_pfeng%2Fpfeng_mdio.c%3CBR%20%2F%3E%3CBR%20%2F%3Ethe%20pfeng_mdio_bind%20function%20had%20and%20if%20condition%20when%20id%20%26gt%3B%3D%26nbsp%3BPFENG_EMAC2%20(value%202)%20as%20the%20bind%20counter%20limit.%20Changing%20this%20to%20PFENG_EMACS_COUNT%20allowed%20me%20to%20continue%20with%20booting%20and%20use%20all%203%20pfe%20ports%20in%20uboot%20below%20is%20the%20function%20and%20i%20highlighted%20the%20change%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CDIV%3E%3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