LS1012a ethernet not coming when we use as internal PHY with marvel switch

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

LS1012a ethernet not coming when we use as internal PHY with marvel switch

Jump to solution
1,668 Views
gkrishna
Contributor II

Hi,

We are using ls1012A board and the eth0 and eth1 SGMII is connected the Marvell swithch, we try to use the internal phys and not the external phys, what is the device tree changes required, whatever we change in the device tree, the child nodes are reflecting but the drive actually not getting the property during probe.

&pfe {
status = "okay";
ethernet@0 {
compatible = "fsl,pfe-gemac-port";
#address-cells = <1>;
#size-cells = <0>;
reg = < 0x0 >; /* GEM_ID */
fsl,gemac-bus-id = <0x0>; /* BUS_ID */
fsl,gemac-phy-id = <0x2>; /* PHY_ID */
fsl,mdio-mux-val = <0x0>;
local-mac-address = [ 00 1A 2B 3C 4D 5E ];
phy-mode = "internal";
fsl,pfe-gemac-if-name = "eth0";
fsl,pfe-phy-if-flags = <0x0>;
fsl,pfe-gemac-mode = <0x1B00>; /* GEMAC_SW_CONF | GEMAC_SW_FULL_DUPLEX | GEMAC_SW_SPEED_1G */

mdio@0 {
reg = <0x1>; /* enabled/disabled */
fsl,mdio-phy-mask = <0xFFFFFFF9>;
};
};

ethernet@1 {
compatible = "fsl,pfe-gemac-port";
#address-cells = <1>;
#size-cells = <0>;
reg = < 0x1 >; /* GEM_ID */
fsl,gemac-bus-id = < 0x1 >; /* BUS_ID */
fsl,gemac-phy-id = < 0x1 >; /* PHY_ID */
fsl,mdio-mux-val = <0x0>;
local-mac-address = [ 00 AA BB CC DD EE ];
phy-mode = "internal";
fsl,pfe-gemac-if-name = "eth1";
fsl,pfe-phy-if-flags = <0x0>;
fsl,pfe-gemac-mode = <0x1B00>; /* GEMAC_SW_CONF | GEMAC_SW_FULL_DUPLEX | GEMAC_SW_SPEED_1G */
mdio@0 {
reg = <0x0>; /* enabled/disabled */
fsl,mdio-phy-mask = <0xFFFFFFF9>;
};
};
};

The driver code in pfe_ls1012a_platform.c

static int pfe_get_gemac_if_properties(struct device_node *gem,
int port,
struct ls1012a_pfe_platform_data *pdata)
{
struct device_node *phy_node = NULL;
int size;
int phy_id = 0;
const u32 *addr;
const u8 *mac_addr;

addr = of_get_property(gem, "reg", &size);
if (addr)
port = be32_to_cpup(addr);
else
goto err;

The above during the probe, it return err, I dont know why it is not getting the property, we could able to see the nodes in device under /proc/ but we dont know why it is failing, we have faked the DTS changes inside probe code in driver and all the success is happening, but the device is not up.

My logs with my debug MSG

132.478084] pfe: module is from the staging directory, the quality is unknown, you have been warned.
[ 132.483719] bus: 'platform': add driver pfe
[ 132.483821] bus: 'platform': driver_probe_device: matched device 4000000.pfe with driver pfe
[ 132.483832] bus: 'platform': really_probe: probing driver pfe with device 4000000.pfe
[ 132.484060] RAMA FULL NAME pfe-tmu-firmware
[ 132.484062] RAMA pfe_get_gemac_if_properties start
[ 132.484065] RAMA DTS FAIL
[ 132.484068] RAMA pfe_get_gemac_if_properties IF mac check
[ 132.484070] RAMA MAC IF PASS
[ 132.484072] RAMA pfe_get_gemac_if_properties if end new
[ 132.484074] RAMA pfe_get_gemac_if_properties ELSE end new
[ 132.484079] RAMA II value 0
[ 132.484081] RAMA FULL NAME pfe-class-firmware
[ 132.484083] RAMA pfe_get_gemac_if_properties start
[ 132.484086] RAMA DTS FAIL
[ 132.484496] RAMA pfe_get_gemac_if_properties ELSEi mac
[ 132.484498] RAMA MAC ELSE PASS
[ 132.484501] RAMA pfe_get_gemac_if_properties ELSE end new
[ 132.484504] RAMA II value 1
[ 132.484549] device: 'wakeup2': device_add
[ 132.485074] cbus_baseaddr: ffff800013000000, ddr_baseaddr: ffff000003400000, ddr_phys_baseaddr: 83400000, ddr_size: c00000
[ 132.485080] pfe_hw_init
[ 132.485083] CLASS version: 20
[ 132.485085] TMU version: 1011231
[ 132.485088] BMU1 version: 21
[ 132.485090] BMU2 version: 21
[ 132.485093] EGPI1 version: 50
[ 132.485095] EGPI2 version: 50
[ 132.485097] HGPI version: 50
[ 132.485100] HIF version: 10
[ 132.485102] HIF NOPCY version: 10
[ 132.485107] bmu_init(1) done
[ 132.485111] bmu_init(2) done
[ 132.487352] class_init() done
[ 132.497754] tmu_init() done
[ 132.497760] gpi_init(1) done
[ 132.497765] gpi_init(2) done
[ 132.497769] gpi_init(hif) done
[ 132.497771] bmu_enable(1) done
[ 132.497773] bmu_enable(2) done
[ 132.497777] pfe_hif_lib_init
[ 132.497919] pfe_hif_init
[ 132.497922] pfe_hif_alloc_descr
[ 132.498247] pfe_hif_init_buffers
[ 132.498964] pfe_firmware_init
[ 132.503290] pfe_load_elf
[ 132.503303] pe_load_ddr_section: load address(3fb0000) and elf file address(ffff800010f4b000) rcvd
[ 132.534656] PFE binary version: pfe_ls1012a_slowpath_10
[ 132.534660] pfe_load_elf
[ 132.535635] pfe_ctrl_init
[ 132.535639] pfe_ctrl_init finished
[ 132.535641] pfe_eth_init
[ 132.535656] pfe 4000000.pfe: pfe_eth_mdio_init: mdc_div: 64, phy_mask: fffffff9
[ 132.535662] RAMA new node  ��;
[ 132.535664] RAMA news mdio_info id 0
[ 132.535675] device: 'ls1012a-0': device_add
[ 132.535735] PM: Adding info for No Bus:ls1012a-0
[ 132.544680] device: 'ls1012a-0:01': device_add
[ 132.544731] bus: 'mdio_bus': add device ls1012a-0:01
[ 132.544756] PM: Adding info for mdio_bus:ls1012a-0:01
[ 132.553809] device: 'ls1012a-0:02': device_add
[ 132.553854] bus: 'mdio_bus': add device ls1012a-0:02
[ 132.553880] PM: Adding info for mdio_bus:ls1012a-0:02
[ 132.554000] libphy: ls1012a MDIO Bus: probed
[ 132.554003] RAMA MDIO ELSE
[ 132.554024] pfe 4000000.pfe: pfe_eth_mdio_init: mdc_div: 64, phy_mask: fffffff9
[ 132.554032] RAMA new node ���;
[ 132.554033] RAMA news mdio_info id 1
[ 132.554041] device: 'ls1012a-1': device_add
[ 132.554079] PM: Adding info for No Bus:ls1012a-1
[ 132.563374] device: 'ls1012a-1:01': device_add
[ 132.563418] bus: 'mdio_bus': add device ls1012a-1:01
[ 132.563444] PM: Adding info for mdio_bus:ls1012a-1:01
[ 132.572520] device: 'ls1012a-1:02': device_add
[ 132.572567] bus: 'mdio_bus': add device ls1012a-1:02
[ 132.572600] PM: Adding info for mdio_bus:ls1012a-1:02
[ 132.572723] libphy: ls1012a MDIO Bus: probed
[ 132.572726] RAMA MDIO ELSE
[ 132.572823] device: 'eth0': device_add
[ 132.572962] PM: Adding info for No Bus:eth0
[ 132.577017] device: 'wakeup3': device_add
[ 132.577319] RAMA pfe_phy_init start
[ 132.577325] RAMA pfe_phy_init serdes
[ 132.577617] RAMA pfe_init inside new
[ 132.577896] pfe_phy_init interface 1
[ 132.578023] driver: 'Generic PHY': driver_bound: bound to device 'ls1012a-0:02'
[ 132.578386] pfe 4000000.pfe eth0: pfe_eth_init_one: created interface, baseaddr: 000000002a5b9d9b
[ 132.578492] device: 'eth1': device_add
[ 132.578640] PM: Adding info for No Bus:eth1
[ 132.582400] device: 'wakeup4': device_add
[ 132.582592] RAMA pfe_phy_init start
[ 132.582598] RAMA pfe_phy_init serdes
[ 132.582849] RAMA pfe_init inside new
[ 132.583129] pfe_phy_init interface 1
[ 132.583274] driver: 'Generic PHY': driver_bound: bound to device 'ls1012a-0:01'
[ 132.583594] pfe 4000000.pfe eth1: pfe_eth_init_one: created interface, baseaddr: 000000009989dff2
[ 132.583625] pfe_debugfs_init
[ 132.583683] RAMA PROBE ERR6
[ 132.583688] driver: 'pfe': driver_bound: bound to device '4000000.pfe'
[ 132.583830] bus: 'platform': really_probe: bound device 4000000.pfe to driver pfe
[ 132.618373] pfe 4000000.pfe eth1: pfe_eth_open
[ 132.618564] hif_process_client_req: register client_id 1
[ 132.618567] pfe_hif_client_register
[ 132.618574] pfe 4000000.pfe eth1: pfe_gemac_init

in ethtool, I can see bith interface but the physical link is not UP.

/ # ethtool eth1
Settings for eth1:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
1000baseX/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
1000baseX/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: Unknown!
Duplex: Unknown! (255)
Port: MII
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Current message level: 0x00000036 (54)
probe link ifdown ifup
Link detected: no

/ # ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
1000baseX/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
1000baseX/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: Unknown!
Duplex: Unknown! (255)
Port: MII
PHYAD: 2
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Current message level: 0x00000036 (54)
probe link ifdown ifup
Link detected: no

 

Please help us to fix, what changes we need to look when we select as a Internal PHY

 

Thanks,

Gopi Krishna M

 

 

 

0 Kudos
1 Solution
1,566 Views
gkrishna
Contributor II

Hi, It worked for me, sorry for the late reply because of covid. Thank you,

View solution in original post

0 Kudos
8 Replies
1,567 Views
gkrishna
Contributor II

Hi, It worked for me, sorry for the late reply because of covid. Thank you,

0 Kudos
1,631 Views
gkrishna
Contributor II

HI,

based on the updated DTS changes in pfe_eth_init_one() in pfe_eth.c skipping the actual phy connect part, code is below

if ((!(pfe_use_old_dts_phy) && !(priv->phy_node)) ||
((pfe_use_old_dts_phy) &&
(priv->einfo->phy_flags & GEMAC_NO_PHY))) {
pr_info("%s: No PHY or fixed-link\n", __func__);
goto skip_phy_init;
}

we are from lantronix, we earlier called netedge, Ours is most of the products from NXP, we are really struggling with this ethernet bring up and delayed the production release.

we have done everything, seems we are missing something in the DTS or somewhere. Please help us in the critical situation.

Thanks,

Gopi Krishna M

 

0 Kudos
1,608 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please also add the following in the ethernet@0 and ethernet@1 device node.

fixed-link {
speed = <1000>;
full-duplex;
};

Please refer to my following dts definition in the recent released LSDK.

&pfe {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;

pfe_mac0: ethernet@0 {
compatible = "fsl,pfe-gemac-port";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x0>; /* GEM_ID */
fsl,mdio-mux-val = <0x0>;
phy-mode = "internal";
fixed-link {
speed = <1000>;
full-duplex;
};

};

pfe_mac1: ethernet@1 {
compatible = "fsl,pfe-gemac-port";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x1>; /* GEM_ID */
fsl,mdio-mux-val = <0x0>;
phy-mode = "internal";
fixed-link {
speed = <1000>;
full-duplex;
};

};

};

Please refer to the following ethtool log.

root@localhost:~# ethtool eth1
Settings for eth1:
Supported ports: [ TP MII ]
Supported link modes: 1000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Current message level: 0x00000036 (54)
probe link ifdown ifup
Link detected: no

0 Kudos
1,631 Views
gkrishna
Contributor II

Hi,

Now also the interface is not up, Logs and ethetool info below, now in ethtool the intefrace is not like before,  lot of infos are gone..

118.625129] bus: 'platform': driver_probe_device: matched device 4000000.pfe with driver pfe
[ 118.625140] bus: 'platform': really_probe: probing driver pfe with device 4000000.pfe
[ 118.625360] RAMA pfe_get_gemac_if_properties start
[ 118.625363] RAMA DTS FAIL
[ 118.625366] RAMA pfe_get_gemac_if_properties IF mac check
[ 118.625369] RAMA MAC IF PASS
[ 118.625371] RAMA TRUE IF
[ 118.625373] RAMA pfe_get_gemac_if_properties if end new
[ 118.625375] RAMA pfe_get_gemac_if_properties ELSE end new
[ 118.625377] RAMA pfe_get_gemac_if_properties start
[ 118.625379] RAMA DTS FAIL
[ 118.625381] RAMA pfe_get_gemac_if_properties ELSEi mac
[ 118.625383] RAMA MAC ELSE PASS
[ 118.625385] RAMA TRUE ELSE
[ 118.625387] RAMA pfe_get_gemac_if_properties ELSE end new
[ 118.625430] device: 'wakeup2': device_add
[ 118.625987] cbus_baseaddr: ffff800013000000, ddr_baseaddr: ffff000003400000, ddr_phys_baseaddr: 83400000, ddr_size: c00000
[ 118.625994] pfe_hw_init
[ 118.625997] CLASS version: 20
[ 118.625999] TMU version: 1011231
[ 118.626002] BMU1 version: 21
[ 118.626004] BMU2 version: 21
[ 118.626006] EGPI1 version: 50
[ 118.626009] EGPI2 version: 50
[ 118.626011] HGPI version: 50
[ 118.626013] HIF version: 10
[ 118.626015] HIF NOPCY version: 10
[ 118.626020] bmu_init(1) done
[ 118.626024] bmu_init(2) done
[ 118.629017] class_init() done
[ 118.639168] tmu_init() done
[ 118.639173] gpi_init(1) done
[ 118.639178] gpi_init(2) done
[ 118.639182] gpi_init(hif) done
[ 118.639184] bmu_enable(1) done
[ 118.639186] bmu_enable(2) done
[ 118.639189] pfe_hif_lib_init
[ 118.639334] pfe_hif_init
[ 118.639336] pfe_hif_alloc_descr
[ 118.639640] pfe_hif_init_buffers
[ 118.640582] pfe_firmware_init
[ 118.644591] pfe_load_elf
[ 118.644603] pe_load_ddr_section: load address(3fb0000) and elf file address(ffff800010f53000) rcvd
[ 118.675898] PFE binary version: pfe_ls1012a_slowpath_10
[ 118.675902] pfe_load_elf
[ 118.676949] pfe_ctrl_init
[ 118.676953] pfe_ctrl_init finished
[ 118.676955] pfe_eth_init
[ 118.676970] pfe 4000000.pfe: pfe_eth_mdio_init: mdc_div: 64, phy_mask: fffffff9
[ 118.676974] RAMA new node `��;
[ 118.676976] RAMA news mdio_info id 0
[ 118.676988] device: 'ls1012a-0': device_add
[ 118.677057] PM: Adding info for No Bus:ls1012a-0
[ 118.686048] device: 'ls1012a-0:01': device_add
[ 118.686094] bus: 'mdio_bus': add device ls1012a-0:01
[ 118.686120] PM: Adding info for mdio_bus:ls1012a-0:01
[ 118.695264] device: 'ls1012a-0:02': device_add
[ 118.695310] bus: 'mdio_bus': add device ls1012a-0:02
[ 118.695337] PM: Adding info for mdio_bus:ls1012a-0:02
[ 118.695459] libphy: ls1012a MDIO Bus: probed
[ 118.695462] RAMA MDIO ELSE
[ 118.695480] pfe 4000000.pfe: pfe_eth_mdio_init: mdc_div: 64, phy_mask: fffffff9
[ 118.695485] RAMA new node `��;
[ 118.695487] RAMA news mdio_info id 1
[ 118.695494] device: 'ls1012a-1': device_add
[ 118.695525] PM: Adding info for No Bus:ls1012a-1
[ 118.704893] device: 'ls1012a-1:01': device_add
[ 118.704944] bus: 'mdio_bus': add device ls1012a-1:01
[ 118.704971] PM: Adding info for mdio_bus:ls1012a-1:01
[ 118.714020] device: 'ls1012a-1:02': device_add
[ 118.714065] bus: 'mdio_bus': add device ls1012a-1:02
[ 118.714091] PM: Adding info for mdio_bus:ls1012a-1:02
[ 118.714214] libphy: ls1012a MDIO Bus: probed
[ 118.714217] RAMA MDIO ELSE
[ 118.714317] device: 'eth0': device_add
[ 118.714457] PM: Adding info for No Bus:eth0
[ 118.718446] pfe_eth_init_one: No PHY or fixed-link
[ 118.718497] pfe 4000000.pfe eth0: pfe_eth_init_one: created interface, baseaddr: 0000000018b30887
[ 118.718599] device: 'eth1': device_add
[ 118.718743] PM: Adding info for No Bus:eth1
[ 118.721901] pfe_eth_init_one: No PHY or fixed-link
[ 118.721944] pfe 4000000.pfe eth1: pfe_eth_init_one: created interface, baseaddr: 000000001cd7a18e
[ 118.721980] pfe_debugfs_init
[ 118.722036] RAMA PROBE ERR6
[ 118.722042] driver: 'pfe': driver_bound: bound to device '4000000.pfe'
[ 118.722139] bus: 'platform': really_probe: bound device 4000000.pfe to driver pfe
[ 118.763472] pfe 4000000.pfe eth1: pfe_eth_open
[ 118.763662] hif_process_client_req: register client_id 1
[ 118.763665] pfe_hif_client_register
[ 118.763672] pfe 4000000.pfe eth1: pfe_gemac_init

 

# ethtool eth1
Settings for eth1:
Cannot get device settings: No such device
Supports Wake-on: g
Wake-on: d
Current message level: 0x00000036 (54)
probe link ifdown ifup
Link detected: yes

 

0 Kudos
1,632 Views
gkrishna
Contributor II

Hi, I am building that with the flag and I will update it, Meanwhile

mdio@0 {
reg = <0x1>; /* enabled/disabled */
fsl,mdio-phy-mask = <0xFFFFFFF9>;
};

 

Above node will be referred for internal phy? Is it must? or only used for external phy?

 

Thanks,

Gopi Krishna M

0 Kudos
1,644 Views
gkrishna
Contributor II

Hi,

Need to add that for both interface? Apart from that, do i need to add fixed phy, which mail I git earlier.

Thanks,

Gopi Krishna M

0 Kudos
1,639 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please modify the property "fsl,pfe-phy-if-flags = <0x1>;" for both interface, no need to add fixed-phy which I sent previously.

0 Kudos
1,647 Views
yipingwang
NXP TechSupport
NXP TechSupport

In the dts definition, please try the following configuration.

fsl,pfe-phy-if-flags = <0x1>;

0 Kudos