Help with P2020 eTSEC DTS configuration (I *think*)

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

Help with P2020 eTSEC DTS configuration (I *think*)

1,727 Views
jyav
Contributor I

Hi, I am porting Open Network Linux (ONL) to a bare metal switch (Kuga 7048N - see attached KUGA7048N_HW_SPEC_v03.pdf). The eTSEC NIC works fine in uboot and in the factory-loaded ONIE install/recovery environments.

However, eTSEC NIC *TX* isn't working for my build. Base address reported as 0xe000 whereas it's 0x8000 in (working) ONIE environment. See below ifconfig output:

root@localhost:~# ifconfig ma1
ma1 Link encap:Ethernet HWaddr 00:30:ab:2e:45:44
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:16853 errors:0 dropped:414 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2247973 (2.1 MiB) TX bytes:0 (0.0 B)
Base address:0xe000

 

The NIC receives packets, as indicated by ifconfig output above and tcpdump output below:

root@localhost:~# tcpdump -i ma1
device ma1 entered promiscuous mode
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ma1, link-type EN10MB (Ethernet), capture size 262144 bytes
00:28:21.542348 ARP, Request who-has 10.1.1.108 tell 10.1.1.4, length 46
00:28:21.680745 STP 802.1w, Rapid STP, Flags [Learn, Forward], bridge-id 8000.00:1f:12:3a:11:41.821d, length 43
00:28:22.047322 ARP, Request who-has 10.1.1.240 tell 10.1.1.240, length 46
00:28:22.109159 ARP, Request who-has 10.1.3.232 tell 10.1.1.6, length 46
[ ... keeps going ...]

 

I created DTS (see attached powerpc-delta-kuga7048-r0.dts) by dumping precompiled DTB from uboot (see attached uboot-dts-dump.txt) and editing it to:

  1. use P2020RDB profile
  2. replace "interrupts" and "interrupt-map" references (* 0x######## [0x########]) with md dump of memory addresses referenced.

ethtool reports no link detected and speed/duplex unknown. See output below:

root@localhost:~# ethtool ma1
Settings for ma1:
Supported ports: [ MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Speed: Unknown!
Duplex: Unknown! (255)
Port: MII
PHYAD: 1
Transceiver: external
Auto-negotiation: on
Current message level: 0x0000003f (63)
drv probe link timer ifdown ifup
Link detected: no

 

mii-tool reports auto-negotiation completed and link ok. See output below:

root@localhost:~# mii-tool ma1 -vvvv
Using SIOCGMIIPHY=0x8947
ma1: negotiated 1000baseT-FD flow-control, link ok
registers for MII PHY 1:
1140 796d 0020 60c1 0de1 c5e1 000d 2001
4e8a 0200 3800 0000 0000 0000 0000 3000
0000 1301 0000 0000 0101 0000 0000 0000
0400 ff1f 043e fff1 0000 337b 0000 0000
product info: vendor 00:08:18, model 12 rev 1
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control

 

uname -a output:

root@localhost:~# uname -a
Linux localhost 3.16.76-OpenNetworkLinux-85xx #1 SMP Sun Mar 19 06:16:10 UTC 2023 ppc GNU/Linux

 

I am happy to post output of any other commands. This isn't my area of expertise, but I am happy to do more digging on my own to solve the issue myself. I've just gotten to the point where I'm spinning my wheels, and I'm not sure what question(s) I need to ask to get the answer(s) that I need. Thanks in advance!

 

**** More pasted output that might help ****

ONIE:/ # fw_printenv
autoload=no
baudrate=9600
bdev=ram
bootcmd=run bootonie
bootdelay=10
bootdiag=setenv bootargs root=/dev/$bdev rw console=$consoledev,$baudrate $othbootargs; cp.b 0xed000000 $ramdiskaddr 0x1000000; cp.b 0xee800000 $loadaddr 0x400000; cp.b 0xeef00000 $fdtaddr 0x80000; bootm $loadaddr $ramdiskaddr $fdtaddr
bootfile=uImage
bootonie=sys_eeprom onie;run check_boot_reason; run nos_bootcmd; run onie_bootcmd
check_boot_reason=if test -n $onie_boot_reason; then setenv onie_bootargs boot_reason=$onie_boot_reason; run onie_bootcmd; fi;
clearenv=protect off eff60000 +20000;erase eff60000 +20000;protect on eff60000 +20000
consoledev=ttyS0
dhcp_user-class=powerpc-fsl_p2020rdbpca-r0_uboot
dhcp_vendor-class-identifier=uboot:powerpc-p2041-2-DNI_L7048N-r1
dtbflashaddr=0xeef00000
eth1addr=00:E0:0C:02:01:FD
eth2addr=00:E0:0C:02:02:FD
ethact=eTSEC3
ethaddr=00:30:AB:2E:45:44
ethprime=eTSEC1
fdtaddr=c00000
fdtfile=p2020ds.dtb
fsflashaddr=0xed000000
gatewayip=192.168.1.1
hostname=unknown
hwconfig=fsl_ddr:ctlr_intlv=bank,bank_intlv=cs0_cs1;usb1:dr_mode=host,phy_type=ulpi
ipaddr=192.168.1.254
loadaddr=1000000
loads_echo=1
netdev=eth0
netmask=255.255.255.0
nfsboot=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off console=$consoledev,$baudrate $othbootargs;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr - $fdtaddr
onie_args=run onie_initargs onie_platformargs
onie_bootcmd=echo Loading Open Network Install Environment ...; echo Platform: $onie_platform ; echo Version : $onie_version ; cp.b $onie_start $loadaddr ${onie_sz.b} && run onie_args && bootm ${loadaddr}
onie_initargs=setenv bootargs quiet console=$consoledev,$baudrate
onie_machine=fsl_p2041_kuga7048
onie_machine_rev=0
onie_platform=powerpc-p2041-2-DNI_L7048N-r1
onie_platformargs=setenv bootargs $bootargs serial_num=${serial#} eth_addr=$ethaddr platform=$onie_platform $onie_bootargs $onie_debugargs
onie_rescue=setenv onie_boot_reason rescue && run bootonie
onie_start=0xef020000
onie_sz.b=0x00f40000
onie_uninstall=setenv onie_boot_reason uninstall && run bootonie
onie_update=setenv onie_boot_reason update && run bootonie
onie_vendor_id=33118
onie_version=2013.11.00
oniefile=onie-kuga7048-r0.bin
onieflashaddr=0xef020000
othbootargs=cache-sram-size=0x10000
partition=scsi 0:0
perf_mode=performance
platform=fsl_p2041_kuga7048
ramboot=setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate $othbootargs;tftp $ramdiskaddr $ramdiskfile;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr $ramdiskaddr $fdtaddr
ramdiskaddr=2000000
ramdiskfile=rootfs.ext2.gz.uboot
rootpath=/opt/nfsroot
serial#=K48DL150422142
serverip=192.168.1.111
stderr=serial
stdin=serial
stdout=serial
tftpflash=tftpboot $loadaddr $uboot; protect off 0xeff80000 +$filesize; erase 0xeff80000 +$filesize; cp.b $loadaddr 0xeff80000 $filesize; protect on 0xeff80000 +$filesize; cmp.b $loadaddr 0xeff80000 $filesize
uboot=u-boot.bin
uimgflashaddr=0xee800000
uplddtb=tftp $fdtaddr $serverip:$fdtfile;protect off $dtbflashaddr +$filesize;erase $dtbflashaddr +$filesize;cp.b $fdtaddr $dtbflashaddr $filesize;protect on $dtbflashaddr +$filesize
upldfs=tftp $ramdiskaddr $serverip:$ramdiskfile;protect off $fsflashaddr +$filesize;erase $fsflashaddr +$filesize;cp.b $ramdiskaddr $fsflashaddr $filesize;protect on $fsflashaddr +$filesize
upldlinux=ping $serverip;run uplduimg;run upldfs;run uplddtb;
upldonie=tftp $loadaddr $serverip:$oniefile;protect off $onieflashaddr +$filesize;erase $onieflashaddr +$filesize;cp.b $loadaddr $onieflashaddr $filesize;protect on $onieflashaddr +$filesize
uplduimg=tftp $loadaddr $serverip:$bootfile;protect off $uimgflashaddr +$filesize;erase $uimgflashaddr +$filesize;cp.b $loadaddr $uimgflashaddr $filesize;protect on $uimgflashaddr +$filesize
onie_dropbear_rsa_host_key=begin-base64@600@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mpi0U9uIa+gse1I9eX560WL7QSYoWi#BIqzpm0U4orSRIllLUAUlnF9QYRKIJb/4jmWsNKP7FqYFbmq5/me/n8KLaPw#Vkg7URPW0a+aW/Mm1Y5XNd87sisxHVA62M/SYH4mAAAAFQCB3zMpIgLe4tZK#wh8/5m8hPdQ/Ug==#====#
boot-config-default=TkVUREVWPW1hMQpCT09UTU9ERT1JTlNUQUxMRUQKU1dJPWltYWdlczo6bGF0ZXN0Cg==
onl_installer_initrd=onl-loader-fit.itb:93495c:134f992
nos_bootcmd=setenv onl_loadaddr 0x10000000; setenv onl_platform powerpc-delta-kuga7048-r0; setenv onl_itb powerpc-delta-kuga7048-r0.itb; setenv bootargs console=$consoledev,$baudrate onl_platform=$onl_platform; mmc part 0; ext2load mmc 0:1 $onl_loadaddr $onl_itb; bootm $onl_loadaddr#$onl_platform

 

Uboot console output:

U-Boot 2013.01 (Nov 19 2014 - 17:10:19) L7048N V1.0.0.4

CPU0: P2020E, Version: 2.1, (0x80ea0021)
Core: E500, Version: 5.1, (0x80211051)
Clock Configuration:
CPU0:1200 MHz, CPU1:1200 MHz,
CCB:600 MHz,
DDR:333.333 MHz (666.667 MT/s data rate) (Asynchronous), LBC:37.500 MHz
L1: D-cache 32 kB enabled
I-cache 32 kB enabled
Board: L7048N
I2C: ready
SPI: ready
DRAM: Detected UDIMM 75.A83E0.G000C
2 GiB (DDR3, 64-bit, CL=6, ECC on)
Testing 0x00000000 - 0x7fffffff
Remap DDR
POST memory PASSED
Flash: 128 MiB
L2: 512 KB enabled
MMC: FSL_SDHC: 0
EEPROM: TlvInfo v1 len=129
PCIe1: Root Complex of Slot 1, x2, regs @ 0xffe0a000
PCIe1: Bus 00 - 01
In: serial
Out: serial
Err: serial
Net: eTSEC3 is in sgmii mode.
eTSEC3
Hit any key to stop autoboot: 0

 

ONIE installer environment ifconfig output (eth2 corresponds to physical interface):

ONIE:/proc/device-tree/chosen # cat bootargs
quiet console=ttyS0,9600 serial_num=K48DL150422142 eth_addr=00:30:AB:2E:45:44 platform=powerpc-p2041-2-DNI_L7048N-r1 boot_reason=rescueONIE:/proc/device-tree/chosen # ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:E0:0C:02:01:FD
inet addr:192.168.3.1 Bcast:192.168.3.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Base address:0x4000

ONIE:/proc/device-tree/chosen # ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:E0:0C:02:02:FD
inet addr:192.168.4.1 Bcast:192.168.4.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:cff:fe02:2fd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:2080 (2.0 KiB)
Base address:0x6000

ONIE:/proc/device-tree/chosen # ifconfig eth2
eth2 Link encap:Ethernet HWaddr 00:30:AB:2E:45:44
inet addr:10.1.1.220 Bcast:10.1.255.255 Mask:255.255.0.0
inet6 addr: fe80::230:abff:fe2e:4544/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5904 errors:0 dropped:175 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:869187 (848.8 KiB) TX bytes:1689 (1.6 KiB)
Base address:0x8000

 

Labels (1)
0 Kudos
Reply
2 Replies

1,689 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

Very good job, but this error is not the device tree, this is going to driver code or something in the apps that can not be store in that address.

Regards

0 Kudos
Reply

1,669 Views
jyav
Contributor I

I fixed it by using the code for /drivers/net/phy/broadcom.c from https://www.uwsg.indiana.edu/hypermail/linux/kernel/0609.1/2317.html

#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/unistd.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/phy.h>

#include <asm/io.h>
#include <asm/irq.h>
#include <asm/uaccess.h>

/* BCM5421S control register */
#define MII_BCM5421S_CONTROL 0x00
#define MII_BCM5421S_CONTROL_RESET 0x00008000
#define MII_BCM5421S_CONTROL_INIT 0x00001140
#define MII_BCM5421S_ANEN 0x00001000
#define MII_BCM5421S_CR 0x00
#define MII_BCM5421S_CR_RST 0x00008000
#define MII_BCM5421S_CR_INIT 0x00001000
#define MII_BCM5421S_STATUS 0x1
#define MII_BCM5421S_STATUS_AN_DONE 0x00000020
#define MII_BCM5421S_STATUS_LINK 0x0004
#define MII_BCM5421S_PHYIR1 0x2
#define MII_BCM5421S_PHYIR2 0x3
#define MII_BCM5421S_ANLPBPA 0x5
#define MII_BCM5421S_ANLPBPA_HALF 0x00000040
#define MII_BCM5421S_ANLPBPA_FULL 0x00000020
#define MII_BCM5421S_ANEX 0x6
#define MII_BCM5421S_ANEX_NP 0x00000004
#define MII_BCM5421S_ANEX_PRX 0x00000002

MODULE_DESCRIPTION("Broadcom PHY driver");
MODULE_AUTHOR("Amy Fong");
MODULE_LICENSE("GPL");

static int bcm5421s_config_aneg(struct phy_device *phydev)
{
int err;

/* Write the appropriate value to the PHY reg */
if (phydev->supported & SUPPORTED_1000baseT_Full)
err = phy_write(phydev, MII_BCM5421S_CONTROL, MII_BCM5421S_CONTROL_INIT);
else
err = phy_write(phydev, MII_BCM5421S_CONTROL, MII_BCM5421S_CR_INIT);

if (err < 0) return err;

/* doesn't have phy interrupt */
phydev->interrupts = PHY_INTERRUPT_DISABLED;

return 0;
}

static struct phy_driver bcm5421s_driver = {
.phy_id = 0x002060e1,
.phy_id_mask = 0x00ffffff,
.name = "Broadcom BCM5421S",
.features = PHY_GBIT_FEATURES,
.config_aneg = bcm5421s_config_aneg,
.read_status = genphy_read_status,
.driver = { .owner = THIS_MODULE,},
};

/* Glossy description on Broadcom's site seems to hint that the 5461
should be a drop-in for the 5421.... */
static struct phy_driver bcm5461s_driver = {
.phy_id = 0x002060c1,
.phy_id_mask = 0x00ffffff,
.name = "Broadcom BCM5461S",
.features = PHY_GBIT_FEATURES,
.config_aneg = bcm5421s_config_aneg,
.read_status = genphy_read_status,
.driver = { .owner = THIS_MODULE,},
};

static int __init broadcom_init(void)
{
int ret;

ret = phy_driver_register(&bcm5421s_driver);
if (!ret) {
ret = phy_driver_register(&bcm5461s_driver);
if (ret) phy_driver_unregister(&bcm5421s_driver);
}
return ret;
}

static void __exit broadcom_exit(void)
{
phy_driver_unregister(&bcm5421s_driver);
phy_driver_unregister(&bcm5461s_driver);
}

module_init(broadcom_init);
module_exit(broadcom_exit);

0 Kudos
Reply