• AVR Freaks

Hot!Interfacing ENC424J600 with the SOM1-SAMA5D27 Board

Author
chinmay900
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2019/06/15 08:18:46
  • Location: 0
  • Status: offline
2019/06/17 22:51:24 (permalink)
0

Interfacing ENC424J600 with the SOM1-SAMA5D27 Board

Hello,
I am trying to interface the ENC424J600 chip with the SOM Board and I have enabled the driver for the same from the "make linux-menuconfig" for Buildroot under Drivers. Even after adding the required dt-bindings for the ethernet module (which communicates via SPI), the SOM board still doesn't recognize the ethernet port. I have connected the SPI connections of the ENC424J600 to the microbus 1 of the SOM Board, which uses the Ports PD0, PC30, PC29, PC28. As far as I know, there is no interrupt involved in this chip as compared to ENC28J60, so taking reference from the dt-bindigs of ENC28J60 and removing the interrupt part, I changed the dts file of the SOM Board. But there is no eth1 after ifconfig, nor any reference in dmesg. Is there something missing? How can I make this work?
Attached dts file for the SOM Board, Config file
Appending boot log and kernel version will take some time.
post edited by chinmay900 - 2019/06/21 23:00:13
#1

6 Replies Related Threads

    thackerp
    Moderator
    • Total Posts : 122
    • Reward points : 0
    • Joined: 2012/01/18 12:25:44
    • Location: Chandler, AZ
    • Status: offline
    Re: Interfacing ENC424J600 with the SOM1-SAMA5D27 Board 2019/06/18 07:30:11 (permalink)
    0
    Kernel version, boot log, device tree file(s) and .config would all be helpful in diagnosing the problem.
    #2
    chinmay900
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2019/06/15 08:18:46
    • Location: 0
    • Status: offline
    Re: Interfacing ENC424J600 with the SOM1-SAMA5D27 Board 2019/06/19 04:01:51 (permalink)
    0
    Boot Log:
     
    Booting Linux on physical CPU 0x0
    Linux version 4.14.73-linux4sam_6.0 (root@ubuntu) (gcc version 6.4.0 (Buildroot 2018.02)) #3 Tue Jan 8 16:07:45 IST 2019
    CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d
    CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    OF: fdt: Machine model: Atmel SAMA5D27 SOM1 EK
    Memory policy: Data cache writeback
    cma: Failed to reserve 64 MiB
    On node 0 totalpages: 32768
    free_area_init_node: node 0, pgdat c0a379c4, node_mem_map c7edb000
      Normal zone: 288 pages used for memmap
      Normal zone: 0 pages reserved
      Normal zone: 32768 pages, LIFO batch:7
    CPU: All CPU(s) started in SVC mode.
    pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
    pcpu-alloc: [0] 0
    Built 1 zonelists, mobility grouping off. Total pages: 32480
    Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk1p2 rw rootwait
    PID hash table entries: 512 (order: -1, 2048 bytes)
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    Memory: 119932K/131072K available (6144K kernel code, 228K rwdata, 1140K rodata, 1024K init, 173K bss, 11140K reserved, 0K cma-reserved)
    Virtual kernel memory layout:
        vector : 0xffff0000 - 0xffff1000 ( 4 kB)
        fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
        vmalloc : 0xc8800000 - 0xff800000 ( 880 MB)
        lowmem : 0xc0000000 - 0xc8000000 ( 128 MB)
        modules : 0xbf000000 - 0xc0000000 ( 16 MB)
          .text : 0xc0008000 - 0xc0700000 (7136 kB)
          .init : 0xc0900000 - 0xc0a00000 (1024 kB)
          .data : 0xc0a00000 - 0xc0a391d0 ( 229 kB)
           .bss : 0xc0a3e87c - 0xc0a69fdc ( 174 kB)
    NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
    L2C-310 ID prefetch enabled, offset 2 lines
    L2C-310 dynamic clock gating enabled, standby mode enabled
    L2C-310 cache controller enabled, 8 ways, 128 kB
    L2C-310: CACHE_ID 0x410000c9, AUX_CTRL 0x36020000
    clocksource: pit: mask: 0x7ffffff max_cycles: 0x7ffffff, max_idle_ns: 11654027029 ns
    sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
    Console: colour dummy device 80x30
    Calibrating delay loop... 326.86 BogoMIPS (lpj=1634304)
    pid_max: default: 32768 minimum: 301
    Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    CPU: Testing write buffer coherency: ok
    Setting up static identity map for 0x20100000 - 0x20100060
    devtmpfs: initialized
    random: get_random_u32 called from 0xc032e778 with crng_init=0
    VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
    clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    futex hash table entries: 256 (order: -1, 3072 bytes)
    pinctrl core: initialized pinctrl subsystem
    NET: Registered protocol family 16
    DMA: preallocated 256 KiB pool for atomic coherent allocations
    AT91: PM: standby: standby, suspend: ulp0
    AT91: mode = 0x20401, ploarity = 0400
    tcb_clksrc: tc0 at 10.750 MHz
    clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 186464433812 ns
    at_xdmac f0010000.dma-controller: 16 channels, mapped at 0xc8889000
    at_xdmac f0004000.dma-controller: 16 channels, mapped at 0xc888b000
    AT91: Detected SoC family: sama5d2
    AT91: Detected SoC: sama5d27c 128MiB SiP, revision 2
    VDDANA: supplied by VDDIN_3V3
    advref: supplied by VDDANA
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    at91_i2c f8028000.i2c: could not find pctldev for node /ahb/apb/pinctrl@fc038000/i2c0_default, deferring probe
    at91_i2c fc028000.i2c: could not find pctldev for node /ahb/apb/pinctrl@fc038000/i2c1_default, deferring probe
    media: Linux media interface: v0.10
    Linux video capture interface: v2.00
    pps_core: LinuxPPS API ver. 1 registered
    pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    PTP clock support registered
    Advanced Linux Sound Architecture Driver Initialized.
    clocksource: Switched to clocksource tcb_clksrc
    NET: Registered protocol family 2
    TCP established hash table entries: 1024 (order: 0, 4096 bytes)
    TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
    TCP: Hash tables configured (established 1024 bind 1024)
    UDP hash table entries: 256 (order: 0, 4096 bytes)
    UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    NET: Registered protocol family 1
    RPC: Registered named UNIX socket transport module.
    RPC: Registered udp transport module.
    RPC: Registered tcp transport module.
    RPC: Registered tcp NFSv4.1 backchannel transport module.
    workingset: timestamp_bits=14 max_order=15 bucket_order=1
    io scheduler noop registered (default)
    io scheduler mq-deadline registered
    io scheduler kyber registered
    pinctrl-at91-pio4 fc038000.pinctrl: atmel pinctrl initialized
    brd: module loaded
    loop: module loaded
    atmel_usart_serial.0.auto: ttyS0 at MMIO 0xf8020000 (irq = 37, base_baud = 5125000) is a ATMEL_SERIAL
    console [ttyS0] enabled
    atmel_usart_serial.1.auto: ttyS2 at MMIO 0xf8024000 (irq = 38, base_baud = 5125000) is a ATMEL_SERIAL
    atmel_usart_serial.2.auto: ttyS1 at MMIO 0xfc00c000 (irq = 41, base_baud = 5125000) is a ATMEL_SERIAL
    at91_i2c f8038600.i2c: can't get DMA channel, continue without DMA support
    at91_i2c f8038600.i2c: Using FIFO (16 data)
    at91_i2c f8038600.i2c: AT91 i2c bus driver (hw version: 0x704).
    atmel_qspi f0024000.spi: sst26vf064b (8192 Kbytes)
    5 ofpart partitions found on MTD device f0024000.spi
    Creating 5 MTD partitions on "f0024000.spi":
    0x000000000000-0x000000010000 : "at91bootstrap"
    0x000000010000-0x0000000b0000 : "bootloader"
    0x0000000b0000-0x0000000c0000 : "bootloader env"
    0x0000000c0000-0x0000000e0000 : "device tree"
    0x0000000e0000-0x0000004e0000 : "kernel"
    atmel_spi f8000000.spi: DMA TX channel not available, SPI unable to use DMA
    atmel_spi f8000000.spi: Atmel SPI Controller using PIO only
    atmel_spi f8000000.spi: Using FIFO (16 data)
    atmel_spi f8000000.spi: Atmel SPI Controller version 0x311 at 0xf8000000 (irq 30)
    atmel_spi fc018400.spi: DMA TX channel not available, SPI unable to use DMA
    atmel_spi fc018400.spi: Atmel SPI Controller using PIO only
    atmel_spi fc018400.spi: Using FIFO (16 data)
    atmel_spi fc018400.spi: Atmel SPI Controller version 0x311 at 0xfc018400 (irq 180)
    libphy: Fixed MDIO Bus: probed
    CAN device driver interface
    m_can fc050000.can: m_can device registered (irq=49, version=31)
    libphy: MACB_mii_bus: probed
    Micrel KSZ8081 or KSZ8091 f8008000.ethernet-ffffffff:07: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=f8008000.ethernet-ffffffff:07, irq=178)
    macb f8008000.ethernet eth0: Cadence GEM rev 0x00020203 at 0xf8008000 irq 31 (54:10:ec:aa:0b:07)
    usbcore: registered new interface driver asix
    usbcore: registered new interface driver ax88179_178a
    usbcore: registered new interface driver cdc_ether
    usbcore: registered new interface driver smsc75xx
    usbcore: registered new interface driver net1080
    usbcore: registered new interface driver cdc_subset
    usbcore: registered new interface driver zaurus
    usbcore: registered new interface driver cdc_ncm
    ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    ehci-atmel: EHCI Atmel driver
    atmel-ehci 500000.ehci: EHCI Host Controller
    atmel-ehci 500000.ehci: new USB bus registered, assigned bus number 1
    atmel-ehci 500000.ehci: irq 19, io mem 0x00500000
    atmel-ehci 500000.ehci: USB 2.0 started, EHCI 1.00
    usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb1: Product: EHCI Host Controller
    usb usb1: Manufacturer: Linux 4.14.73-linux4sam_6.0 ehci_hcd
    usb usb1: SerialNumber: 500000.ehci
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 3 ports detected
    ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    ohci-atmel: OHCI Atmel driver
    at91_ohci 400000.ohci: failed to request gpio "overcurrent" IRQ
    at91_ohci 400000.ohci: failed to request gpio "overcurrent" IRQ
    at91_ohci 400000.ohci: failed to request gpio "overcurrent" IRQ
    at91_ohci 400000.ohci: USB Host Controller
    at91_ohci 400000.ohci: new USB bus registered, assigned bus number 2
    at91_ohci 400000.ohci: irq 19, io mem 0x00400000
    usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
    usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb2: Product: USB Host Controller
    usb usb2: Manufacturer: Linux 4.14.73-linux4sam_6.0 ohci_hcd
    usb usb2: SerialNumber: at91
    hub 2-0:1.0: USB hub found
    hub 2-0:1.0: 3 ports detected
    usbcore: registered new interface driver cdc_acm
    cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
    usbcore: registered new interface driver usb-storage
    usbcore: registered new interface driver usbserial
    usbcore: registered new interface driver usbserial_generic
    usbserial: USB Serial support registered for generic
    usbcore: registered new interface driver ftdi_sio
    usbserial: USB Serial support registered for FTDI USB Serial Device
    usbcore: registered new interface driver pl2303
    usbserial: USB Serial support registered for pl2303
    rtc rtc0: invalid alarm value: 1900-1-1 0:0:0
    at91_rtc f80480b0.rtc: registered as rtc0
    at91_rtc f80480b0.rtc: AT91 Real Time Clock driver.
    i2c /dev entries driver
    OF: graph: no port node found in /ahb/apb/isc@f0008000
    atmel_isc f0008000.isc: no subdev found
    AT91: Starting after wakeup
    sama5d4_wdt f8048040.watchdog: initialized (timeout = 16 sec, nowayout = 0)
    sdhci: Secure Digital Host Controller Interface driver
    sdhci: Copyright(c) Pierre Ossman
    sdhci-pltfm: SDHCI platform and OF driver helper
    sdhci-at91 a0000000.sdio-host: update clk mul to 39 as gck rate is 480000000 Hz
    mmc0: SDHCI controller on a0000000.sdio-host [a0000000.sdio-host] using ADMA
    sdhci-at91 b0000000.sdio-host: update clk mul to 39 as gck rate is 480000000 Hz
    mmc1: SDHCI controller on b0000000.sdio-host [b0000000.sdio-host] using ADMA
    ledtrig-cpu: registered to indicate activity on CPUs
    atmel_aes f002c000.aes: version: 0x500
    atmel_aes f002c000.aes: Atmel AES - Using dma0chan0, dma0chan1 for DMA transfers
    atmel_sha f0028000.sha: version: 0x510
    atmel_sha f0028000.sha: using dma0chan2 for DMA transfers
    atmel_sha f0028000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512
    atmel_tdes fc044000.tdes: version: 0x703
    atmel_tdes fc044000.tdes: using dma0chan3, dma0chan4 for DMA transfers
    atmel_tdes fc044000.tdes: Atmel DES/TDES
    usbcore: registered new interface driver usbhid
    usbhid: USB HID core driver
    ip_tables: (C) 2000-2006 Netfilter Core Team
    NET: Registered protocol family 10
    Segment Routing with IPv6
    sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    NET: Registered protocol family 17
    can: controller area network core (rev 20170425 abi 9)
    NET: Registered protocol family 29
    can: raw protocol (rev 20170425)
    can: broadcast manager protocol (rev 20170425 t)
    can: netlink gateway (rev 20170425) max_hops=1
    at91_i2c f8028000.i2c: can't get DMA channel, continue without DMA support
    at91_i2c f8028000.i2c: Using FIFO (16 data)
    mmc1: new high speed SDHC card at address aaaa
    mmcblk1: mmc1:aaaa SA08G 7.40 GiB
    at24 3-0050: 256 byte 24c02 EEPROM, writable, 8 bytes/write
    at91_i2c f8028000.i2c: AT91 i2c bus driver (hw version: 0x704).
    at91_i2c fc028000.i2c: can't get DMA channel, continue without DMA support
    at91_i2c fc028000.i2c: Using FIFO (16 data)
     mmcblk1: p1 p2
    at91_i2c fc028000.i2c: AT91 i2c bus driver (hw version: 0x704).
    input: gpio_keys as /devices/platform/gpio_keys/input/input0
    at91_rtc f80480b0.rtc: setting system clock to 2012-01-01 01:16:47 UTC (1325380607)
    ALSA device list:
      No soundcards found.
    atmel_usart_serial atmel_usart_serial.0.auto: using dma0chan5 for rx DMA transfers
    atmel_usart_serial atmel_usart_serial.0.auto: using dma0chan6 for tx DMA transfers
    EXT4-fs (mmcblk1p2): recovery complete
    EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
    VFS: Mounted root (ext4 filesystem) on device 179:2.
    devtmpfs: mounted
    Freeing unused kernel memory: 1024K
    random: fast init done
    EXT4-fs (mmcblk1p2): re-mounted. Opts: data=ordered
    udevd[112]: starting version 3.2.5
    random: udevd: uninitialized urandom read (16 bytes read)
    random: udevd: uninitialized urandom read (16 bytes read)
    random: udevd: uninitialized urandom read (16 bytes read)
    udevd[113]: starting eudev-3.2.5
    atmel_usba_udc 300000.gadget: MMIO registers at [mem 0xfc02c000-0xfc02c3ff] mapped at c8a6d000
    atmel_usba_udc 300000.gadget: FIFO at [mem 0x00300000-0x003fffff] mapped at c8d00000
    random: dd: uninitialized urandom read (512 bytes read)
    random: dbus-uuidgen: uninitialized urandom read (12 bytes read)
    random: dbus-uuidgen: uninitialized urandom read (8 bytes read)
    IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    macb f8008000.ethernet eth0: link up (100/Full)
    IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    urandom_read: 2callbacks suppressed
    random: php-fpm: uninitialized urandom read (32 bytes read)
    random: lighttpd: uninitialized urandom read (32 bytes read)
    at91_i2c f8038600.i2c: controller timed out
    random: crng init done

     
    Kernel Version: 4.14.73-linux4sam_6.0
    Using buildroot to build linux-linux4sam
    #3
    thackerp
    Moderator
    • Total Posts : 122
    • Reward points : 0
    • Joined: 2012/01/18 12:25:44
    • Location: Chandler, AZ
    • Status: offline
    Re: Interfacing ENC424J600 with the SOM1-SAMA5D27 Board 2019/06/20 15:49:29 (permalink)
    0
    You've sent the Buildroot .config, what would really help is the kernel .config. What I'm looking for is which driver you've included to support the ENC424J600.
     
    In your dts, the driver compatible string is "compatible = "microchip,encx24j600"". I cannot find that string in either the device tree binding documentation or the driver source code.
    #4
    chinmay900
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2019/06/15 08:18:46
    • Location: 0
    • Status: offline
    Re: Interfacing ENC424J600 with the SOM1-SAMA5D27 Board 2019/06/21 23:02:00 (permalink)
    0
    Sorry for the error. The .config file from kernel is now attached to the main post. There is some problem with uploading the file in this post. I get the error :
    You don't have permission to access "http://www.microchip.com/forums/post.aspx?" on this server.
    Reference #18.ea70903b.1561183285.68d3166
     
     Yes, you are right. There is no direct reference to any documentation specifying encx24j600 in a dts file, but such driver does exist in the driver source code. Based on a post where encx24j600 was interfaced with an Raspberry pi, the changes in dts file was made. The changes in dts for enc28j60 was included in the dts file and the names were changed to fit for encx24j600, according to the following website : https://lb.raspberrypi.org/forums/viewtopic.php?t=180491
    Are the changes made in the dts file not compatible?
    Thanks for the help.
    Regards.
     
    #5
    thackerp
    Moderator
    • Total Posts : 122
    • Reward points : 0
    • Joined: 2012/01/18 12:25:44
    • Location: Chandler, AZ
    • Status: offline
    Re: Interfacing ENC424J600 with the SOM1-SAMA5D27 Board 2019/06/24 15:18:26 (permalink)
    0
    Your kernel configuration shows the encx24j600 driver configured into the kernel build correctly. The Flexcom 4 SPI device is recognized during kernel boot. But the driver is not being initialized correctly.
     
    The compatible string is what binds the driver to the device, and there is no compatible string in the driver to match the dts entry. The driver needs to be modified to use device tree. Here's a link to a post by someone who did something similar.
    https://github.com/beagleboard/linux/issues/70
     
    #6
    chinmay900
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2019/06/15 08:18:46
    • Location: 0
    • Status: offline
    Re: Interfacing ENC424J600 with the SOM1-SAMA5D27 Board 2019/06/29 04:54:17 (permalink)
    0
    Hi,
     
    Thanks for your help. Turns out, it was a connection problem. The interrupt pin was not connected in the first place. I interfaced the chip by modifying the dts file for the required task and changing the driver code to interact with the dts. Now the encx24j600 module gets recognized by the SOM Board with an IP assigned to it. But the problem is that until the main ethernet on the SOM Board is connected, the encx module ethernet responds... If I disconnect the main ethernet, the encx module ethernet stops working completely, no ssh, no ping, nothing.... This was because I was using the main ethernet for ssh. After disconnecting and doing an ssh on the other IP, everything worked fine.
    I'll attach the modified dts file, the driver code and the output of the terminal when connected via JTAG USB port for reference if anyone needs.
    Thank you so much for your help.
    Regards,
    Chinmay
    post edited by chinmay900 - 2019/07/07 22:56:40
    #7
    Jump to:
    © 2019 APG vNext Commercial Version 4.5