This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/dra726: Problem getting MCP25625 seen on Linux

Part Number: DRA726
Other Parts Discussed in Thread: DRA722

Tool/software: Linux

I have been trying to get the 3 external MCP25625 Microchip CAN devices recognized on linux and I'm not having much success.  

DCAN1 and DCAN2 work as can0 and can1

I would like to see the other three as can2, can3 and can4

All three devices are connected to SPI1

Int for first device on gpio6_7 B16

Int for second device on gpio6_8 C15

Int for third device on gpio6_9 A16

spi1 cs0  A24

spi1 cs1 A22

spi1 cs2 B21

spi1 sclk A25

spi1 d0 B25 --> CAN SI

spi1 d1 F16 --> CAN SO

Firs device has 16Mhz xtal, CLKOUT connected to other 2 devices


Is my linux device tree entry correct?


       clocks {
                clk16m: clk@1 {
                        compatible = "fixed-clock";
                        reg=<0>;
                        #clock-cells = <0>;
                        clock-frequency = <16000000>;
                        clock-output-names = "clk16m";
                };
        };

        mcspi1_pins: pinmux_mcspi1_pins {
                pinctrl-single,pins = <
                        0x3a4 (PIN_OUTPUT | MUX_MODE0)                                     /* spi1_sclk.spi1_sclk */
                        0x3ac (PIN_INPUT | MUX_MODE0)                                          /* spi1_d0.spi1_d0 */
                        0x3a8 (PIN_OUTPUT | MUX_MODE0)                                      /* spi1_d1.spi1_d1 */
                        0x380 (PIN_OUTPUT | MUX_MODE0)                                      /* spi1_cs0.spi1_cs0 */
                        0x384 (PIN_OUTPUT | MUX_MODE0)                                      /* spi1_cs1.spi1_cs0 */
                        0x388 (PIN_OUTPUT | MUX_MODE0 | SLEWCONTROL)     /* spi1_cs2.spi1_cs0 */
                >;
        };


&mcspi1 {
        pinctrl-names = "default";
        pinctrl-0 = <&mcspi1_pins>;

        dcan3: dcan3@0 {
        status = "okay";
        compatible = "microchip,mcp2515";
        reg = <0>;
        mode = <0>;
 
                clocks = <&clk16m>;
        interrupt-parent = <&gpio>;
                interrupts = <199 IRQ_TYPE_LEVEL_LOW>;

        spi-max-frequency = <10000000>;
        mcp251x,enable-clkout = <1>;
       };

        dcan4: dcan4@1 {
        status = "okay";
        compatible = "microchip,mcp2515";
        reg = <1>;
        mode = <0>;
 
                clocks = <&clk16m>;
        interrupt-parent = <&gpio>;
                interrupts = <200 IRQ_TYPE_LEVEL_LOW>;

        spi-max-frequency = <10000000>;
         };

        dcan5: dcan5@2 {
        status = "okay";
        compatible = "microchip,mcp2515";
        reg = <2>;
        mode = <0>;
 
                clocks = <&clk16m>;
        interrupt-parent = <&gpio>;
                interrupts = <201 IRQ_TYPE_LEVEL_LOW>;

        spi-max-frequency = <10000000>;
       };
};


Linux conf :

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_HAMRADIO is not set
CONFIG_CAN=m
CONFIG_CAN_RAW=m
CONFIG_CAN_BCM=m
# CONFIG_CAN_GW is not set

#
# CAN Device Drivers
#
# CONFIG_CAN_VCAN is not set
# CONFIG_CAN_SLCAN is not set
CONFIG_CAN_DEV=m
CONFIG_CAN_CALC_BITTIMING=y
# CONFIG_CAN_LEDS is not set
CONFIG_CAN_TI_HECC=m
# CONFIG_CAN_FLEXCAN is not set
# CONFIG_CAN_GRCAN is not set
# CONFIG_CAN_RCAR is not set
# CONFIG_CAN_SJA1000 is not set
CONFIG_CAN_C_CAN=m
CONFIG_CAN_C_CAN_PLATFORM=m
CONFIG_CAN_M_CAN=m
# CONFIG_CAN_CC770 is not set

#
# CAN SPI interfaces
#
CONFIG_CAN_MCP251X=m

CONFIG_SPI=y
CONFIG_SPI_DEBUG=y
CONFIG_SPI_MASTER=y

#
# SPI Master Controller Drivers
#
CONFIG_SPI_OMAP24XX=y


In u-boot


   { SPI1_SCLK, (M0 | PIN_OUTPUT) },                          /* spi1_sclk.spi1_sclk */
   { SPI1_D1, (M0 | PIN_INPUT) },                             /* spi1_d1.spi1_d1 */
   { SPI1_D0, (M0 | PIN_OUTPUT) },                            /* spi1_d0.spi1_d0 */
   { SPI1_CS0, (M0 | PIN_OUTPUT) },                           /* spi1_cs0.spi1_cs0 */
   { SPI1_CS1, (M0 | PIN_OUTPUT) },                           /* spi1_cs1.spi1_cs1 */
   { SPI1_CS2, (M0 | PIN_OUTPUT | SLEWCONTROL) },             /* spi1_cs2.spi1_cs2 */

  • Hi Michel,

    Sorry about the delayed response.
    In your device tree, set the interrupt-parent entry to the specific gpio instance, and correspondingly change the interrupts.
    For example, the entry for dcan3 will be

    interrupt-parent = <&gpio6>;
    interrupts = <7 IRQ_TYPE_LEVEL_LOW>;

    Regards
    Shravan
  • Shravan,

    I still can only see the two internal CAN ports can0 and can1 as well as eth0 lo and sit0 on /sys/class/net

    Michel
  • Michel,

    For the spi1_sclk signals to work properly, the INPUTENABLE bit needs to be set, so your pinmux config in u-boot needs to be

    { SPI1_SCLK, (M0 | PIN_OUTPUT | INPUT)_EN }

    You needn't set the pinmux in the kernel-device tree.

    A few questions:
    1. I don't understand the purpose of the 16Mhz clock. The SPI module can only be set in master mode (only support for master mode exists in the driver), and in this mode the serial clock is an output for devices connected over SPI.
    2. What's the purpose of the node attribute in each dcan node entry? The microchip,mcp2515 device-tree bindings doesn't include 'node' as an entry.

    Regards
    Shravan
  • Shravan,

    I am probably mixing the signification of the clocks. One of the 3 microchip has a 16Mhz xtal, the output is fed to the other two devices.

    I was following an example of someone else, likely bad idea. How would you set that part?
    Each device has its own cs and interrupt. Only the first one has a dedicated xtal while the other two use the external clock output from the first one.

    Michel
  • Michel,

    The SPI device serial clock output should be set as the input for all the devices.

    Can you try the following changes and send over the logs:

    1. Add '#define debug' to the first line of the files 'drivers/spi/spi.c', 'drivers/spi/spi-omap2-mcspi.c' and 'drivers/net/can/spi/mcp251x.c'. Rebuild the kernel with these changes
    2. On the target list the contents of the folder '/sys/device/platform/44000000.ocp/48098000.spi/spi_master', you should devices such as spi0.0, spi0.1, spi0.2. This would indicate that the spi devices are recognized.
    3. Can you provide the dmesg logs after rebuilding the kernel with the debug flags indicated in step 1.

    Regards
    Shravan
  • Shravan,

    Here is the content of dmesg, as you can see there is no mention of any of the 3 spi ports that I have enabled.

    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Initializing cgroup subsys cpuset
    [ 0.000000] Initializing cgroup subsys cpu
    [ 0.000000] Initializing cgroup subsys cpuacct
    [ 0.000000] Linux version 4.4.45-RevA+ (michel@michel) (gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02) ) #32 SMP PREEMPT Thu Mar 22 21:30:21 EDT 2018
    [ 0.000000] CPU: ARMv7 Processor [412fc0f2] revision 2 (ARMv7), cr=10c5387d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
    [ 0.000000] Machine model: ACTIA 12 inch Display
    [ 0.000000] Reserved memory: created CMA memory pool at 0x95800000, size 56 MiB
    [ 0.000000] Reserved memory: initialized node ipu2_cma@95800000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created CMA memory pool at 0x9d000000, size 32 MiB
    [ 0.000000] Reserved memory: initialized node ipu1_cma@9d000000, compatible id shared-dma-pool
    [ 0.000000] cma: Reserved 24 MiB at 0xbe400000
    [ 0.000000] Memory policy: Data cache writealloc
    [ 0.000000] OMAP4: Map 0xbfe00000 to fe600000 for dram barrier
    [ 0.000000] On node 0 totalpages: 255232
    [ 0.000000] free_area_init_node: node 0, pgdat c08b1680, node_mem_map ef6cc000
    [ 0.000000] Normal zone: 1728 pages used for memmap
    [ 0.000000] Normal zone: 0 pages reserved
    [ 0.000000] Normal zone: 190208 pages, LIFO batch:31
    [ 0.000000] HighMem zone: 65024 pages, LIFO batch:15
    [ 0.000000] DRA722 ES2.0
    [ 0.000000] PERCPU: Embedded 11 pages/cpu @ef672000 s14784 r8192 d22080 u45056
    [ 0.000000] pcpu-alloc: s14784 r8192 d22080 u45056 alloc=11*4096
    [ 0.000000] pcpu-alloc: [0] 0
    [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 253504
    [ 0.000000] Kernel command line: console=ttyO2,115200n8 root=PARTUUID=00000000-02 rw rootfstype=ext4 rootwait
    [ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
    [ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    [ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    [ 0.000000] Memory: 886604K/1020928K available (6035K kernel code, 316K rwdata, 2204K rodata, 320K init, 293K bss, 19636K reserved, 114688K cma-reserved, 235520K highmem)
    [ 0.000000] Virtual kernel memory layout:
    vector : 0xffff0000 - 0xffff1000 ( 4 kB)
    fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
    vmalloc : 0xf0800000 - 0xff800000 ( 240 MB)
    lowmem : 0xc0000000 - 0xf0000000 ( 768 MB)
    pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
    modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
    .text : 0xc0008000 - 0xc0813fa4 (8240 kB)
    .init : 0xc0814000 - 0xc0864000 ( 320 kB)
    .data : 0xc0864000 - 0xc08b3190 ( 317 kB)
    .bss : 0xc08b5000 - 0xc08fe604 ( 294 kB)
    [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    [ 0.000000] Preemptible hierarchical RCU implementation.
    [ 0.000000] Build-time adjustment of leaf fanout to 32.
    [ 0.000000] RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
    [ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1
    [ 0.000000] NR_IRQS:16 nr_irqs:16 16
    [ 0.000000] ti_dt_clocks_register: failed to lookup clock node gmac_gmii_ref_clk_div
    [ 0.000000] OMAP clockevent source: timer1 at 32786 Hz
    [ 0.000000] Architected cp15 timer(s) running at 6.14MHz (phys).
    [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x16af5adb9, max_idle_ns: 440795202250 ns
    [ 0.000004] sched_clock: 56 bits at 6MHz, resolution 162ns, wraps every 4398046511023ns
    [ 0.000016] Switching to timer-based delay loop, resolution 162ns
    [ 0.000325] clocksource: 32k_counter: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 58327039986419 ns
    [ 0.000332] OMAP clocksource: 32k_counter at 32768 Hz
    [ 0.000702] Console: colour dummy device 80x30
    [ 0.000718] WARNING: Your 'console=ttyO2' has been replaced by 'ttyS2'
    [ 0.000725] This ensures that you still see kernel messages. Please
    [ 0.000730] update your kernel commandline.
    [ 0.000742] Calibrating delay loop (skipped), value calculated using timer frequency.. 12.29 BogoMIPS (lpj=61475)
    [ 0.000754] pid_max: default: 32768 minimum: 301
    [ 0.000848] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [ 0.000858] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [ 0.001389] Initializing cgroup subsys io
    [ 0.001406] Initializing cgroup subsys memory
    [ 0.001430] Initializing cgroup subsys devices
    [ 0.001443] Initializing cgroup subsys freezer
    [ 0.001453] Initializing cgroup subsys perf_event
    [ 0.001463] Initializing cgroup subsys pids
    [ 0.001488] CPU: Testing write buffer coherency: ok
    [ 0.001686] /cpus/cpu@0 missing clock-frequency property
    [ 0.001698] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
    [ 0.001735] Setting up static identity map for 0x80008280 - 0x800082e0
    [ 0.050037] Brought up 1 CPUs
    [ 0.050048] SMP: Total of 1 processors activated (12.29 BogoMIPS).
    [ 0.050055] CPU: All CPU(s) started in HYP mode.
    [ 0.050061] CPU: Virtualization extensions available.
    [ 0.051028] devtmpfs: initialized
    [ 0.080045] VFP support v0.3: implementor 41 architecture 4 part 30 variant f rev 0
    [ 0.081007] omap_hwmod: l3_main_2 using broken dt data from ocp
    [ 0.182275] omap_hwmod: dcan1: _wait_target_disable failed
    [ 0.188693] omap_hwmod: dcan2: _wait_target_disable failed
    [ 0.294715] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [ 0.302425] pinctrl core: initialized pinctrl subsystem
    [ 0.303249] NET: Registered protocol family 16
    [ 0.304159] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [ 0.330219] cpuidle: using governor ladder
    [ 0.360244] cpuidle: using governor menu
    [ 0.368325] OMAP GPIO hardware version 0.1
    [ 0.374829] irq: no irq domain found for /ocp/l4@4a000000/scm@2000/pinmux@1400 !
    [ 0.375201] irq: no irq domain found for /ocp/l4@4a000000/scm@2000/pinmux@1400 !
    [ 0.395650] No ATAGs?
    [ 0.395675] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
    [ 0.395685] hw-breakpoint: maximum watchpoint size is 8 bytes.
    [ 0.396149] omap4_sram_init:Unable to allocate sram needed to handle errata I688
    [ 0.396158] omap4_sram_init:Unable to get sram pool needed to handle errata I688
    [ 0.396337] OMAP DMA hardware revision 0.0
    [ 0.480764] omap-dma-engine 4a056000.dma-controller: OMAP DMA engine driver (LinkedList1/2/3 supported)
    [ 0.481890] edma 43300000.edma: memcpy is disabled
    [ 0.486621] edma 43300000.edma: TI EDMA DMA engine driver
    [ 0.489423] omap-iommu 58882000.mmu: 58882000.mmu registered
    [ 0.489556] omap-iommu 55082000.mmu: 55082000.mmu registered
    [ 0.492412] palmas 0-0058: Irq flag is 0x00000000
    [ 0.512213] palmas 0-0058: Muxing GPIO 51, PWM 0, LED 2
    [ 0.551215] omap_i2c 48070000.i2c: bus 0 rev0.12 at 400 kHz
    [ 0.551763] omap_i2c 48060000.i2c: bus 2 rev0.12 at 100 kHz
    [ 0.552246] omap_i2c 4807a000.i2c: bus 3 rev0.12 at 400 kHz
    [ 0.552721] omap_i2c 4807c000.i2c: bus 4 rev0.12 at 400 kHz
    [ 0.552871] media: Linux media interface: v0.10
    [ 0.552922] Linux video capture interface: v2.00
    [ 0.552978] pps_core: LinuxPPS API ver. 1 registered
    [ 0.552985] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [ 0.553008] PTP clock support registered
    [ 0.553050] EDAC MC: Ver: 3.0.0
    [ 0.561115] omap-mailbox 48840000.mailbox: omap mailbox rev 0x400
    [ 0.561307] omap-mailbox 48842000.mailbox: omap mailbox rev 0x400
    [ 0.561666] Advanced Linux Sound Architecture Driver Initialized.
    [ 0.562329] clocksource: Switched to clocksource arch_sys_counter
    [ 0.572190] NET: Registered protocol family 2
    [ 0.572708] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
    [ 0.572772] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
    [ 0.572897] TCP: Hash tables configured (established 8192 bind 8192)
    [ 0.572953] UDP hash table entries: 512 (order: 2, 16384 bytes)
    [ 0.572984] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
    [ 0.573193] NET: Registered protocol family 1
    [ 0.583488] RPC: Registered named UNIX socket transport module.
    [ 0.583498] RPC: Registered udp transport module.
    [ 0.583505] RPC: Registered tcp transport module.
    [ 0.583511] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [ 0.584478] hw perfevents: enabled with armv7_cortex_a15 PMU driver, 7 counters available
    [ 0.586757] futex hash table entries: 256 (order: 2, 16384 bytes)
    [ 0.603232] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [ 0.613886] NFS: Registering the id_resolver key type
    [ 0.613913] Key type id_resolver registered
    [ 0.613921] Key type id_legacy registered
    [ 0.613994] ntfs: driver 2.1.32 [Flags: R/O].
    [ 0.616188] bounce: pool size: 64 pages
    [ 0.616338] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
    [ 0.616353] io scheduler noop registered
    [ 0.616364] io scheduler deadline registered
    [ 0.616397] io scheduler cfq registered (default)
    [ 1.905983] clock: dpll_pcie_ref_ck failed transition to 'locked'
    [ 1.907306] pinctrl-single 4a003400.pinmux: 282 pins at pa fc003400 size 1128
    [ 1.907388] pinctrl-single 4a002e8c.pinmux: 1 pins at pa fc002e8c size 4
    [ 1.910648] backlight supply power not found, using dummy regulator
    [ 1.964793] Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled
    [ 1.967978] 4806a000.serial: ttyS0 at MMIO 0x4806a000 (irq = 299, base_baud = 3000000) is a 8250
    [ 1.968886] 4806c000.serial: ttyS1 at MMIO 0x4806c000 (irq = 300, base_baud = 3000000) is a 8250
    [ 1.969737] console [ttyS2] disabled
    [ 1.969784] 48020000.serial: ttyS2 at MMIO 0x48020000 (irq = 301, base_baud = 3000000) is a 8250
    [ 2.824476] console [ttyS2] enabled
    [ 2.828829] 48066000.serial: ttyS4 at MMIO 0x48066000 (irq = 302, base_baud = 3000000) is a 8250
    [ 2.838466] 48424000.serial: ttyS8 at MMIO 0x48424000 (irq = 303, base_baud = 3000000) is a 8250
    [ 2.848396] [drm] Initialized drm 1.1.0 20060810
    [ 2.854334] OMAP DSS rev 6.1
    [ 2.858083] omapdss_dss 58000000.dss: bound 58001000.dispc (ops dispc_component_ops)
    [ 2.953548] loop: module loaded
    [ 2.958154] libphy: Fixed MDIO Bus: probed
    [ 3.012348] davinci_mdio 48485000.mdio: davinci mdio revision 1.6
    [ 3.018472] libphy: 48485000.mdio: probed
    [ 3.034801] davinci_mdio 48485000.mdio: phy[0]: device 48485000.mdio:00, driver TI DP83867
    [ 3.043627] cpsw 48484000.ethernet: Detected MACID = fc:0f:4b:5c:92:34
    [ 3.050285] cpsw 48484000.ethernet: cpts: overflow check period 800
    [ 3.058351] mousedev: PS/2 mouse device common for all mice
    [ 3.074472] i2c /dev entries driver
    [ 3.173219] ledtrig-cpu: registered to indicate activity on CPUs
    [ 3.180755] omap-rproc 58820000.ipu: assigned reserved memory node ipu1_cma@9d000000
    [ 3.202368] remoteproc0: 58820000.ipu is available
    [ 3.207267] remoteproc0: Note: remoteproc is still under development and considered experimental.
    [ 3.232323] remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
    [ 3.252398] remoteproc0: Direct firmware load for dra7-ipu1-fw.xem4 failed with error -2
    [ 3.260609] remoteproc0: Falling back to user helper
    [ 3.265841] omap-rproc 55020000.ipu: assigned reserved memory node ipu2_cma@95800000
    [ 3.282386] remoteproc1: 55020000.ipu is available
    [ 3.287284] remoteproc1: Note: remoteproc is still under development and considered experimental.
    [ 3.312331] remoteproc1: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
    [ 3.332394] remoteproc1: Direct firmware load for dra7-ipu2-fw.xem4 failed with error -2
    [ 3.340605] remoteproc1: Falling back to user helper
    [ 3.353669] NET: Registered protocol family 10
    [ 3.372738] sit: IPv6 over IPv4 tunneling driver
    [ 3.377910] NET: Registered protocol family 17
    [ 3.392405] Key type dns_resolver registered
    [ 3.396700] NET: Registered protocol family 41
    [ 3.401258] omap_voltage_late_init: Voltage driver support not added
    [ 3.422827] Adding alias for supply vdd,cpu0 -> vdd,4a003b20.oppdm
    [ 3.429039] Adding alias for supply vbb,cpu0 -> vbb,4a003b20.oppdm
    [ 3.452655] Adding alias for supply vdd,cpu0 -> vdd,4a003b20.oppdm
    [ 3.458862] Adding alias for supply vbb,cpu0 -> vbb,4a003b20.oppdm
    [ 3.484005] Power Management for TI OMAP4+ devices.
    [ 3.489072] Registering SWP/SWPB emulation handler
    [ 3.512746] dmm 4e000000.dmm: initialized all PAT entries
    [ 3.533724] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
    [ 3.540365] [drm] No driver support for vblank timestamp query.
    [ 3.565862] [drm] Enabling DMM ywrap scrolling
    [ 3.599719] mmc0: host does not support reading read-only switch, assuming write-enable
    [ 3.601630] mmc0: new high speed SDHC card at address 59b4
    [ 3.611950] mmcblk0: mmc0:59b4 EB2MW 29.8 GiB
    [ 3.620126] Console: switching to colour frame buffer device 240x45
    [ 3.620185] mmcblk0: p1 p2
    [ 3.658039] omapdrm omapdrm.0: fb0: omapdrm frame buffer device
    [ 3.693144] [drm] Initialized omapdrm 1.0.0 20110917 on minor 0
    [ 3.699129] mmc1: MAN_BKOPS_EN bit is not set
    [ 3.706799] mmc1: new high speed MMC card at address 0001
    [ 3.722549] mmcblk1: mmc1:0001 Q2J54A 3.59 GiB
    [ 3.727347] hctosys: unable to open rtc device (rtc0)
    [ 3.732976] ALSA device list:
    [ 3.735953] No soundcards found.
    [ 3.749817] mmcblk1boot0: mmc1:0001 Q2J54A partition 1 16.0 MiB
    [ 3.765969] mmcblk1boot1: mmc1:0001 Q2J54A partition 2 16.0 MiB
    [ 3.772873] mmcblk1: p1 p2
    [ 3.803363] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    [ 3.811506] VFS: Mounted root (ext4 filesystem) on device 179:2.
    [ 3.828734] devtmpfs: mounted
    [ 3.831849] Freeing unused kernel memory: 320K (c0814000 - c0864000)
    [ 3.838238] This architecture does not have kernel memory protection.
    [ 4.141469] systemd[1]: System time before build time, advancing clock.
    [ 4.194690] random: systemd: uninitialized urandom read (16 bytes read, 11 bits of entropy available)
    [ 4.210374] random: systemd: uninitialized urandom read (16 bytes read, 12 bits of entropy available)
    [ 4.228106] systemd[1]: systemd 229 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN)
    [ 4.246730] systemd[1]: Detected architecture arm.
    [ 4.276039] systemd[1]: Set hostname to <actia-global-display>.
    [ 4.321445] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read, 12 bits of entropy available)
    [ 4.345282] random: systemd-gpt-aut: uninitialized urandom read (16 bytes read, 13 bits of entropy available)
    [ 4.356823] random: systemd-gpt-aut: uninitialized urandom read (16 bytes read, 13 bits of entropy available)
    [ 4.411879] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read, 14 bits of entropy available)
    [ 4.457554] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read, 14 bits of entropy available)
    [ 4.654405] random: systemd: uninitialized urandom read (16 bytes read, 17 bits of entropy available)
    [ 4.664057] random: systemd: uninitialized urandom read (16 bytes read, 17 bits of entropy available)
    [ 4.674233] random: systemd: uninitialized urandom read (16 bytes read, 17 bits of entropy available)
    [ 5.214831] systemd[1]: dbus.socket: Found ordering cycle on dbus.socket/start
    [ 5.222097] systemd[1]: dbus.socket: Found dependency on sysinit.target/start
    [ 5.229357] systemd[1]: dbus.socket: Found dependency on alignment.service/start
    [ 5.236836] systemd[1]: dbus.socket: Found dependency on basic.target/start
    [ 5.243846] systemd[1]: dbus.socket: Found dependency on sockets.target/start
    [ 5.251016] systemd[1]: dbus.socket: Found dependency on dbus.socket/start
    [ 5.257937] systemd[1]: dbus.socket: Breaking ordering cycle by deleting job alignment.service/start
    [ 5.267126] systemd[1]: alignment.service: Job alignment.service/start deleted to break ordering cycle starting with dbus.socket/start
    [ 5.304947] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
    [ 5.332689] systemd[1]: Listening on Syslog Socket.
    [ 5.352745] systemd[1]: Listening on Network Service Netlink Socket.
    [ 5.383925] systemd[1]: Created slice User and Session Slice.
    [ 5.412674] systemd[1]: Listening on udev Control Socket.
    [ 5.442619] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
    [ 5.483889] systemd[1]: Reached target Swap.
    [ 5.513238] systemd[1]: Created slice System Slice.
    [ 5.542570] systemd[1]: Reached target Slices.
    [ 5.562617] systemd[1]: Listening on udev Kernel Socket.
    [ 5.592611] systemd[1]: Listening on Journal Socket (/dev/log).
    [ 5.622644] systemd[1]: Listening on Journal Socket.
    [ 5.654619] systemd[1]: Starting Setup Virtual Console...
    [ 5.696247] systemd[1]: Mounting Temporary Directory...
    [ 5.724950] systemd[1]: Mounting POSIX Message Queue File System...
    [ 5.765162] systemd[1]: Starting Create list of required static device nodes for the current kernel...
    [ 5.812750] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
    [ 5.842544] systemd[1]: Reached target Paths.
    [ 5.863248] systemd[1]: Created slice system-getty.slice.
    [ 5.894647] systemd[1]: Starting Remount Root and Kernel File Systems...
    [ 5.926157] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
    [ 5.932683] systemd[1]: Reached target Remote File Systems.
    [ 5.970972] systemd[1]: Starting Load Kernel Modules...
    [ 5.995964] CMEMK module: reference Linux version 4.4.45
    [ 6.001854] no physical memory specified
    [ 6.006956] systemd[1]: Created slice system-serial\x2dgetty.slice.
    [ 6.013326] cmemk initialized
    [ 6.025753] systemd[1]: Starting Journal Service...
    [ 6.041284] cryptodev: driver 1.8 loaded.
    [ 6.171819] systemd[1]: Mounted POSIX Message Queue File System.
    [ 6.202631] systemd[1]: Mounted Temporary Directory.
    [ 6.232805] systemd[1]: Started Journal Service.
    [ 7.030697] systemd-journald[134]: Received request to flush runtime journal from PID 1
    [ 11.626704] omap-des 480a5000.des: OMAP DES hw accel rev: 2.2
    [ 11.639156] 2-0018 supply IOVDD not found, using dummy regulator
    [ 11.678900] 2-0018 supply DVDD not found, using dummy regulator
    [ 11.685221] alg: skcipher: setkey failed on test 5 for ecb-des-omap: flags=100
    [ 11.701970] [egalax_i2c]: Driver init done!
    [ 11.702110] [egalax_i2c]: Start probe
    [ 11.702131] [egalax_i2c]: IRQ = 139
    [ 11.702301] input: eGalax_Touch_Screen as /devices/virtual/input/input0
    [ 11.741261] 2-0018 supply AVDD not found, using dummy regulator
    [ 11.747878] [egalax_i2c]: Register input device done
    [ 11.748198] alg: skcipher-ddst: setkey failed on test 5 for ecb-des-omap: flags=100
    [ 11.769659] [egalax_i2c]: Request irq(139) gpio(113) with result:0
    [ 11.769669] [egalax_i2c]: I2C probe done
    [ 11.811352] 2-0018 supply DRVDD not found, using dummy regulator
    [ 11.862260] alg: skcipher-ddst: setkey failed on test 5 for ecb-des-omap: flags=100
    [ 11.882696] CAN device driver interface
    [ 12.008291] random: nonblocking pool is initialized
    [ 12.037612] omap_rng 48090000.rng: OMAP Random Number Generator ver. 20
    [ 12.069298] c_can_platform 4ae3c000.can: c_can_platform device registered (regs=fce3c000, irq=348)
    [ 12.160089] omap_hwmod: dcan2: _wait_target_disable failed
    [ 12.288438] c_can_platform 48480000.can: c_can_platform device registered (regs=fa480000, irq=349)
    [ 12.420168] vpe 489d0000.vpe: loading firmware vpdma-1b8.bin
    [ 12.442546] vpe 489d0000.vpe: Device registered as /dev/video0
    [ 12.955459] omap_hwmod: dcan2: _wait_target_disable failed
    [ 12.984635] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
    [ 12.993663] FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
    [ 13.134208] net eth0: initializing cpsw version 1.15 (0)
    [ 13.194446] net eth0: initialized cpsw ale version 1.4
    [ 13.272519] omap-sham 4b101000.sham: hw accel on OMAP rev 4.3
    [ 13.281441] net eth0: ALE Table size 1024
    [ 13.300819] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
    [ 13.500724] remoteproc0: failed to load dra7-ipu1-fw.xem4
    [ 13.641181] net eth0: phy found : id is : 0x2000a231
    [ 13.726241] remoteproc1: powering up 55020000.ipu
    [ 13.731059] remoteproc1: Booting fw image dra7-ipu2-fw.xem4, size 3738972
    [ 13.792371] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    [ 13.804982] omap_hwmod: dcan2: _wait_target_disable failed
    [ 13.825685] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    [ 14.121400] remoteproc1: remote processor 55020000.ipu is now up
    [ 14.177145] virtio_rpmsg_bus virtio0: rpmsg host is online
    [ 14.212124] remoteproc1: registered virtio0 (type 7)
    [ 14.270159] virtio_rpmsg_bus virtio0: creating channel rpmsg-rpc addr 0x65
    [ 14.345185] rpmsg_rpc rpmsg0: probing service dce-callback with src 1024 dst 101
    [ 14.403893] omap_hwmod: dcan2: _wait_target_disable failed
    [ 14.442668] virtio_rpmsg_bus virtio0: creating channel rpmsg-rpc addr 0x66
    [ 14.514769] rpmsg_rpc rpmsg1: probing service rpmsg-dce with src 1025 dst 102
    [ 14.533968] omap_hwmod: dcan2: _wait_target_disable failed
    [ 14.593026] rpmsg_rpc rpmsg0: published functions = 4
    [ 14.598122] rpmsg_rpc rpmsg1: published functions = 9
    [ 14.662134] omap_hwmod: dcan2: _wait_target_disable failed
    [ 14.707837] asoc-simple-card sound@0: tlv320aic3x-hifi <-> 48464000.mcasp mapping ok
    [ 14.769378] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [ 14.835149] omap-aes 4b500000.aes: OMAP AES hw accel rev: 3.3
    [ 14.850343] omap_hwmod: dcan2: _wait_target_disable failed
    [ 14.988013] omap_hwmod: dcan2: _wait_target_disable failed
    [ 15.048946] omap-aes 4b700000.aes: OMAP AES hw accel rev: 3.3
    [ 15.094962] [drm] Initialized pvr 1.14.3699939 20110701 on minor 1
    [ 16.368179] omap_hwmod: dcan2: _wait_target_disable failed
    [ 18.072166] usbcore: registered new interface driver usbfs
    [ 18.089636] usbcore: registered new interface driver hub
    [ 18.110192] usbcore: registered new device driver usb
    [ 18.199458] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
    [ 18.214961] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
    [ 18.245954] xhci-hcd xhci-hcd.0.auto: hcc params 0x0220f04c hci version 0x100 quirks 0x00210010
    [ 18.281235] xhci-hcd xhci-hcd.0.auto: irq 425, io mem 0x48890000
    [ 18.308567] hub 1-0:1.0: USB hub found
    [ 18.328676] hub 1-0:1.0: 1 port detected
    [ 18.332843] PVR_K: UM DDK-(3699939) and KM DDK-(3699939) match. [ OK ]
    [ 18.356215] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
    [ 18.361734] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
    [ 18.427150] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
    [ 18.469325] hub 2-0:1.0: USB hub found
    [ 18.491473] hub 2-0:1.0: 1 port detected
    [ 18.506421] dwc3 488d0000.usb: otg: primary host xhci-hcd.1.auto registered
    [ 18.531904] dwc3 488d0000.usb: otg: shared host xhci-hcd.1.auto registered
    [ 18.558179] dwc3 488d0000.usb: otg: can't start till gadget registers
    [ 19.110940] omap_hwmod: dcan2: _wait_target_disable failed

    Michel

  • Michel,

    From your logs it looks to me that the mcspi driver isn't being registered, mostly because its being disabled in the device-tree. You need to explicitly enable it in your device-tree. Please include the below entry in the device-tree you're using.

    &mcspi1 {
    status = "okay";
    };

    Regards

    Shravan

  • Shravan,

    This statement is in the device tree

    Michel
  • Shravan,

    I decompiled the device tree and I get this for mcspi1

    spi@48098000 {
    compatible = "ti,omap4-mcspi";
    reg = <0x48098000 0x00000200>;
    interrupts = <0x00000000 0x0000003c 0x00000004>;
    #address-cells = <0x00000001>;
    #size-cells = <0x00000000>;
    ti,hwmods = "mcspi1";
    ti,spi-num-cs = <0x00000004>;
    dmas = <0x000000c5 0x00000023 0x000000c5 0x00000024 0x000000c5 0x00000025 0x000000c5 0x00000026
    dma-names = "tx0", "rx0", "tx1", "rx1", "tx2", "rx2", "tx3", "rx3";
    status = "disabled";
    };

    and this for mcspi2

    spi@4809a000 {
    compatible = "ti,omap4-mcspi";
    reg = <0x4809a000 0x00000200>;
    interrupts = <0x00000000 0x0000003d 0x00000004>;
    #address-cells = <0x00000001>;
    #size-cells = <0x00000000>;
    ti,hwmods = "mcspi2";
    ti,spi-num-cs = <0x00000002>;
    dmas = <0x000000c5 0x0000002b 0x000000c5 0x0000002c 0x000000c5 0x0000002d 0x000000c5 0x0000002e>
    dma-names = "tx0", "rx0", "tx1", "rx1";
    status = "disabled";
    };


    I will have to double check my patch as the part for the spi don't seem to be compiled in.
    I have a hotter project right now, I have been working on that part on my spare time.
    I want to compare our RTOS approach with using the Linux side. Right now the RTOS with IPU1 comm takes around 70-80% of the CPU time, I will work on that tomorrow, I do not have the correct yocto entries on my office computer. At home I have been using an older board where the red and green colors were swapped and the qspi not functional (rx and tx swapped), beside that the boards are much the same.

    Michel
  • Shravan,

    I fixed the issue with the device tree. There was a strange error.

    /*  SPI devices

    SPI code here

    /*  UART */

    Basically all the SPI code was commented

    I have some functionality but somehow I can only see one of the CAN ports and it is not always in the same order.

    I would want to have the internal CAN to be always can0 and can1

    dir /sys/class/net/
    drwxr-xr-x 2 root root 0 Feb 25 08:03 .
    drwxr-xr-x 47 root root 0 Feb 25 08:03 ..
    lrwxrwxrwx 1 root root 0 Mar 23 02:19 can0 -> ../../devices/platform/44000000.ocp/4ae3c000.can/net/can0
    lrwxrwxrwx 1 root root 0 Mar 23 02:19 can1 -> ../../devices/platform/44000000.ocp/48098000.spi/spi_master/spi1/spi1.0/net/can1
    lrwxrwxrwx 1 root root 0 Mar 23 02:19 can2 -> ../../devices/platform/44000000.ocp/48480000.can/net/can2
    lrwxrwxrwx 1 root root 0 Feb 25 08:03 eth0 -> ../../devices/platform/44000000.ocp/48484000.ethernet/net/eth0
    lrwxrwxrwx 1 root root 0 Feb 25 08:03 lo -> ../../devices/virtual/net/lo
    lrwxrwxrwx 1 root root 0 Feb 25 08:03 sit0 -> ../../devices/virtual/net/sit0
    root@actia-global-display:~#


    root@actia-global-display:~# dir /sys/class/net/
    drwxr-xr-x 2 root root 0 Feb 25 08:03 .
    drwxr-xr-x 47 root root 0 Feb 25 08:03 ..
    lrwxrwxrwx 1 root root 0 Mar 23 02:19 can0 -> ../../devices/platform/44000000.ocp/48098000.spi/spi_master/spi1/spi1.0/net/can0
    lrwxrwxrwx 1 root root 0 Mar 23 02:19 can1 -> ../../devices/platform/44000000.ocp/4ae3c000.can/net/can1
    lrwxrwxrwx 1 root root 0 Mar 23 02:19 can2 -> ../../devices/platform/44000000.ocp/48480000.can/net/can2
    lrwxrwxrwx 1 root root 0 Feb 25 08:03 eth0 -> ../../devices/platform/44000000.ocp/48484000.ethernet/net/eth0
    lrwxrwxrwx 1 root root 0 Feb 25 08:03 lo -> ../../devices/virtual/net/lo
    lrwxrwxrwx 1 root root 0 Feb 25 08:03 sit0 -> ../../devices/virtual/net/sit0

    root@actia-global-display:~# dir /sys/class/spi_master/
    drwxr-xr-x 2 root root 0 Feb 25 08:03 .
    drwxr-xr-x 47 root root 0 Feb 25 08:03 ..
    lrwxrwxrwx 1 root root 0 Feb 25 08:03 spi1 -> ../../devices/platform/44000000.ocp/48098000.spi/spi_master/spi1
    lrwxrwxrwx 1 root root 0 Feb 25 08:03 spi2 -> ../../devices/platform/44000000.ocp/4809a000.spi/spi_master/spi2
    lrwxrwxrwx 1 root root 0 Feb 25 08:03 spi3 -> ../../devices/platform/44000000.ocp/480ba000.spi/spi_master/spi3
    root@actia-global-display:~# dir /sys/class/spi_master/spi1/
    drwxr-xr-x 7 root root 0 Feb 25 08:03 .
    drwxr-xr-x 3 root root 0 Feb 25 08:03 ..
    lrwxrwxrwx 1 root root 0 Mar 23 02:19 device -> ../../../48098000.spi
    lrwxrwxrwx 1 root root 0 Mar 23 02:19 of_node -> ../../../../../../firmware/devicetree/base/ocp/spi@48098000
    drwxr-xr-x 2 root root 0 Mar 23 02:19 power
    drwxr-xr-x 5 root root 0 Feb 25 08:03 spi1.0
    drwxr-xr-x 4 root root 0 Feb 25 08:03 spi1.1
    drwxr-xr-x 4 root root 0 Feb 25 08:03 spi1.2
    drwxr-xr-x 2 root root 0 Mar 23 02:19 statistics
    lrwxrwxrwx 1 root root 0 Feb 25 08:03 subsystem -> ../../../../../../class/spi_master
    -rw-r--r-- 1 root root 4096 Feb 25 08:03 uevent
    root@actia-global-display:~# dir /sys/class/spi_master/spi1/spi1.
    spi1.0/ spi1.1/ spi1.2/
    root@actia-global-display:~# dir /sys/class/spi_master/spi1/spi1.0/
    drwxr-xr-x 5 root root 0 Feb 25 08:03 .
    drwxr-xr-x 7 root root 0 Feb 25 08:03 ..
    lrwxrwxrwx 1 root root 0 Mar 23 02:19 driver -> ../../../../../../../bus/spi/drivers/mcp251x
    -r--r--r-- 1 root root 4096 Mar 23 02:19 modalias
    drwxr-xr-x 3 root root 0 Mar 23 02:19 net
    lrwxrwxrwx 1 root root 0 Mar 23 02:19 of_node -> ../../../../../../../firmware/devicetree/base/ocp/spi@48098000/dcan3@0
    drwxr-xr-x 2 root root 0 Mar 23 02:19 power
    drwxr-xr-x 2 root root 0 Mar 23 02:19 statistics
    lrwxrwxrwx 1 root root 0 Feb 25 08:03 subsystem -> ../../../../../../../bus/spi
    -rw-r--r-- 1 root root 4096 Feb 25 08:03 uevent
    root@actia-global-display:~# dir /sys/class/spi_master/spi1/spi1.1/
    drwxr-xr-x 4 root root 0 Feb 25 08:03 .
    drwxr-xr-x 7 root root 0 Feb 25 08:03 ..
    -r--r--r-- 1 root root 4096 Mar 23 02:19 modalias
    lrwxrwxrwx 1 root root 0 Mar 23 02:19 of_node -> ../../../../../../../firmware/devicetree/base/ocp/spi@48098000/dcan4@1
    drwxr-xr-x 2 root root 0 Mar 23 02:19 power
    drwxr-xr-x 2 root root 0 Mar 23 02:19 statistics
    lrwxrwxrwx 1 root root 0 Feb 25 08:03 subsystem -> ../../../../../../../bus/spi
    -rw-r--r-- 1 root root 4096 Feb 25 08:03 uevent
    root@actia-global-display:~# dir /sys/class/spi_master/spi1/spi1.2/
    drwxr-xr-x 4 root root 0 Feb 25 08:03 .
    drwxr-xr-x 7 root root 0 Feb 25 08:03 ..
    -r--r--r-- 1 root root 4096 Mar 23 02:19 modalias
    lrwxrwxrwx 1 root root 0 Mar 23 02:19 of_node -> ../../../../../../../firmware/devicetree/base/ocp/spi@48098000/dcan5@2
    drwxr-xr-x 2 root root 0 Mar 23 02:19 power
    drwxr-xr-x 2 root root 0 Mar 23 02:19 statistics
    lrwxrwxrwx 1 root root 0 Feb 25 08:03 subsystem -> ../../../../../../../bus/spi
    -rw-r--r-- 1 root root 4096 Feb 25 08:03 uevent

    root@actia-global-display:~# dmesg | grep spi
    [    2.957802] omap2_mcspi 48098000.spi: registered master spi1
    [    2.958039] spi spi1.0: setup: speed 500000, sample leading edge, clk normal
    [    2.958056] spi spi1.0: setup mode 0, 8 bits/w, 500000 Hz max --> 0
    [    2.958246] omap2_mcspi 48098000.spi: registered child spi1.0
    [    2.958368] spi spi1.1: setup: speed 500000, sample leading edge, clk normal
    [    2.958382] spi spi1.1: setup mode 0, 8 bits/w, 500000 Hz max --> 0
    [    2.958569] omap2_mcspi 48098000.spi: registered child spi1.1
    [    2.958695] spi spi1.2: setup: speed 500000, sample leading edge, clk normal
    [    2.958708] spi spi1.2: setup mode 0, 8 bits/w, 500000 Hz max --> 0
    [    2.958895] omap2_mcspi 48098000.spi: registered child spi1.2
    [    2.959199] omap2_mcspi 4809a000.spi: registered master spi2
    [    2.959377] spi spi2.0: setup: speed 2000000, sample leading edge, clk normal
    [    2.959392] spi spi2.0: setup mode 0, 8 bits/w, 2000000 Hz max --> 0
    [    2.959650] at25 spi2.0: 2 KByte at25 eeprom, pagesize 16
    [    2.965122] omap2_mcspi 4809a000.spi: registered child spi2.0
    [    2.965403] omap2_mcspi 480ba000.spi: registered master spi3
    [    7.821677] mcp251x spi1.0: setup: speed 500000, sample leading edge, clk normal
    [    7.821695] mcp251x spi1.0: setup mode 0, 8 bits/w, 500000 Hz max --> 0
    [    7.897717] mcp251x spi1.0: CANCTRL 0x87
    [    7.925834] mcp251x spi1.1: setup: speed 500000, sample leading edge, clk normal
    [    7.925851] mcp251x spi1.1: setup mode 0, 8 bits/w, 500000 Hz max --> 0
    [    8.077128] mcp251x spi1.2: setup: speed 500000, sample leading edge, clk normal
    [    8.077144] mcp251x spi1.2: setup mode 0, 8 bits/w, 500000 Hz max --> 0

    Michel

  • Hi Michel,

    There is no support in the CAN driver to fix the name of the can device (the alias node in the device-tree isn't used by the driver).

    However you can set up a rule in systemd to assign a specific name based on the MACAddress, details of which can be found in this link.

    https://www.freedesktop.org/software/systemd/man/systemd.link.html

    Regards

    Shravan

  • Shravan,

    That part is not my biggest concern, I can find ways to identify which is which. What I am concerned about is why only one of the CAN is recognized as CAN port. The way the hardware is set is that the first device has a xtal of 16Mhz but not the other two who are connected to the freq output of the first device.

    In RTOS the first channel works fine but not the other one. One thing I noticed as I read the specs of the microchip device is that the external clock is set to 1/8 of the input clock on power up. Could that be the reason why those are not recognized as CAN port during modprobe? If so how do I tell the first device to set the speed to 16Mhz?

    I was told that it was not possible to get those two devices to work properly with TI-RTOS. Perhaps the programmer assigned to that project didn't change the speed, I will have to look into that. It could be a hardware issue but before we change the hardware we have to make sure that it is a hardware problem.
    Do you see any issue for not using a xtal for all 3 devices?

    Michel
  • Michel,

    You would have to check the microchip datasheet to check what clock frequency is supported, however while going through the driver, I see that frequencies within the range 1Mhz to 25Mhz are supported, thus 16Mhz/8=2Mhz should work fine.

    In the device tree however, I notice that clk attribute for can4, can5 is set to the 16Mhz xtal. If the input clk to the other two CAN devices is the output of the first can device, then you will have to create an instance of the output clock from the first CAN device, and set this as the clk attribute for can4, can5. 

    Regards

    Shravan

  • Michel,

    Can you add a few debug prints in the function 'mcp251x_hw_reset' in the file 'drivers/net/can/spi/mcp251x.c' in the kernel.
    It could be that the driver isn't able to communicate with the other two CAN devices.
    Regarding TI-RTOS, I'm not sure. The owner on RTOS is OOO and back next week. I will get in touch with him and revert.

    Regards
    Shravan
  • Shravan,

    What would be the way to create that instance?

    As for the 2Mhz, it would be hard to get 500khz broadcasting which we need for some customers. For the current customer 250khz is what is needed, as I was told the two last devices (using TI-RTOS) do not work right. We haven't had time to check the output freq and the programmer is on the road.

    Michel
  • Shravan,

    I will try that out tonight and let you know what I see.

    Michel
  • Michel,

    I noticed that the driver doesn't have support for for the device-tree entry enable-clkout. I did see a patch available online (pasted link below), do you have this patch?

    github.com/.../0006-mcp251x-add-device-tree-support.patch

    This patch parses the 'enable-clkout' property in the device-tree as part of the 'mcp251x_set_normal_mode' method, but this method is called only when there is an event and isn't as part of the driver probe. You may want to add this as part of the driver probe.

    Regards
    Shravan
  • Shravan,

    I will look this up

    That patch is for kernel 3.8, I use kernel 4.4

    Michel
  • Michel,

    I don't see this patch available on K4.4, and will have to be ported.

    Regards

    Shravan

  • I haven't had time to do the porting to make the 2nd and 3rd microchip devices to work. I will get back to this when I have other parts done. This is not hot since we only use one of those CAN port at this time but it may become a big issue later on.

    Michel
  • Hi Michel,

    I understand. However, the issue seems to be with the mcp25x driver recognizing more than 1 CAN device. Can you start a new thread once you have the other parts done?

    Regards

    Shravan