setting MAC addresses on board based on ls1043ardb

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

setting MAC addresses on board based on ls1043ardb

Jump to solution
1,502 Views
endrunner_smw
Contributor III

Have a board based on the ls1043ardb and was given a set of uboot commands for modifying the mac addresses for the ethernet ports. The addresses are stored in EEPROM in the NXID format.

The ls1043ardb has 7 ethernet ports. Think 4 SGMII, 2 RGMII, 1 SFP. So we have 7 mac entries in the eeprom. Our board however only has 4 ports and the macs they get assigned are disjointed/not sequential. So if in Uboot I do mac num 4 (instead of 7) it just truncates the list and my devices don't properly get assigned an address.

How/Where do the ethernet devices get assigned their MAC addresses?

Should I attempt to find & rearrange the order of the ethernet devices so they are sequential, or just leave it as is and make a note that the other MAC addresses are extraneous?

I think FMan might be affecting how the devices are listed and which MAC addresses they get associated with. Is this the case?

0 Kudos
Reply
1 Solution
1,389 Views
endrunner_smw
Contributor III

Discovered the reason my changes were not taking effect. My aliases were not taking effect because there were other aliases conflicting.

I did not modify fsl-ls1043-post.dtsi. I did however have to modify my specific board .dts(disable ports), fsl-ls1043a.dtsi (source of conflicting aliases), and also the qoriq-dpaa-eth.dtsi(reorder port probing).

View solution in original post

0 Kudos
Reply
4 Replies
1,411 Views
LFGP
NXP TechSupport
NXP TechSupport

Once you have reconfigured the DTS it will be necessary to recompile the DTS ir order to take affect your new settings. Please follow the steps showed in the application note file shared before.

0 Kudos
Reply
1,478 Views
LFGP
NXP TechSupport
NXP TechSupport

Dear @endrunner_smw ,

you are right regarding the FMAN, if you need to arrange the ports it will be necessary to modify the DTS, use the next link to have an idea about how they are arranged.

https://github.com/nxp-qoriq/linux/blob/lf-6.1.y/arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi

LFGP_0-1728066514516.png

 

and then modify the .dts file according your needs 

https://github.com/nxp-qoriq/linux/blob/lf-6.1.y/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts

may be you would like to download an application note regarding "Introduction to Device Trees" 

https://www.nxp.com/docs/en/application-note/AN5125.pdf

 

0 Kudos
Reply
1,462 Views
endrunner_smw
Contributor III

@LFGPthanks for the reply,

I tried setting aliases like eth0 = &enet2, eth1 = &enet3, eth2 = &enet1, eth3 = &enet6

However, this doesn't appear to do what I want.

I tried swapping the labels around in fsl-ls1043-post.dtsi, but this also didn't do what I want.

The ports I'm not using are disabled in their individual nodes. Do I need to delete the nodes?

With setting the max number of ports to 4 using the 'mac ports 4' command in uboot since this truncates the list in the eeprom when booting linux I get the following error:

[ 1.162139] fsl_mac 1af0000.ethernet: of_get_mac_address(ethernet@f0000) failed
[ 1.169459] fsl_mac: probe of 1af0000.ethernet failed with error -22

However, if I put max ports back up to 7 with 'mac ports 7' in uboot this error goes away.

I believe this all has to do with order/indexing. It seems like fsl_mac is probing the interface and checking for the eeprom but with the max ports being set to 4 instead of 7 it never gets to the final (7th) iteration 6. So it can't find the mac address and fails with this error.

Could you provide either additional detail or an example where the ports are sequential and use the first 4 mac entries in the eeprom?

0 Kudos
Reply
1,390 Views
endrunner_smw
Contributor III

Discovered the reason my changes were not taking effect. My aliases were not taking effect because there were other aliases conflicting.

I did not modify fsl-ls1043-post.dtsi. I did however have to modify my specific board .dts(disable ports), fsl-ls1043a.dtsi (source of conflicting aliases), and also the qoriq-dpaa-eth.dtsi(reorder port probing).

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1965884%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Esetting%20MAC%20addresses%20on%20board%20based%20on%20ls1043ardb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1965884%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHave%20a%20board%20based%20on%20the%20ls1043ardb%20and%20was%20given%20a%20set%20of%20uboot%20commands%20for%20modifying%20the%20mac%20addresses%20for%20the%20ethernet%20ports.%20The%20addresses%20are%20stored%20in%20EEPROM%20in%20the%20NXID%20format.%3C%2FP%3E%3CP%3EThe%20ls1043ardb%20has%207%20ethernet%20ports.%20Think%204%20SGMII%2C%202%20RGMII%2C%201%20SFP.%20So%20we%20have%207%20mac%20entries%20in%20the%20eeprom.%20Our%20board%20however%20only%20has%204%20ports%20and%20the%20macs%20they%20get%20assigned%20are%20disjointed%2Fnot%20sequential.%20So%20if%20in%20Uboot%20I%20do%20mac%20num%204%20(instead%20of%207)%20it%20just%20truncates%20the%20list%20and%20my%20devices%20don't%20properly%20get%20assigned%20an%20address.%3C%2FP%3E%3CP%3EHow%2FWhere%20do%20the%20ethernet%20devices%20get%20assigned%20their%20MAC%20addresses%3F%3C%2FP%3E%3CP%3EShould%20I%20attempt%20to%20find%20%26amp%3B%20rearrange%20the%20order%20of%20the%20ethernet%20devices%20so%20they%20are%20sequential%2C%20or%20just%20leave%20it%20as%20is%20and%20make%20a%20note%20that%20the%20other%20MAC%20addresses%20are%20extraneous%3F%3C%2FP%3E%3CP%3EI%20think%20FMan%20might%20be%20affecting%20how%20the%20devices%20are%20listed%20and%20which%20MAC%20addresses%20they%20get%20associated%20with.%20Is%20this%20the%20case%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1970298%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20setting%20MAC%20addresses%20on%20board%20based%20on%20ls1043ardb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1970298%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDiscovered%20the%20reason%20my%20changes%20were%20not%20taking%20effect.%20My%20aliases%20were%20not%20taking%20effect%20because%20there%20were%20other%20aliases%20conflicting.%3C%2FP%3E%3CP%3EI%20did%20not%20modify%20fsl-ls1043-post.dtsi.%20I%20did%20however%20have%20to%20modify%20my%20specific%20board%20.dts(disable%20ports)%2C%20fsl-ls1043a.dtsi%20(source%20of%20conflicting%20aliases)%2C%20and%20also%20the%20qoriq-dpaa-eth.dtsi(reorder%20port%20probing).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1968237%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20setting%20MAC%20addresses%20on%20board%20based%20on%20ls1043ardb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1968237%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EOnce%20you%20have%20reconfigured%20the%20DTS%20it%20will%20be%20necessary%20to%20recompile%20the%20DTS%20ir%20order%20to%20take%20affect%20your%20new%20settings.%20Please%20follow%20the%20steps%20showed%20in%20the%20application%20note%20file%20shared%20before.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1967364%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20setting%20MAC%20addresses%20on%20board%20based%20on%20ls1043ardb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1967364%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F203371%22%20target%3D%22_blank%22%3E%40LFGP%3C%2FA%3Ethanks%20for%20the%20reply%2C%3C%2FP%3E%3CP%3EI%20tried%20setting%20aliases%20like%20eth0%20%3D%20%26amp%3Benet2%2C%20eth1%20%3D%20%26amp%3Benet3%2C%20eth2%20%3D%20%26amp%3Benet1%2C%20eth3%20%3D%20%26amp%3Benet6%3C%2FP%3E%3CP%3EHowever%2C%20this%20doesn't%20appear%20to%20do%20what%20I%20want.%3C%2FP%3E%3CP%3EI%20tried%20swapping%20the%20labels%20around%20in%20fsl-ls1043-post.dtsi%2C%20but%20this%20also%20didn't%20do%20what%20I%20want.%3C%2FP%3E%3CP%3EThe%20ports%20I'm%20not%20using%20are%20disabled%20in%20their%20individual%20nodes.%20Do%20I%20need%20to%20delete%20the%20nodes%3F%3C%2FP%3E%3CP%3EWith%20setting%20the%20max%20number%20of%20ports%20to%204%20using%20the%20'mac%20ports%204'%20command%20in%20uboot%20since%20this%20truncates%20the%20list%20in%20the%20eeprom%20when%20booting%20linux%20I%20get%20the%20following%20error%3A%3C%2FP%3E%3CP%3E%5B%201.162139%5D%20fsl_mac%201af0000.ethernet%3A%20of_get_mac_address(ethernet%40f0000)%20failed%3CBR%20%2F%3E%5B%201.169459%5D%20fsl_mac%3A%20probe%20of%201af0000.ethernet%20failed%20with%20error%20-22%3C%2FP%3E%3CP%3EHowever%2C%20if%20I%20put%20max%20ports%20back%20up%20to%207%20with%20'mac%20ports%207'%20in%20uboot%20this%20error%20goes%20away.%3C%2FP%3E%3CP%3EI%20believe%20this%20all%20has%20to%20do%20with%20order%2Findexing.%20It%20seems%20like%20fsl_mac%20is%20probing%20the%20interface%20and%20checking%20for%20the%20eeprom%20but%20with%20the%20max%20ports%20being%20set%20to%204%20instead%20of%207%20it%20never%20gets%20to%20the%20final%20(7th)%20iteration%206.%20So%20it%20can't%20find%20the%20mac%20address%20and%20fails%20with%20this%20error.%3C%2FP%3E%3CP%3ECould%20you%20provide%20either%20additional%20detail%20or%20an%20example%20where%20the%20ports%20are%20sequential%20and%20use%20the%20first%204%20mac%20entries%20in%20the%20eeprom%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1967061%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20setting%20MAC%20addresses%20on%20board%20based%20on%20ls1043ardb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1967061%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDear%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F190896%22%20target%3D%22_blank%22%3E%40endrunner_smw%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3Eyou%20are%20right%20regarding%20the%20FMAN%2C%20if%20you%20need%20to%20arrange%20the%20ports%20it%20will%20be%20necessary%20to%20modify%20the%20DTS%2C%20use%20the%20next%20link%20to%20have%20an%20idea%20about%20how%20they%20are%20arranged.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-qoriq%2Flinux%2Fblob%2Flf-6.1.y%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Ffsl-ls1043-post.dtsi%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fnxp-qoriq%2Flinux%2Fblob%2Flf-6.1.y%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Ffsl-ls1043-post.dtsi%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22LFGP_0-1728066514516.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22LFGP_0-1728066514516.png%22%20style%3D%22width%3A%20327px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F302752iDF6D291A538FB9CF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22LFGP_0-1728066514516.png%22%20alt%3D%22LFGP_0-1728066514516.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3Eand%20then%20modify%20the%20.dts%20file%20according%20your%20needs%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-qoriq%2Flinux%2Fblob%2Flf-6.1.y%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Ffsl-ls1043a-rdb.dts%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fnxp-qoriq%2Flinux%2Fblob%2Flf-6.1.y%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Ffsl-ls1043a-rdb.dts%3C%2FA%3E%3C%2FP%3E%0A%3CP%3Emay%20be%20you%20would%20like%20to%20download%20an%20application%20note%20regarding%20%22Introduction%20to%20Device%20Trees%22%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN5125.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN5125.pdf%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E