lawrie / saxonsoc-ulx3s-bin

The binaries for SaxonSoc Linux and other configurations
17 stars 6 forks source link

Ethernet issue with ulx3s #5

Closed soundnut closed 3 years ago

soundnut commented 3 years ago

Greetings,

I'm trying to rebuild the images following the instructions from the link in Build from Source. Rebuilding works but I can't seem to get networking fully working. I see the adapter on the switch and some packets but can't get it to fully work. (also see: https://github.com/SpinalHDL/SaxonSoc/issues/61)

ulx3s is the green variety with an 85k FPGA. LAN Module is a LAN8720 board. I have an ethernet switch with LAN mirroring to monitor traffic. Binutils and Linux Kernel have been updated to the latest releases plus I've added some basic networking tools to the image. Previously, I tried with Linux-on-Litex-Vexrisc Images. Networking worked so hardware should be ok but I ran into other issues with that project (no SMP and other errors)

Any ideas or pointers for further troubleshooting would be much appreciated.

Thanks.

Dolu1990 commented 3 years ago

Hi,

Linux Kernel have been updated to the latest release

It mean linux 5.12 ? or you mean latest of which branch/repo ?

Also on ifconfig, do you have some rx and tx trafic ?

if you cat /proc/interrupts, do you have some interrupts from the mac ?

soundnut commented 3 years ago

Hi, I upgraded to spinal-v5.10-latest - uname shows 5.10.23. ifconfig: nothing in RX no interrupts for int4 (eth0) in /proc/interrupts

If I run tcpdump -i eth0 & ifup eth0 I can see the DHCP requests going out on both the ulx3s as well as the mirrored switchport but I can only see the answer on the switchport.

soundnut commented 3 years ago

I see activity on RX0/RX1 using an Scope but haven't figured out how to decode it yet. D0 is RX0, D1 is RX1 and D2 is CRS image

lawrie commented 3 years ago

I will see if it still works for me, probably tomorrow.

soundnut commented 3 years ago

Thank you - much appreciated. Please let me know if there's anything else I can test/verify on my end.

Dolu1990 commented 3 years ago

@soundnut

Which branch of SaxonSoc are you using ? (they maybe be issues in dev-0.2 fixed in dev-0.1 that we need to port forward)

About the linux kernel, spinal-v5.10.1 is the SaxonSoc stable branch :) I don't think it is the issue yet.

Dolu1990 commented 3 years ago

So, i just checked on the very new and shiny dev-0.3 branch, all worked fine for me.

There is what i got in the console (as referance)

SDRAM init
Mem test .. pass
Flash ID : 0x15
OpenSBI copy
U-Boot copy
Image check .. pass
VGA init
Configuring MDIO
  control (old): 3100
  control (new): 3100
OpenSBI boot

OpenSBI v0.8
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name       : VexRiscv SMP SaxonSOC
Platform Features   : timer,mfdeleg
Platform HART Count : 4
Boot HART ID        : 0
Boot HART ISA       : rv32imas
BOOT HART Features  : time
BOOT HART PMP Count : 0
Firmware Base       : 0x80f80000
Firmware Size       : 88 KB
Runtime SBI Version : 0.2

MIDELEG : 0x00000222
MEDELEG : 0x0000b101

U-Boot 2021.01-rc1 (Mar 15 2021 - 10:49:52 +0100)

DRAM:  32 MiB
MMC:   spi@10020000:mmc@1: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial@10010000
Out:   serial@10010000
Err:   serial@10010000
Net:   No ethernet found.
Hit any key to stop autoboot:  0 
7190652 bytes read in 9524 ms (737.3 KiB/s)
3757 bytes read in 17 ms (215.8 KiB/s)
## Booting kernel from Legacy Image at 80000000 ...
   Image Name:   Linux
   Image Type:   RISC-V Linux Kernel Image (uncompressed)
   Data Size:    7190588 Bytes = 6.9 MiB
   Load Address: 80000000
   Entry Point:  80000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 80ff0000
   Booting using the fdt blob at 0x80ff0000
   Loading Kernel Image
   Using Device Tree in place at 80ff0000, end 80ff3eac

Starting kernel ...

[    0.000000] Linux version 5.10.1 (rawrr@rawrr) (riscv32-buildroot-linux-gnu-gcc.br_real (Buildroot 2020.11-rc3-8-g9ef54b7d0b) 10.2.0, GNU ld (GNU Binutils) 2.33.1) #2 SMP Mon Mar 15 10:50:06 CET 2021
[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[    0.000000] printk: bootconsole [sbi0] enabled
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000080000000-0x0000000081ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x0000000081ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x0000000081ffffff]
[    0.000000] SBI specification v0.2 detected
[    0.000000] SBI implementation ID=0x1 Version=0x8
[    0.000000] SBI v0.2 TIME extension detected
[    0.000000] SBI v0.2 IPI extension detected
[    0.000000] SBI v0.2 RFENCE extension detected
[    0.000000] SBI v0.2 HSM extension detected
[    0.000000] riscv: ISA extensions aim
[    0.000000] riscv: ELF capabilities aim
[    0.000000] percpu: Embedded 12 pages/cpu s18700 r8192 d22260 u49152
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line: rootwait console=hvc0 earlycon=sbi root=/dev/mmcblk0p2 init=/sbin/init mmc_core.use_spi_crc=0
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.000000] Sorting __ex_table...
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 23600K/32768K available (5305K kernel code, 567K rwdata, 927K rodata, 190K init, 260K bss, 9168K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 32 local interrupts mapped
[    0.000000] plic: interrupt-controller@c00000: mapped 32 interrupts with 1 handlers for 2 contexts.
[    0.000000] random: get_random_bytes called from start_kernel+0x35c/0x4dc with crng_init=0
[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0xbfe27ab9a, max_idle_ns: 440795203754 ns
[    0.000241] sched_clock: 64 bits at 52MHz, resolution 19ns, wraps every 4398046511097ns
[    0.010870] Console: colour dummy device 80x25
[    0.013079] printk: console [hvc0] enabled
[    0.013079] printk: console [hvc0] enabled
[    0.021001] printk: bootconsole [sbi0] disabled
[    0.021001] printk: bootconsole [sbi0] disabled
[    0.030627] Calibrating delay loop (skipped), value calculated using timer frequency.. 104.00 BogoMIPS (lpj=208000)
[    0.040683] pid_max: default: 32768 minimum: 301
[    0.050886] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.053302] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.102907] rcu: Hierarchical SRCU implementation.
[    0.114547] smp: Bringing up secondary CPUs ...
[    0.116118] smp: Brought up 1 node, 1 CPU
[    0.127381] devtmpfs: initialized
[    0.187413] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.190954] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.201252] NET: Registered protocol family 16
[    0.570341] Advanced Linux Sound Architecture Driver Initialized.
[    0.592043] clocksource: Switched to clocksource riscv_clocksource
[    0.600332] simple-framebuffer 80e00000.framebuffer: framebuffer at 0x80e00000, 0x96000 bytes, mapped to 0x(ptrval)
[    0.603981] simple-framebuffer 80e00000.framebuffer: format=r5g6b5, mode=640x480x16, linelength=1280
[    0.711932] Console: switching to colour frame buffer device 80x30
[    0.804188] simple-framebuffer 80e00000.framebuffer: fb0: simplefb registered!
[    1.098498] NET: Registered protocol family 2
[    1.116833] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    1.120394] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    1.123655] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    1.130419] TCP: Hash tables configured (established 1024 bind 1024)
[    1.138206] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.143783] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.154366] NET: Registered protocol family 1
[    1.172955] RPC: Registered named UNIX socket transport module.
[    1.175353] RPC: Registered udp transport module.
[    1.176924] RPC: Registered tcp transport module.
[    1.178466] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.212573] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[    1.524799] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[    1.527501] io scheduler mq-deadline registered
[    1.529030] io scheduler kyber registered
[    1.535729] io scheduler bfq registered
[    1.552305] spinal_lib_gpio 10000000.gpio: IRQ index 16 not found
[    1.554511] spinal_lib_gpio 10000000.gpio: IRQ index 17 not found
[    1.557229] spinal_lib_gpio 10000000.gpio: IRQ index 18 not found
[    1.560900] spinal_lib_gpio 10000000.gpio: IRQ index 19 not found
[    1.567560] spinal_lib_gpio 10000000.gpio: IRQ index 20 not found
[    1.573242] spinal_lib_gpio 10000000.gpio: IRQ index 21 not found
[    1.579632] spinal_lib_gpio 10000000.gpio: IRQ index 22 not found
[    1.585546] spinal_lib_gpio 10000000.gpio: IRQ index 23 not found
[    1.591836] spinal_lib_gpio 10000000.gpio: IRQ index 24 not found
[    1.598045] spinal_lib_gpio 10000000.gpio: IRQ index 25 not found
[    1.604207] spinal_lib_gpio 10000000.gpio: IRQ index 26 not found
[    1.610388] spinal_lib_gpio 10000000.gpio: IRQ index 27 not found
[    1.616455] spinal_lib_gpio 10000000.gpio: IRQ index 28 not found
[    1.622420] spinal_lib_gpio 10000000.gpio: IRQ index 29 not found
[    1.628679] spinal_lib_gpio 10000000.gpio: IRQ index 30 not found
[    1.634727] spinal_lib_gpio 10000000.gpio: IRQ index 31 not found
[    1.641121] spinal_lib_gpio 10000000.gpio: Probe success
[    1.668447] spinal,lib-dmasg 10080000.dma: Probe success
[    1.711895] 10011000.ttySpinal: ttySL0 at MMIO 0x10011000 (irq = 0, base_baud = 650000) is a Spinal lib UART
[    1.760121] spi-nor spi0.0: is25lp032 (4096 Kbytes)
[    1.773269] 3 fixed-partitions partitions found on MTD device spi0.0
[    1.776221] Creating 3 MTD partitions on "spi0.0":
[    1.778075] 0x000000000000-0x000000400000 : "fpga_bitstream"
[    1.793219] 0x000000340000-0x000000380000 : "opensbi"
[    1.806598] 0x000000380000-0x000000400000 : "uboot"
[    1.833937] ------------[ cut here ]------------
[    1.836260] /apbA@10000000/spi@20000/spidev@2: buggy DT: spidev listed directly in DT
[    1.851963] spinal-lib,spi-1.0 10020000.spi: base (ptrval)
[    1.881586] libphy: Fixed MDIO Bus: probed
[    1.902395] spinal_lib_mac 10040000.mac eth0: irq 4, mapped at a0407000
[    1.911624] i2c /dev entries driver
[    1.953199] mmc_spi spi0.1: SD/MMC host mmc0, no WP, no poweroff, cd polling
[    1.969655] ledtrig-cpu: registered to indicate activity on CPUs
[    2.036839] spinal,lib-audio-out 10094000.audio_out: Probe success
[    2.078754] NET: Registered protocol family 10
[    2.131885] mmc0: host does not support reading read-only switch, assuming write-enable
[    2.134455] mmc0: new SD card on SPI
[    2.153009] mmcblk0: mmc0:0000 SU02G 1.84 GiB 
[    2.181769] Segment Routing with IPv6
[    2.185457] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.209018] NET: Registered protocol family 17
[    2.230259] i2c-gpio i2cA: using lines 504 (SDA) and 505 (SCL)
[    2.252914]  mmcblk0: p1 p2
[    2.282763] ALSA device list:
[    2.284789]   #0: 
[    2.324981] VFS: Mounted root (ext2 filesystem) readonly on device 179:2.
[    2.344639] devtmpfs: mounted
[    2.349903] Freeing unused kernel memory: 188K
[    2.352177] Kernel memory protection not selected by kernel config.
[    2.354294] Run /sbin/init as init process
[    7.952959] EXT2-fs (mmcblk0p2): warning: mounting unchecked fs, running e2fsck is recommended
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Initializing random number generator: OK
Saving random seed: [   12.067836] random: dd: uninitialized urandom read (512 bytes read)
OK
Starting haveged: haveged: command socket is listening at fd 3
OK
Starting network: udhcpc: started, v1.32.0
udhcpc: sending discover
udhcpc: sending select for 192.168.0.160
udhcpc: lease of 192.168.0.160 obtained, lease time 3600
deleting routers
adding dns 62.2.24.162
adding dns 62.2.17.61
adding dns 62.2.24.158
adding dns 62.2.17.60
OK
Starting dropbear sshd: OK

Welcome to Buildroot
buildroot login: root
            ___                                             ___     ___     ___   
    o O O  / __|   __ _    __ __    ___    _ _      ___    / __|   / _ \   / __|  
   o       \__ \  / _` |   \ \ /   / _ \  | ' \    |___|   \__ \  | (_) | | (__   
  TS__[O]  |___/  \__,_|   /_\_\   \___/  |_||_|   _____   |___/   \___/   \___|  
 {======|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|     |_|"""""|_|"""""|_|"""""| 
./o--000'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' 

root@buildroot:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=118 time=18.765 ms
64 bytes from 8.8.8.8: seq=1 ttl=118 time=13.035 ms
64 bytes from 8.8.8.8: seq=2 ttl=118 time=12.071 ms
64 bytes from 8.8.8.8: seq=3 ttl=118 time=11.566 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 11.566/13.859/18.765 ms
root@buildroot:~# 

Note that one important thing is the very early :

Configuring MDIO
  control (old): 3100
  control (new): 3100

Also, note i didn't had to do anything, the connection came by itself, udhcpc started automaticaly.

There is also a picture of my config as referance :

image

So i would suggest, start from a blank sheet using that new dev-0.3 branch, following

Normaly all should be fine. Please tell us how things goes :)

lawrie commented 3 years ago

That version works for me too. I have 90 degree headers on my Ulx3s board. which makes it easier to connect the LAN8720 board.

soundnut commented 3 years ago

@soundnut

Which branch of SaxonSoc are you using ? (they maybe be issues in dev-0.2 fixed in dev-0.1 that we need to port forward)

About the linux kernel, spinal-v5.10.1 is the SaxonSoc stable branch :) I don't think it is the issue yet.

I tried with dev-0.2 (dev-0.1 gave me build issues)

soundnut commented 3 years ago

Thanks - will try with dev-0.3 - starting from scratch.

soundnut commented 3 years ago

I went back to the older images while the rebuild churns away and noticed that MDIO is different in my case. 3000 - vs 3100 as seen in your screenshot. Is this the issue?

SDRAM init Mem test .. pass Flash ID : 0x17 OpenSBI copy U-Boot copy Image check .. pass VGA init Configuring MDIO control (old): 3000 control (new): 3000 OpenSBI boot

OpenSBI v0.8

Thanks

Dolu1990 commented 3 years ago

3000 is good, it mean 100 mbps half duplex :) 3100 is good to, it mean 100 mbps full duplex

soundnut commented 3 years ago

hmmmm - interesting. Switch is configured for 100M Full-Duplex (port2) Screenshot_20210318_102806

soundnut commented 3 years ago

tried with a different switch image

now I get 3100 Configuring MDIO control (old): 3100 control (new): 3100 OpenSBI boot doesn't change the outcome though

root@buildroot:~# ifconfig eth0 Link encap:Ethernet HWaddr 00:01:23:34:56:78
inet6 addr: fe80::201:23ff:fe34:5678/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:15 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:2778 (2.7 KiB) Interrupt:4

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 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)

root@buildroot:~# ifup eth0 udhcpc: started, v1.32.0 udhcpc: sending discover udhcpc: sending discover udhcpc: sending discover udhcpc: no lease, failing

root@buildroot:~# cat /proc/interrupts CPU0 CPU1 CPU2 CPU3
3: 0 0 0 0 SiFive PLIC 12 spinal-lib-dmasg 4: 0 0 0 0 SiFive PLIC 3 eth0 5: 41657 41641 41636 41632 RISC-V INTC 5 riscv-timer 6: 0 0 0 0 SiFive PLIC 13 spinal-lib-dmasg IPI0: 60 56 52 68 Rescheduling interrupts IPI1: 3280 7290 342 10197 Function call interrupts IPI2: 0 0 0 0 CPU stop interrupts IPI3: 0 0 0 0 IRQ work interrupts root@buildroot:~#

RX packets remains at 0

root@buildroot:~# ifconfig eth0 Link encap:Ethernet HWaddr 00:01:23:34:56:78
inet6 addr: fe80::201:23ff:fe34:5678/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:23 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:4970 (4.8 KiB) Interrupt:4

Sooo will try with dev-0.3 next. building.... will take awhile

soundnut commented 3 years ago

no luck - still no IP communication RX remains at 0 eth0 Link encap:Ethernet HWaddr 00:01:23:34:56:78
inet6 addr: fe80::201:23ff:fe34:5678/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:18 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:2988 (2.9 KiB) Interrupt:4

/proc/interrupts for eth0 remains at 0 root@buildroot:~# cat /proc/interrupts CPU0 CPU1 CPU2 CPU3
3: 0 0 0 0 SiFive PLIC 12 spinal-lib-dmasg 4: 0 0 0 0 SiFive PLIC 3 eth0 5: 137781 137759 137754 137745 RISC-V INTC 5 riscv-timer 6: 0 0 0 0 SiFive PLIC 13 spinal-lib-dmasg IPI0: 34 86 61 19 Rescheduling interrupts IPI1: 7143 3480 9265 878 Function call interrupts IPI2: 0 0 0 0 CPU stop interrupts IPI3: 0 0 0 0 IRQ work interrupts root@buildroot:~#

So, do I have a defective LAN8720 Adapter or a defective ULX3S Board.....? Is there another set of GPIO Pins that I could use? i.e. move the adapter up on J1 or over to J2?

I can see traffic on the pins of the RX pins on the LAN8720 - this makes me point at the ULX3S board. Is there a debug mode/setting for the ethernet driver?

Thanks for all your help.

soundnut commented 3 years ago

BTW: no idea why the printout of /proc/interrupts gets the stricke-through font - sorry

soundnut commented 3 years ago

i.e. would swapping J1 9-13 with J2 14-18 work?

lawrie commented 3 years ago

The VCC and GND pins are in the wrong place to just plug the device in using pins J2 14-18. I am not sure why using different pins would help with your problem. The easiest change would be to use the top right corner but unfortunately that has a 5v pin. I think some of the 14-18 pin range was used for an SPI Ethernet device. Not sure if that is still in the dts.

soundnut commented 3 years ago

J2 14-18 would line up with VCC/GND if I flip it over (ethernet connector/chips to the outside of the ulx3s)

As to why: I can trace incoming packets on the connector pins of J1 but don't get any traffic with tcpdump. So I assume that the LAN8720 is working properly. Using a different set of ports would rule out any soldering/board issues between J1 and the chip unless there's another way to trace the signal from J1 to the FPGA ports? Would it be possible to route the RX and TX pins to LEDs?

soundnut commented 3 years ago

SPI ethernet device: you mean an ENC28J60? that's still there enc28j60: ethernet@3 { compatible = "microchip,enc28j60"; reg = <3>; interrupt-parent = <&gpioA>; interrupts = <15 2>; //IRQ_TYPE_EDGE_FALLING spi-max-frequency = <2000000>; }; I have one laying around - but it doesn't have a PMOD style connector. how do I connect it? SI/SCK to system_spiA_md_IO and C VCC/GND RST high or low - need to check the datasheet anything else?

soundnut commented 3 years ago

does this mapping still hold? https://github.com/lawrie/saxonsoc-ulx3s-bin/blob/master/linux/u-boot/README.md#ethernet Ethernet You can use an ENC28J60 module for connection to the internet va Ethernet.

The pin mapping, which is suitable for connecting via a Pmod, is:

GP14 - CS GN14 - SI # MOSI GP15 - INT GN15 - SO # MISO GN17 - SCK 3.3V - RST 3.3V - 3.3 GND - GND # Next to 3.3 NC - 5v NC - GND # Next to 5V NC - CLK NC - WOL

lawrie commented 3 years ago

As far as I know that description for the ENC28J60 is still correct, but I have not used that device recently so I am not sure if it works on recent branches of SaxonSoc.

Dolu1990 commented 3 years ago

ahhh for the ENC28J60, the CONFIG_ENC28J60 was missing, i just pushed the fix in https://github.com/SpinalHDL/buildroot-spinal-saxon

normaly, if you pull that, go in buildroot-build,

saxon_buildroot_setup
make linux-dirclean linux-rebuild
make

It should update everything required.

soundnut commented 3 years ago

I've added it with linux-menuconfig / make

Now I get this during boot: [ 2.315775] enc28j60 spi0.3: Ethernet driver 1.02 loaded [ 2.334334] enc28j60 spi0.3: chip not found [ 2.336534] enc28j60: probe of spi0.3 failed with error -5

Dolu1990 commented 3 years ago

hmmm here the tricky thing is the interrupt, i will give a try tomorrow :)

soundnut commented 3 years ago

Progress! [ 2.322959] enc28j60 spi0.3: Ethernet driver 1.02 loaded [ 2.420884] spinal_lib_mac 10040000.mac eth1: irq 4, mapped at a0407000 ... [ 25.724620] enc28j60 spi0.3 eth0: link down [ 25.726854] enc28j60 spi0.3 eth0: multicast mode [ 25.736125] enc28j60 spi0.3 eth0: multicast mode

but still no dhcp address.

ifconfig now shows eth0 and eth1 adding a static address works but still no ping

Dolu1990 commented 3 years ago

Hmm Can you check if you get interrupts from that enc28 ? cat /proc/interrupts Should be in the GPIO, that's the tricky part XD

soundnut commented 3 years ago

ifconfig doesn't show any packets for RX and TX and nothing for interrupts 15: 0 0 0 0 spinal_lib_gpio-gpio 15 enc28j60

Dolu1990 commented 3 years ago

hmm maybe the issue is there, and maybe that's broken because if me XD I will check out the interrupt mapping tomorrow :)

Dolu1990 commented 3 years ago

@soundnut

I just tried the enc28j60, it worked fine :

[    0.000000] Linux version 5.10.1 (rawrr@rawrr) (riscv32-buildroot-linux-gnu-gcc.br_real (Buildroot 2020.11-rc3-8-g9ef54b7d0b) 10.2.0, GNU ld (GNU Binutils) 2.33.1) #2 SMP Fri Mar 19 08:06:09 CET 2021
[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[    0.000000] printk: bootconsole [sbi0] enabled
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000080000000-0x0000000081ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x0000000081ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x0000000081ffffff]
[    0.000000] SBI specification v0.2 detected
[    0.000000] SBI implementation ID=0x1 Version=0x8
[    0.000000] SBI v0.2 TIME extension detected
[    0.000000] SBI v0.2 IPI extension detected
[    0.000000] SBI v0.2 RFENCE extension detected
[    0.000000] SBI v0.2 HSM extension detected
[    0.000000] riscv: ISA extensions aim
[    0.000000] riscv: ELF capabilities aim
[    0.000000] percpu: Embedded 12 pages/cpu s18700 r8192 d22260 u49152
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line: rootwait console=hvc0 earlycon=sbi root=/dev/mmcblk0p2 init=/sbin/init mmc_core.use_spi_crc=0
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.000000] Sorting __ex_table...
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 23576K/32768K available (5322K kernel code, 567K rwdata, 931K rodata, 190K init, 260K bss, 9192K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 32 local interrupts mapped
[    0.000000] plic: interrupt-controller@c00000: mapped 32 interrupts with 1 handlers for 2 contexts.
[    0.000000] random: get_random_bytes called from start_kernel+0x35c/0x4dc with crng_init=0
[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0xbfe27ab9a, max_idle_ns: 440795203754 ns
[    0.000243] sched_clock: 64 bits at 52MHz, resolution 19ns, wraps every 4398046511097ns
[    0.010768] Console: colour dummy device 80x25
[    0.012950] printk: console [hvc0] enabled
[    0.012950] printk: console [hvc0] enabled
[    0.021015] printk: bootconsole [sbi0] disabled
[    0.021015] printk: bootconsole [sbi0] disabled
[    0.030631] Calibrating delay loop (skipped), value calculated using timer frequency.. 104.00 BogoMIPS (lpj=208000)
[    0.040715] pid_max: default: 32768 minimum: 301
[    0.050884] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.053309] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.102700] rcu: Hierarchical SRCU implementation.
[    0.114266] smp: Bringing up secondary CPUs ...
[    0.115856] smp: Brought up 1 node, 1 CPU
[    0.126354] devtmpfs: initialized
[    0.186283] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.189314] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.200099] NET: Registered protocol family 16
[    0.564049] Advanced Linux Sound Architecture Driver Initialized.
[    0.585660] clocksource: Switched to clocksource riscv_clocksource
[    0.594547] simple-framebuffer 80e00000.framebuffer: framebuffer at 0x80e00000, 0x96000 bytes, mapped to 0x(ptrval)
[    0.598205] simple-framebuffer 80e00000.framebuffer: format=r5g6b5, mode=640x480x16, linelength=1280
[    0.706057] Console: switching to colour frame buffer device 80x30
[    0.798321] simple-framebuffer 80e00000.framebuffer: fb0: simplefb registered!
[    1.090047] NET: Registered protocol family 2
[    1.107735] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    1.111275] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    1.114578] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    1.121755] TCP: Hash tables configured (established 1024 bind 1024)
[    1.129441] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.134364] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.145669] NET: Registered protocol family 1
[    1.163537] RPC: Registered named UNIX socket transport module.
[    1.165990] RPC: Registered udp transport module.
[    1.167563] RPC: Registered tcp transport module.
[    1.169630] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.202846] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[    1.503222] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[    1.505986] io scheduler mq-deadline registered
[    1.507535] io scheduler kyber registered
[    1.514078] io scheduler bfq registered
[    1.530245] spinal_lib_gpio 10000000.gpio: IRQ index 16 not found
[    1.532435] spinal_lib_gpio 10000000.gpio: IRQ index 17 not found
[    1.535124] spinal_lib_gpio 10000000.gpio: IRQ index 18 not found
[    1.538887] spinal_lib_gpio 10000000.gpio: IRQ index 19 not found
[    1.545521] spinal_lib_gpio 10000000.gpio: IRQ index 20 not found
[    1.551177] spinal_lib_gpio 10000000.gpio: IRQ index 21 not found
[    1.557582] spinal_lib_gpio 10000000.gpio: IRQ index 22 not found
[    1.563421] spinal_lib_gpio 10000000.gpio: IRQ index 23 not found
[    1.569773] spinal_lib_gpio 10000000.gpio: IRQ index 24 not found
[    1.575733] spinal_lib_gpio 10000000.gpio: IRQ index 25 not found
[    1.582062] spinal_lib_gpio 10000000.gpio: IRQ index 26 not found
[    1.588299] spinal_lib_gpio 10000000.gpio: IRQ index 27 not found
[    1.594685] spinal_lib_gpio 10000000.gpio: IRQ index 28 not found
[    1.600373] spinal_lib_gpio 10000000.gpio: IRQ index 29 not found
[    1.606697] spinal_lib_gpio 10000000.gpio: IRQ index 30 not found
[    1.612639] spinal_lib_gpio 10000000.gpio: IRQ index 31 not found
[    1.619074] spinal_lib_gpio 10000000.gpio: Probe success
[    1.646385] spinal,lib-dmasg 10080000.dma: Probe success
[    1.688893] 10011000.ttySpinal: ttySL0 at MMIO 0x10011000 (irq = 0, base_baud = 650000) is a Spinal lib UART
[    1.736626] spi-nor spi0.0: is25lp032 (4096 Kbytes)
[    1.751052] 3 fixed-partitions partitions found on MTD device spi0.0
[    1.754085] Creating 3 MTD partitions on "spi0.0":
[    1.755936] 0x000000000000-0x000000400000 : "fpga_bitstream"
[    1.770911] 0x000000340000-0x000000380000 : "opensbi"
[    1.784037] 0x000000380000-0x000000400000 : "uboot"
[    1.811122] ------------[ cut here ]------------
[    1.812935] /apbA@10000000/spi@20000/spidev@2: buggy DT: spidev listed directly in DT
[    1.827630] spinal-lib,spi-1.0 10020000.spi: base (ptrval)
[    1.857839] libphy: Fixed MDIO Bus: probed
[    1.862564] enc28j60 spi0.3: Ethernet driver 1.02 loaded
[    1.956064] spinal_lib_mac 10040000.mac eth1: irq 4, mapped at a0407000
[    1.965588] i2c /dev entries driver
[    2.007114] mmc_spi spi0.1: SD/MMC host mmc0, no WP, no poweroff, cd polling
[    2.023474] ledtrig-cpu: registered to indicate activity on CPUs
[    2.095025] spinal,lib-audio-out 10094000.audio_out: Probe success
[    2.136163] NET: Registered protocol family 10
[    2.185864] mmc0: host does not support reading read-only switch, assuming write-enable
[    2.188414] mmc0: new SD card on SPI
[    2.206727] mmcblk0: mmc0:0000 SU02G 1.84 GiB 
[    2.238327] Segment Routing with IPv6
[    2.242262] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.264571] NET: Registered protocol family 17
[    2.278723] i2c-gpio i2cA: using lines 504 (SDA) and 505 (SCL)
[    2.307328]  mmcblk0: p1 p2
[    2.336548] ALSA device list:
[    2.338630]   #0: 

[    2.378598] VFS: Mounted root (ext2 filesystem) readonly on device 179:2.
[    2.398003] devtmpfs: mounted
[    2.403270] Freeing unused kernel memory: 188K
[    2.405526] Kernel memory protection not selected by kernel config.
[    2.407638] Run /sbin/init as init process
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Saving random seed: [   11.562919] random: dd: uninitialized urandom read (512 bytes read)
OK
Starting haveged: haveged: command socket is listening at fd 3
OK
Starting network: [   23.487035] enc28j60 spi0.3 eth0: link down
[   23.489595] enc28j60 spi0.3 eth0: multicast mode
[   23.492826] enc28j60 spi0.3 eth0: multicast mode
udhcpc: started, v1.32.0
[   24.441825] enc28j60 spi0.3 eth0: link up - Half duplex
[   24.466492] enc28j60 spi0.3 eth0: multicast mode
[   24.489752] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   24.508407] enc28j60 spi0.3 eth0: multicast mode
[   24.696177] enc28j60 spi0.3 eth0: multicast mode
udhcpc: sending discover
udhcpc: sending select for 192.168.0.227
udhcpc: lease of 192.168.0.227 obtained, lease time 3600
[   27.350560] enc28j60 spi0.3 eth0: multicast mode
deleting routers
adding dns 62.2.24.162
adding dns 62.2.17.61
adding dns 62.2.24.158
adding dns 62.2.17.60
OK
Starting dropbear sshd: OK

Welcome to Buildroot
buildroot login: root
            ___                                             ___     ___     ___   
    o O O  / __|   __ _    __ __    ___    _ _      ___    / __|   / _ \   / __|  
   o       \__ \  / _` |   \ \ /   / _ \  | ' \    |___|   \__ \  | (_) | | (__   
  TS__[O]  |___/  \__,_|   /_\_\   \___/  |_||_|   _____   |___/   \___/   \___|  
 {======|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|     |_|"""""|_|"""""|_|"""""| 
./o--000'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' 

root@buildroot:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=118 time=84.897 ms
64 bytes from 8.8.8.8: seq=1 ttl=118 time=32.247 ms
64 bytes from 8.8.8.8: seq=2 ttl=118 time=36.073 ms
64 bytes from 8.8.8.8: seq=3 ttl=118 time=36.965 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 32.247/47.545/84.897 ms
root@buildroot:~# cat /proc/interrupts 
           CPU0       
  3:          0  SiFive PLIC  12  spinal-lib-dmasg
  5:      23306  RISC-V INTC   5  riscv-timer
  6:          0  SiFive PLIC  13  spinal-lib-dmasg
 15:         28  spinal_lib_gpio-gpio  15  enc28j60
IPI0:         0  Rescheduling interrupts
IPI1:         0  Function call interrupts
IPI2:         0  CPU stop interrupts
IPI3:         0  IRQ work interrupts
root@buildroot:~# 

I'm suspecting you maybe have a networking issue or something weird, maybe the cable XD ?

Dolu1990 commented 3 years ago

note i just push a fix in buildroot-saxon-spinal about the spam :

[    1.530245] spinal_lib_gpio 10000000.gpio: IRQ index 16 not found
[    1.532435] spinal_lib_gpio 10000000.gpio: IRQ index 17 not found
[    1.535124] spinal_lib_gpio 10000000.gpio: IRQ index 18 not found
[    1.538887] spinal_lib_gpio 10000000.gpio: IRQ index 19 not found
[    1.545521] spinal_lib_gpio 10000000.gpio: IRQ index 20 not found
[    1.551177] spinal_lib_gpio 10000000.gpio: IRQ index 21 not found
[    1.557582] spinal_lib_gpio 10000000.gpio: IRQ index 22 not found
[    1.563421] spinal_lib_gpio 10000000.gpio: IRQ index 23 not found
[    1.569773] spinal_lib_gpio 10000000.gpio: IRQ index 24 not found
[    1.575733] spinal_lib_gpio 10000000.gpio: IRQ index 25 not found
[    1.582062] spinal_lib_gpio 10000000.gpio: IRQ index 26 not found
[    1.588299] spinal_lib_gpio 10000000.gpio: IRQ index 27 not found
[    1.594685] spinal_lib_gpio 10000000.gpio: IRQ index 28 not found
[    1.600373] spinal_lib_gpio 10000000.gpio: IRQ index 29 not found
[    1.606697] spinal_lib_gpio 10000000.gpio: IRQ index 30 not found
[    1.612639] spinal_lib_gpio 10000000.gpio: IRQ index 31 not found

But that's not important in our case

soundnut commented 3 years ago

I noticed that your're testing with a single CPU image [ 0.114266] smp: Bringing up secondary CPUs ... [ 0.115856] smp: Brought up 1 node, 1 CPU

while mine is a 4 CPU Image. [ 0.118567] smp: Bringing up secondary CPUs ... [ 0.181519] smp: Brought up 1 node, 4 CPUs

Let me try to re-create a single CPU image to see if this is causing the different behavior

Dolu1990 commented 3 years ago

Ahhh well spoted, that is a good factor to check ^^

soundnut commented 3 years ago

Progress again: Single CPU works with either adapter but the lan8720 will not get an IP if the enc28j60 is still connected. So the issue is with interrupts and SMP?

Dolu1990 commented 3 years ago

but the lan8720 will not get an IP if the enc28j60 is still connected.

I never tried having both up at the same time, so i'm not realy sure what to expect in that case.

So the issue is with interrupts and SMP?

That's possible. Basicaly, one thing that the 5.10 added for RISCV (vs 5.0) is that the PLIC (interrupt controller) now work with affinity, which mean that each interrupt pin get assigned to only one CPU. By the past, all CPU had a wakeup.

My main test plateform is on ArtyA7, where i have 2 cores, never had issues, but at the same time, i may have been lucky with which core were assigned to which interrupts. I can't test more cores (i have a 25f ulx3s)

I just tested on ArtyA7 the affinity, basicaly, switching the eth0 irq from the default seting to explcitly the second core.

root@buildroot:~# cat /proc/interrupts 
           CPU0       CPU1       
  5:      45994      45984  RISC-V INTC   5  riscv-timer
  6:         73          0  SiFive PLIC   3  eth0
  7:          0          0  SiFive PLIC  12  spinal-lib-dmasg
  8:          0          0  SiFive PLIC  13  spinal-lib-dmasg
IPI0:        44         20  Rescheduling interrupts
IPI1:      4111       5377  Function call interrupts
IPI2:         0          0  CPU stop interrupts
IPI3:         0          0  IRQ work interrupts
root@buildroot:~# iperf3 -c 192.168.0.24
Connecting to host 192.168.0.24, port 5201
[  5] local 192.168.0.160 port 43926 connected to 192.168.0.24 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.15   sec  3.75 MBytes  27.4 Mbits/sec    0    132 KBytes       
[  5]   1.15-2.14   sec  3.75 MBytes  31.7 Mbits/sec    0    141 KBytes       
[  5]   2.14-3.17   sec  3.75 MBytes  30.7 Mbits/sec    0    141 KBytes       
[  5]   3.17-4.12   sec  3.75 MBytes  32.8 Mbits/sec    0    141 KBytes       
^C[  5]   4.12-4.40   sec   896 KBytes  26.7 Mbits/sec    0    141 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-4.40   sec  15.9 MBytes  30.3 Mbits/sec    0             sender
[  5]   0.00-4.40   sec  0.00 Bytes  0.00 bits/sec                  receiver
iperf3: interrupt - the client has terminated
root@buildroot:~# cat /proc/interrupts 
           CPU0       CPU1       
  5:      55367      55357  RISC-V INTC   5  riscv-timer
  6:       5564          0  SiFive PLIC   3  eth0
  7:          0          0  SiFive PLIC  12  spinal-lib-dmasg
  8:          0          0  SiFive PLIC  13  spinal-lib-dmasg
IPI0:        50         26  Rescheduling interrupts
IPI1:      4960       7393  Function call interrupts
IPI2:         0          0  CPU stop interrupts
IPI3:         0          0  IRQ work interrupts
root@buildroot:~# cat /proc/irq/6/smp_affinity
3
root@buildroot:~# echo 2 >  /proc/irq/6/smp_affinity
root@buildroot:~# cat /proc/irq/6/smp_affinity
2
root@buildroot:~# cat /proc/interrupts 
           CPU0       CPU1       
  5:      67245      67235  RISC-V INTC   5  riscv-timer
  6:       5564          0  SiFive PLIC   3  eth0
  7:          0          0  SiFive PLIC  12  spinal-lib-dmasg
  8:          0          0  SiFive PLIC  13  spinal-lib-dmasg
IPI0:        53         26  Rescheduling interrupts
IPI1:      4977       7478  Function call interrupts
IPI2:         0          0  CPU stop interrupts
IPI3:         0          0  IRQ work interrupts
root@buildroot:~# iperf3 -c 192.168.0.24
Connecting to host 192.168.0.24, port 5201
[  5] local 192.168.0.160 port 43930 connected to 192.168.0.24 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.09   sec  3.75 MBytes  29.0 Mbits/sec    0    132 KBytes       
[  5]   1.09-2.11   sec  3.75 MBytes  30.9 Mbits/sec    0    140 KBytes       
^C[  5]   2.11-2.76   sec  2.38 MBytes  30.4 Mbits/sec    0    140 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-2.76   sec  9.88 MBytes  30.0 Mbits/sec    0             sender
[  5]   0.00-2.76   sec  0.00 Bytes  0.00 bits/sec                  receiver
iperf3: interrupt - the client has terminated
root@buildroot:~# cat /proc/interrupts 
           CPU0       CPU1       
  5:      69564      69554  RISC-V INTC   5  riscv-timer
  6:       5564       3628  SiFive PLIC   3  eth0
  7:          0          0  SiFive PLIC  12  spinal-lib-dmasg
  8:          0          0  SiFive PLIC  13  spinal-lib-dmasg
IPI0:        58         30  Rescheduling interrupts
IPI1:      5000       7499  Function call interrupts
IPI2:         0          0  CPU stop interrupts
IPI3:         0          0  IRQ work interrupts
root@buildroot:~# 

Seems to work fine, even if that's a bit weird that by default it says it was afinity 3 (both core) while in fact it was afinity on the first.

So to come back to your exact case, when you are in single core the lan works fine, while in quad core it just do not work ? right ?

soundnut commented 3 years ago

Don't worry about having 2 adapters - just an observation I've made.

correct - single core works (I can ssh into it) - this works with lan8720 or enc28j60 4 CPUs - I see TX traffic but no RX and no Interrupts.

Should I build an image with 2 CPUs for further testing?

Dolu1990 commented 3 years ago

Should I build an image with 2 CPUs for further testing?

It could be usefull, yes thanks :)

So, at that point, if i had the hardware to run it, in order to debug, what i would do, is add the interrupt pin of the MAC on a pin of the FPGA to probe it. that would allow to split the scope in which the bug could be in two and avoid too much blackbox debug

If you want i can setup that for you ?

soundnut commented 3 years ago

I'm game - no better way to learn than to dissect and probe :-) What would I need to prepare? In terms of debugging , I don't have any fancy JTAG test equipment - just an Altera USB Blaster. So far I've probed things with my Scope via the exposed pins.

Dolu1990 commented 3 years ago

@soundnut Cool :D

So, i created a new SaxonSoc branch named "ulx3s-debug-mac"

You can pull it then rebuild the netlist + bitstream from it.

Then i placed the probes signal from gn20 to gn26 gn20 => toggle at 25 Mhz gn21 => mac interrupt gn22 => cpu0 interrupt gn23 => cpu1 interrupt gn24 => cpu2 .... ....

I get : (which is right) image

let's me know how it goes ^^

soundnut commented 3 years ago

Perfect - thanks. Will try and let you know.

soundnut commented 3 years ago

btw: would you mind telling me where you made this change? Just curious how this all fits together

Dolu1990 commented 3 years ago

for the pin addition ? All here : https://github.com/SpinalHDL/SaxonSoc/commit/ce15e58452d951081c9e892c1eb7e210506aa633#diff-6dcd31ae6adb51345ab6a756e8944a3612dfe8152b481fb302e14794bc4f03a0R381

It is a bit specific, basicaly it extends the SoC with additional stuff in a OOP manner

soundnut commented 3 years ago

this is what I'm getting image D0 clock, D1 CPU0 - D4 CPU4 not sure if my analyzer is to slow or if something else is at play. the clock seems to be jittery/unstable

soundnut commented 3 years ago

image

using my oscilloscope probe on GN20 - Clock mind you, I only have a 25MHz scope.... not sure if this measurement is valid at all.

Dolu1990 commented 3 years ago

So 26 Mhz was just there to be sure you had a pattern to reconize, to be sure everything is updated ^^

So, on your trace, d1 and d2 stay all the time high ? never going down ? Also, can you check the CPU usages via a htop ? To see if CPU 0 is "busy"

Also, one thing, gn21 => mac interrupt it isn't on your trace ?

soundnut commented 3 years ago

apologies - had the thresholds wrong image

D0 - CLK D1 - MAC (it was there in the first trace - my label in the first screenshot was wrong) D2 - CPU0 D3 - CPU1 .... not sure what's going on with D1 and D2

soundnut commented 3 years ago

image utilization sees to toggle between 1 and 4

Dolu1990 commented 3 years ago

that utilisation of 20-30 % is from htop, all good there, Hmm and on your last wave, what is the time scale (aproximativly) ? ~~100 milli seconds ?

Dolu1990 commented 3 years ago

One thing, did the synthesis timings passed in quad core ?

soundnut commented 3 years ago

Warning: Max frequency for clock '$glbnet$clocking_pll_clkout2': 47.14 MHz (FAIL at 52.08 MHz) Info: Max frequency for clock '$glbnet$clocking_rmii_clk$TRELLIS_IO_IN': 51.71 MHz (PASS at 50.00 MHz) Info: Max frequency for clock '$glbnet$clocking_pll_clkout0': 187.97 MHz (PASS at 125.00 MHz) Info: Max frequency for clock '$glbnet$clocking_pll_clkout3': 58.46 MHz (PASS at 25.00 MHz) Info: Max frequency for clock '$glbnet$debug_jtag_tck$TRELLIS_IO_IN': 89.33 MHz (PASS at 50.00 MHz)