Beckhoff / CCAT

Beckhoff CCAT FPGA Kernel mode driver to run EtherCAT Master on CX devices
Other
34 stars 16 forks source link

No interface loaded #2

Closed Helvethor closed 7 years ago

Helvethor commented 8 years ago

Hello,

I integrated this module to our Buildroot tree and it compiled fine. However, after running modprobe, nothing happens. I would expect an interface to be created (such as ecat, ecat0 or whatever) or at least a message in dmesg. I am working with a CX9020 (no DMA). I tried to comment all lines except the one refering to emi in the ccat_driver structure at the top of module.c. It don't see any difference

Do you have any clues?

Have a nice day, Vincent

pbruenn commented 8 years ago

Hi Vincent, What does lsmod | grep ccat give you? If nothing, you said you are running modprobe. Did you a depmod -a before? Regards, Patrick p.s.: sorry for the delay, didn't got a notification

Helvethor commented 8 years ago

Hi,

lsmod gives me one entry corresponding to the module:

Module                  Size  Used by    Tainted: G  
ccat                   14025  - 

depmod is not installed on my system (built with buildroot). You might find infos in my dmesg :

Booting Linux on physical CPU 0x0
Linux version 3.13.0-cx9020 (helvethor@ift-c191-l) (gcc version 4.9.3 (Buildroot 2015.08.1-00033-ga425365-dirty) ) #1 Fri Jul 8 14:44:25 CEST 2016
CPU: ARMv7 Processor [412fc085] revision 5 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Beckhoff CX9020
Memory policy: Data cache writeback
On node 0 totalpages: 262144
free_area_init_node: node 0, pgdat c04ec9e8, node_mem_map c1007000
  Normal zone: 1024 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 131072 pages, LIFO batch:31
  HighMem zone: 2048 pages used for memmap
  HighMem zone: 131072 pages, LIFO batch:31
CPU: All CPU(s) started in SVC mode.
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0 
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 261120
Kernel command line: console=ttymxc3,115200n8 root=/dev/mmcblk0p5 rootfstype=ext4 rootwait quiet usbcore.authorized_default=0 ro panic=5 net.ifnames=0
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 1034604K/1048576K available (3588K kernel code, 156K rwdata, 1124K rodata, 139K init, 209K bss, 13972K reserved, 524288K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)
    lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc04a228c   (4713 kB)
      .init : 0xc04a3000 - 0xc04c5d90   ( 140 kB)
      .data : 0xc04c6000 - 0xc04ed3c0   ( 157 kB)
       .bss : 0xc04ed3c0 - 0xc0521afc   ( 210 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:16 nr_irqs:16 16
TrustZone Interrupt Controller (TZIC) initialized
CPU identified as i.MX53, silicon rev 2.1
sched_clock: 32 bits at 33MHz, resolution 30ns, wraps every 128849019873ns
Console: colour dummy device 80x30
Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x70369ca8 - 0x70369d00
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 2
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
hw-breakpoint: debug architecture 0x4 unsupported.
imx53-pinctrl 53fa8000.iomuxc: initialized IMX pinctrl driver
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
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
Switched to clocksource mxc_timer1
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
bounce pool size: 64 pages
fuse init (API version 7.22)
msgmni has been set to 996
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
imx-weim 63fda000.weim: Driver registered.
imx-sdma 63fb0000.sdma: Direct firmware load failed with error -2
imx-sdma 63fb0000.sdma: Falling back to user helper
imx-sdma 63fb0000.sdma: initialized
Serial: IMX driver
53fc0000.serial: ttymxc1 at MMIO 0x53fc0000 (irq = 48, base_baud = 4166666) is a IMX
53ff0000.serial: ttymxc3 at MMIO 0x53ff0000 (irq = 29, base_baud = 4166666) is a IMX
console [ttymxc3] enabled
[drm] Initialized drm 1.1.0 20060810
brd: module loaded
loop: module loaded
m25p80 spi1.0: m25p40 (512 Kbytes)
1 ofpart partitions found on MTD device spi1.0
Creating 1 MTD partitions on "spi1.0":
0x000000000000-0x000000080000 : "bootloader"
spi_imx 63fac000.ecspi: probed
bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
libphy: fec_enet_mii_bus: probed
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
usbcore: registered new interface driver usb-storage
imx_usb 53f80200.usb: usbmisc init failed, ret=-517
platform 53f80200.usb: Driver imx_usb requests probe deferral
mousedev: PS/2 mouse device common for all mice
snvs_rtc 53fa4000.rtc: rtc core: registered 53fa4000.rtc as rtc0
imx2-wdt 53f98000.wdog: IMX2+ Watchdog Timer enabled. timeout=60s (nowayout=0)
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on 50004000.esdhc [50004000.esdhc] using ADMA
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new high speed SDHC card at address 0001
isa bounce pool size: 16 pages
mmc1: SDHCI controller on 50008000.esdhc [50008000.esdhc] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] No driver support for vblank timestamp query.
[drm] Initialized imx-drm 1.0.0 20120507 on minor 0
imx-ipuv3 18000000.ipu: IPUv3M probed
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (16165 buckets, 64660 max)
ip_tables: (C) 2000-2006 Netfilter Core Team
arp_tables: (C) 2002 David S. Miller
TCP: cubic registered
NET: Registered protocol family 17
8021q: 802.1Q VLAN Support v1.8
mmcblk0: mmc0:0001 00000 29.2 GiB 
ci_hdrc ci_hdrc.0: doesn't support gadget
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
 mmcblk0: p1 p2 < p5 p6 p7 p8 p9 p10 >
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
snvs_rtc 53fa4000.rtc: setting system clock to 2016-07-11 13:57:12 UTC (1468245432)
imx-drm imx-drm: No connectors reported connected with modes
[drm] Cannot find any crtc or sizes - going 1024x768
Console: switching to colour frame buffer device 128x48
imx-drm imx-drm: fb0:  frame buffer device
imx-drm imx-drm: registered panic notifier
EXT4-fs (mmcblk0p5): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) readonly on device 179:5.
devtmpfs: mounted
Freeing unused kernel memory: 136K (c04a3000 - c04c5000)
usb 1-1: new high-speed USB device number 2 using ci_hdrc
EXT4-fs (mmcblk0p6): warning: maximal mount count reached, running e2fsck is recommended
EXT4-fs (mmcblk0p6): mounted filesystem with ordered data mode. Opts: (null)
udevd[75]: starting version 3.1.2
random: udevd urandom read with 19 bits of entropy available
usb 1-1: Device is not authorized for usage
EXT4-fs (mmcblk0p5): warning: maximal mount count reached, running e2fsck is recommended
EXT4-fs (mmcblk0p5): re-mounted. Opts: data=ordered
fec 63fec000.ethernet lan1: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=63fec000.etherne:01, irq=-1)
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usb 1-1: authorized to connect
libphy: 63fec000.etherne:01 - Link is Up - 100/Full
random: nonblocking pool is initialized
EXT4-fs (mmcblk0p5): re-mounted. Opts: data=ordered

Regards, Vincent

pbruenn commented 8 years ago

dmesg output should look like:

beckhoff@CX9020:~$ dmesg | grep ccat
[ 3172.989131] ccat: registered ccat as gpiochip503 with #9 GPIOs.
[ 3172.990074] ccat: registered eth0 as network device.
[ 3172.990121] ccat: ccat_sram_probe: 0x0016 rev: 0x0000
[ 3172.990716] ccat: registered ccat_sram0.

Just a poor guess: Is CONFIG_PCI defined in your build? It shouldn't.

I think you have to add some pr_info("%s()\n", __FUNCTION__); to the functions in module.c and we can take another look into dmesg.

Regards, Patrick

pbruenn commented 8 years ago

Another idea: Have you loaded the FPGA firmware?

Do you use u-boot from the CX9020 repository?

Did you add the loadccat command to your custom boot script?