Hi Pavel,
Thanks for the response, no problem !
Below are the CAN message dump logs for Internal & External Loopback.
Internal LoopBack test (SoC Level loopback): Working Fine
u-boot-log:
U-Boot 2016.01+ls1+ga9b437f (Jun 22 2016 - 17:43:10 +0530)
CPU: Freescale LayerScape LS1021E, Version: 2.0, (0x87081120)
Clock Configuration:
CPU0(ARMV7):1000 MHz,
Bus:300 MHz, DDR:800 MHz (1600 MT/s data rate),
Reset Configuration Word (RCW):
00000000: 0608000a 00000000 00000000 00000000
00000010: 70000000 00007900 e0025a00 21046000
00000020: 00000000 00000000 00000000 20000000
00000030: 00080000 881b7340 00000000 00000000
I2C: ready
Model: LS1021A TWR Board
Board: LS1021ATWR
CPLD: V2.0
PCBA: V1.0
VBank: 0
DRAM: 1 GiB
Using SERDES1 Protocol: 112 (0x70)
Firmware 'Microcode version 0.0.1 for LS1021a r1.0' for 1021 V1.0
QE: uploading microcode 'Microcode for LS1021a r1.0' version 0.0.1
Flash: 128 MiB
MMC: FSL_SDHC: 0
EEPROM: NXID v16777216
PCIe1: Root Complex no link, regs @ 0x3400000
PCIe2: Root Complex no link, regs @ 0x3500000
In: serial
Out: serial
Err: serial
SEC0: RNG instantiated
SATA link 0 timeout.
AHCI 0001.0300 1 slots 1 ports ? Gbps 0x1 impl SATA mode
flags: 64bit ncq pm clo only pmp fbss pio slum part ccc
Found 0 device(s).
SCSI: Net: eTSEC2 is in sgmii mode.
eTSEC1, eTSEC2 [PRIME], eTSEC3
Hit any key to stop autoboot: 0
root@ls1021atwr:~# uname -a
Linux ls1021atwr 4.1.8-rt8+ls1+gbd51baf #1 SMP Wed Jun 29 22:43:35 IST 2016 armv7l armv7l armv7l GNU/Linux
root@ls1021atwr:~# zcat /proc/config.gz | grep -i CAN
CONFIG_CAN=y
CONFIG_CAN_RAW=y
CONFIG_CAN_DEV=y
CONFIG_CAN_CALC_BITTIMING=y
CONFIG_CAN_FLEXCAN=y
CONFIG_CAN_DEBUG_DEVICES=y
root@ls1021atwr:~# ip link set can0 up type can bitrate 125000 loopback on
[ 347.820997] flexcan 2a70000.can can0: writing ctrl=0x4a313005
[ 347.826915] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
root@ls1021atwr:~# candump can0 &
[1] 834
interface = can0, family = 29, type = 3, proto = 1
root@ls1021atwr:~# cansend -e can0 01 02 03 04 05 06 07 08 --loop=2
interface = can0, family = 29, type = 3, proto = 1
<0x00000001> [8] 01 02 03 04 05 06 07 00
<0x00000001> [8] 01 02 03 04 05 06 07 00
root@ls1021atwr:~# dmesg | grep -i flexcan
[ 1.426634] flexcan 2a70000.can: Looking up xceiver-supply from device tree
[ 1.426646] flexcan 2a70000.can: Looking up xceiver-supply property in node /soc/can@2a70000 failed
[ 1.433908] flexcan 2a70000.can: device registered (reg_base=c089a000, irq=48)
[ 1.441160] flexcan 2a80000.can: Looking up xceiver-supply from device tree
[ 1.441171] flexcan 2a80000.can: Looking up xceiver-supply property in node /soc/can@2a80000 failed
[ 1.448301] flexcan 2a80000.can: device registered (reg_base=c089c000, irq=49)
[ 347.820997] flexcan 2a70000.can can0: writing ctrl=0x4a313005
[ 347.826756] flexcan 2a70000.can can0: flexcan_set_bittiming: mcr=0x5980000f ctrl=0x4a313005
[ 347.826767] flexcan 2a70000.can can0: flexcan_chip_start: writing mcr=0x79a20209
[ 347.826777] flexcan 2a70000.can can0: flexcan_chip_start: writing ctrl=0x4a31bc55
[ 347.826811] flexcan 2a70000.can can0: flexcan_chip_start: reading mcr=0x60a20209 ctrl=0x4a31bc55
root@ls1021atwr:~# cat /proc/interrupts | grep can
48: 2 0 GIC 158 Level can0
root@ls1021atwr:~# ifconfig
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOARP MTU:16 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 B) TX bytes:16 (16.0 B)
Interrupt:48
External LoopBack test (Single Board): Not Working
Current setup details & consolidate updates from previous comments:
Connected can0 & can1 with pre. req.: J13, J14, J15 all jumpers shot & CANH GND CANL of can0:can1 connected with straight cable, connectivity verified with multimeter.
1. using rcw_1000_misc.bin : D6 Blue LED glowing on TWR-IND-IO module
2. D1,D2,D6,D7: yellow LEDs glowing on TWR-ELEV module
3. using u-boot env: setenv hwconfig “can”
4. u-boot and kernel same from above internal loopback test logs
root@ls1021atwr:~# ip link set can0 up type can bitrate 125000
[ 30.641193] flexcan 2a70000.can can0: writing ctrl=0x4a312005
[ 30.647114] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
root@ls1021atwr:~# ip link set can1 up type can bitrate 125000
[ 35.123147] flexcan 2a80000.can can1: writing ctrl=0x4a312005
[ 35.129069] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
root@ls1021atwr:~# candump can1 &
[1] 856
interface = can1, family = 29, type = 3, proto = 1
root@ls1021atwr:~# cansend -e can0 01 02 03 04 05 06 07 08 --loop=2
interface = can0, family = 29, type = 3, proto = 1
root@ls1021atwr:~# cat /proc/interrupts | grep can
48: 0 0 GIC 158 Level can0
49: 0 0 GIC 159 Level can1
root@ls1021atwr:~# dmesg | grep -i flexcan
[ 1.425605] flexcan 2a70000.can: Looking up xceiver-supply from device tree
[ 1.425617] flexcan 2a70000.can: Looking up xceiver-supply property in node /soc/can@2a70000 failed
[ 1.432879] flexcan 2a70000.can: device registered (reg_base=c089a000, irq=48)
[ 1.440135] flexcan 2a80000.can: Looking up xceiver-supply from device tree
[ 1.440147] flexcan 2a80000.can: Looking up xceiver-supply property in node /soc/can@2a80000 failed
[ 1.447294] flexcan 2a80000.can: device registered (reg_base=c089c000, irq=49)
[ 30.641193] flexcan 2a70000.can can0: writing ctrl=0x4a312005
[ 30.646955] flexcan 2a70000.can can0: flexcan_set_bittiming: mcr=0x5980000f ctrl=0x4a312005
[ 30.646966] flexcan 2a70000.can can0: flexcan_chip_start: writing mcr=0x79a20209
[ 30.646976] flexcan 2a70000.can can0: flexcan_chip_start: writing ctrl=0x4a31ac55
[ 30.647011] flexcan 2a70000.can can0: flexcan_chip_start: reading mcr=0x60a20209 ctrl=0x4a31ac55
[ 35.123147] flexcan 2a80000.can can1: writing ctrl=0x4a312005
[ 35.128908] flexcan 2a80000.can can1: flexcan_set_bittiming: mcr=0x5980000f ctrl=0x4a312005
[ 35.128919] flexcan 2a80000.can can1: flexcan_chip_start: writing mcr=0x79a20209
[ 35.128928] flexcan 2a80000.can can1: flexcan_chip_start: writing ctrl=0x4a31ac55
[ 35.128963] flexcan 2a80000.can can1: flexcan_chip_start: reading mcr=0x60a20209 ctrl=0x4a31ac55
root@ls1021atwr:~# ifconfig
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOARP MTU:16 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:10
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:48
can1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOARP MTU:16 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:10
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:49
root@ls1021atwr:~# cat /proc/net/dev | grep can
can0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
can1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
I have gone through the shared document, I am not getting the J1 jumper from Section Board Connections: On the LS1021A board, mount Jumper 1 as shown in figure below to ensure that HI speed mode is working ..
1. on Main LS1021A(rev-2.0) board there is J1 jumper with tag: "Remote", when I shot it, my target is not booting up & not getting anything on serial console.
2. while observed on TWR-IND-IO module the jumper count starts from J2, (near & on back side of J10 I can see a label as J1, but not a jumper)
Can you please provide more details on the J1 jumper? Do I am missing anything ?
Also we have posted query SDK-v2.0: FlexCAN not working on LS1021A IND-IO module the meta-data is same. adding it here to provide more details.
Any further pointers to get "External CAN communication working" will be a great help !
Have a nice day!
Thanks
Shrikant