boen@boen-12:~$ sudo minicom
[sudo] password for boen:
Welcome to minicom 2.5
OPTIONS: I18n
Compiled on May 2 2011, 10:05:24.
Port /dev/ttyS0
Press CTRL-A Z for help on special keys
��
U-Boot 2009.08 (Jun 25 2014 - 17:53:27)
CPU: Freescale i.MX35 at 532 MHz
Board: MX35 3STACK 2.0 [POR]
I2C: ready
DRAM: 256 MB
## Unknown FLASH on Bank 1 - Size = 0x00000000 = 0 MB
Flash: 0 kB
_bss_end:0x8786174c addr:0x87862000
NAND: Manufacturer : mira (0xc8)
Device Code : 0xd5
Cell Technology : MLC
Chip Size : 2 GiB
Pages per Block : 128
Page Geometry : 4096+128
ECC Strength : 4 bits
ECC Size : 512 B
Data Setup Time : 35 ns
Data Hold Time : 15 ns
Address Setup Time: 15 ns
GPMI Sample Delay : 6 ns
tREA : Unknown
tRLOH : Unknown
tRHOH : Unknown
Description : lanrry 3201 nand
Bad block table found at page 524160, version 0x01
Bad block table found at page 524032, version 0x01
2048 MiB
*** Warning - bad CRC or NAND, using default environment
lcd_init
In: serial
Out: serial
Err: serial
vga_init,initializing CH7026
i2c_addr:chip address cycle fail(a1)
i2c_addr failed
board_late_init: read PMIC@0x08:0x7 fail
i.MX35 CPU board version 1.0
i2c_addr:chip address cycle fail(a1)
i2c_addr failed
board_late_init: read PMIC@0x69:0x20 fail
Net: smc911x: Invalid chip endian 0x90ff90ff
FEC0 [PRIME]
Hit any key to stop autoboot: 0
NAND read: device 0 offset 0xa00000, size 0x300000
3145728 bytes read: OK
## Booting kernel from Legacy Image at 80800000 ...
Image Name: Linux-2.6.28-271-gec75a15
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2463596 Bytes = 2.3 MB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
lcd_disable
Uncompressing Linux................................................................................................
Linux version 2.6.28-271-gec75a15 (xw@xiaowei) (gcc version 4.1.2) #231 PREEMPT Thu Jun 26 17:09:21 CST 2014
CPU: ARMv6-compatible processor [4117b363] revision 3 (ARMv6TEJ), cr=00c5387f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: Freescale MX35 3-Stack Board
Ignoring unrecognised tag 0x54410008
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 64768
Kernel command line: console=ttymxc0,115200 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs
MXC IRQ initialized
PID hash table entries: 1024 (order: 10, 4096 bytes)
Clock input source is 24000000
Console: colour dummy device 80x30
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 128MB 128MB = 256MB total
Memory: 254520KB available (4608K code, 355K data, 240K init)
SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 530.84 BogoMIPS (lpj=2654208)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 288 bytes
NET: Registered protocol family 16
L2X0 cache controller enabled
CPU is i.MX35 Revision 2.1
MXC GPIO hardware
mxc_init_mmc, sd0 cd irq is: 121
mxc_cpld_init,remap ok,maped at:0xd8810000
read add:0xd8810050, value:0xd843
read add:0xd8810054, value:0x22252521
read add:0xd8810058, value:0x22220a00
read add:0xd8810060, value:0x0
read add:0xd8810050, value:0xd000
read write bak add:0xd8810054, value:0x22252321
read add:0xd8810058, value:0x22220a00
read write bak add:0xd8810058, value:0x22220a00
Using SDMA I.API
MXC DMA API initialized
SCSI subsystem initialized
CSPI: mxc_spi-0 probed
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
MXC I2C driver
clk: Unable to get requested clock: dfm_clk
Bluetooth: Core ver 2.13
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
NET: Registered protocol family 1
usb: Host 2 host (serial) registered
usb: DR host (utmi) registered
usb: DR gadget (utmi) registered
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) (SUMMARY) �© 2001-2006 Red Hat, Inc.
msgmni has been set to 497
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
mxcfb,mxcfb_probe
mxc_ipu mxc_ipu: Channel already uninitialized 14
Console: switching to colour frame buffer device 30x20
mxc_ipu mxc_ipu: Channel already uninitialized 15
mxcfb: fb registered, using mode <NULL>
claa_lcd_init
ch7026_init
ch7026_probe
lcd_probe
lcd_init,initializing CH7026
lcd_init, read id = 0x54
Serial: 8250/16550 driver6 ports, IRQ sharing disabled
serial8250_probe,irq:102
serial8250.0: ttyS0 at MMIO 0xb6000000 (irq = 0) is a 16550A
serial8250_probe,irq:103
serial8250.0: ttyS1 at MMIO 0xb6000008 (irq = 0) is a 16550A
serial8250_probe,irq:105
serial8250.0: ttyS2 at MMIO 0xb6000010 (irq = 0) is a 16550A
serial8250_probe,irq:104
serial8250.0: ttyS3 at MMIO 0xb6000018 (irq = 0) is a 16550A
serial8250_probe,irq:106
serial8250.0: ttyS4 at MMIO 0xb6000020 (irq = 0) is a 16550A
serial8250_probe,irq:107
serial8250.0: ttyS5 at MMIO 0xb6000028 (irq = 0) is a 16550A
Serial: MXC Internal UART driver
mxcintuart.0: ttymxc0 at MMIO 0x43f90000 (irq = 45) is a Freescale MXC
console [ttymxc0] enabled
mxcintuart.1: ttymxc1 at MMIO 0x43f94000 (irq = 32) is a Freescale MXC
mxcintuart.2: ttymxc2 at MMIO 0x5000c000 (irq = 18) is a Freescale MXC
loop: module loaded
vcan: Virtual CAN interface driver
FEC ENET Version 0.2
read id value:0x15
read MAC:0x15
read id value:0x1d
read MAC:0x1d
read id value:0x61
read MAC:0x61
read id value:0xaa
read MAC:0xaa
read id value:0xc9
read MAC:0xc9
read id value:0x72
read MAC:0x72
fec: PHY @ 0x19, ID 0x82018201 -- LAN8700
eth0: ethernet 00:1d:61:aa:c9:72
Linux video capture interface: v2.00
MXC Video Output MXC Video Output.0: Registered device video1
Driver 'sd' needs updating - please use bus_type methods
Driver 'sr' needs updating - please use bus_type methods
MXC MTD nor Driver 2.0
mxc_nor_flash: probe of mxc_nor_flash.0 failed with error -5
MXC MTD nand Driver 2.5
mxc_nd2.c
mxcnd_probe
before nand_scan
chip->cellinfo:0x14
extid:0x29
NAND device: Manufacturer ID: 0xc8, Chip ID: 0xd5 (MIRA NAND 2GiB 3,3V 8-bit)
nand_scan_tail before
chip->ecc.layout:0xc04e4ec8,mtd->oobsize:128
chip->ecc.mode:2
nand_scan_tail after
before add_mtd_device
enter CONFIG_MTD_PARTITIONS
RedBoot partition parsing not available
Creating 4 MTD partitions on "NAND 2GiB 3,3V 8-bit":
0x00000000-0x00a00000 : "nand.bootloader"
0x00a00000-0x01400000 : "nand.kernel"
0x01400000-0x03200000 : "nand.rootfs1"
0x03200000-0x80000000 : "nand.rootfs2"
add_mtd_device done
UBI: attaching mtd3 to ubi0
UBI: physical eraseblock size: 524288 bytes (512 KiB)
UBI: logical eraseblock size: 516096 bytes
UBI: smallest flash I/O unit: 4096
UBI: VID header offset: 4096 (aligned 4096)
UBI: data offset: 8192
UBI: attached mtd3 to ubi0
UBI: MTD device name: "nand.rootfs2"
UBI: MTD device size: 1998 MiB
UBI: number of good PEBs: 3992
UBI: number of bad PEBs: 4
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 1
UBI: available PEBs: 0
UBI: total number of reserved PEBs: 3992
UBI: number of PEBs reserved for bad PEB handling: 39
UBI: max/mean erase counter: 183/1
usbmon: debugfs is not available
Initializing USB Mass Storage driver...
UBI: background thread "ubi_bgt0d" started, PID 958
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
MXC keypad loaded
tsc2007_driver_register: Registering Touchscreen device
input: tsc2007 as /class/input/input0
rtc-isl1208 0-006f: chip found, driver version 0.3
rtc-isl1208 0-006f: rtc core: registered rtc-isl1208 as rtc0
i2c /dev entries driver
MXC WatchDog Driver 2.0
MXC Watchdog # 0 Timer: initial timeout 60 sec
Bluetooth: HCI UART driver ver 2.2
Bluetooth: HCI H4 protocol initialized
Bluetooth: HCI BCSP protocol initialized
Bluetooth: HCILL protocol initialized
IPU Post-filter loading
ioctl pointer: c02be734. mmap pointer: c02be174
RNG Driver: Loading
mxc_asrc registered
Freescale: Register to MMC/SDIO driver
mxsdhci: MXC Secure Digital Host Controller Interface driver
mxsdhci: MXC SDHCI Controller Driver.
mmc0: SDHCI detect irq 121 irq 7 INTERNAL DMA
mxsdhci: MXC SDHCI Controller Driver.
mmc1: SDHCI detect irq 0 irq 8 INTERNAL DMA
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
Advanced Linux Sound Architecture Driver Version 1.0.18rc3.
ASoC version 0.13.2
sgtl5000-i2c 0-000a: SGTL5000 revision 17
DMA Sound Buffers Allocated:UseIram=1 buf->addr=10000000 buf->area=d8aa0000 size=65536
DMA Sound Buffers Allocated:UseIram=1 buf->addr=97dc0000 buf->area=fde01000 size=65536
asoc: SGTL5000 <-> imx-ssi-1 mapping ok
WM8580 Audio Codec 0.1
wm8580device rev:0
DMA Sound Buffers Allocated:UseIram=1 buf->addr=10000000 buf->area=d8ac0000 size=65536
asoc: WM8580 PAIFRX <-> imx-esai-tx mapping ok
DMA Sound Buffers Allocated:UseIram=1 buf->addr=97de0000 buf->area=fde11000 size=65536
DMA Sound Buffers Allocated:UseIram=1 buf->addr=97df0000 buf->area=fde21000 size=65536
asoc: bluetooth <-> imx-ssi-3 mapping ok
ALSA device list:
#0: imx-3stack (SGTL5000)
#1: imx-3stack (WM8580)
#2: imx-3stack (bluetooth)
oprofile: using arm/armv6
TCP cubic registered
NET: Registered protocol family 17
can: controller area network core (rev 20081130 abi 8)
NET: Registered protocol family 29
can: raw protocol (rev 20081130)
can: broadcast manager protocol (rev 20081130)
Bluetooth: L2CAP ver 2.11
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO (Voice Link) ver 0.6
Bluetooth: SCO socket layer initialized
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
ieee80211: 802.11 data/management/control stack, git-1.1.13
ieee80211: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>
Static Power Management for Freescale i.MX35
VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 3
MXC Backlight Device mxc_ipu_bl.0 Initialized.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
fsl-ehci fsl-ehci.0: irq 35, io mem 0x53ff4400
fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
fsl-ehci fsl-ehci.1: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.1: new USB bus registered, assigned bus number 2
fsl-ehci fsl-ehci.1: irq 37, io mem 0x53ff4000
fsl-ehci fsl-ehci.1: USB 2.0 started, EHCI 1.00
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
rtc-isl1208 0-006f: setting system clock to 2014-10-22 07:48:47 UTC (1413964127)
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size: 1956003840 bytes (1910160 KiB, 1865 MiB, 3790 LEBs)
UBIFS: journal size: 10452992 bytes (10208 KiB, 9 MiB, 21 LEBs)
UBIFS: media format: 4 (latest is 4)
UBIFS: default compressor: LZO
UBIFS: reserved for root: 0 bytes (0 KiB)
VFS: Mounted root (ubifs filesystem).
Freeing init memory: 240K
usb 1-1: new full speed USB device using fsl-ehci and address 2
init started: BusyBox v1.11.2 ()
starting pid 1049, tty '': '/etc/rc.d/rcS'
Mounting /proc and /sys
usb 1-1: not running at top speed; connect to a high speed hub
usb 1-1: configuration #1 chosen from 1 choice
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
Starting the hotplug events dispatcher udevd
Synthesizing initial hotplug events
Setting the hostname to freescale
Mounting filesystems
Running sysctl
Setting up networking on loopback device:
Setting up networking on eth0:
udhcpc (v1.11.2) started
eth0: config: auto-negotiation on, 100FDX, 100HDX, 10FDX, 10HDX.
Sending discover...
Sending discover...
Sending discover...
No lease, forking to background
Starting inetd:
Starting the dropbear ssh server:
mkdir: cannot create directory '/mnt/udisk': File exists
Start Qt-4.7.0
Do not need start ts_calibrate!
starting pid 1950, tty '': '/sbin/getty -L ttymxc0 115200 vt100'
arm-none-linux-gnueabi-gcc (GCC) 4.1.2
root filesystem built on Sat, 20 Jun 2009 16:18:46 +0800
Freescale Semiconductor, Inc.
freescale login: Error opening mouse device '/dev/input/mouse0': No such file or directory
Cannot open keyboard input device '/dev/input/keyboard1': No such file or directory
arm-none-linux-gnueabi-gcc (GCC) 4.1.2
root filesystem built on Sat, 20 Jun 2009 16:18:46 +0800
Freescale Semiconductor, Inc.
freescale login: root
login[1950]: root login on 'ttymxc0'
BusyBox v1.11.2 () built-in shell (ash)
Enter 'help' for a list of built-in commands.
~ # cat /proc/net/can/
/proc/net/can/rcvlist_all /proc/net/can/rcvlist_sff
/proc/net/can/rcvlist_eff /proc/net/can/reset_stats
/proc/net/can/rcvlist_err /proc/net/can/stats
/proc/net/can/rcvlist_fil /proc/net/can/version
/proc/net/can/rcvlist_inv
~ # cat /proc/net/can/rcvlist_all
receive list 'rx_all':
(any: no entry)
~ # ls /sys/devices/
/sys/devices/platform/ /sys/devices/system/
~ # ls /sys/devices/platform/
/sys/devices/platform/FlexCAN.0/
/sys/devices/platform/FlexCAN.1/
/sys/devices/platform/MXC Video Output.0/
/sys/devices/platform/fsl-ehci.0/
/sys/devices/platform/fsl-ehci.1/
/sys/devices/platform/fsl-usb2-udc/
/sys/devices/platform/gps_ioctrl.0/
/sys/devices/platform/i2c-adapter:i2c-0/
/sys/devices/platform/imx-3stack-bt.0/
/sys/devices/platform/imx-3stack-sgtl5000/
/sys/devices/platform/imx-3stack-wm8580.0/
~ # ls /sys/devices/platform/FlexCAN.0/
/sys/devices/platform/FlexCAN.0/bus/
/sys/devices/platform/FlexCAN.0/modalias
/sys/devices/platform/FlexCAN.0/power/
/sys/devices/platform/FlexCAN.0/subsystem/
/sys/devices/platform/FlexCAN.0/uevent
~ # ls /sys/devices/platform/FlexCAN.0/
i.MX6UL has similar issue when accessing to CAN bus. `ifconfig -a` can get CAN0 interface info, and `dmesg | grep can` also shows that the driver is loaded successfully. However, executing `canfdtest can0` or `candump can0` will get the message of "Network is down".
Attempt to activate the CAN0 interface with `ifconfig can0 up`, the following message obtained:
ifconfig: SIOCSIFFLAGS: Invalid argument
Hi 昌清
first one needs to set the proper baud rate configuration, you need to set different time
parameters, for example you can type the following commands:
modprobe flexcan
echo "19" > br_presdiv
echo "5" > br_propseg
echo "5" > br_pseg1
echo "3" > br_pseg2
ifconfig can0 up
These commands assign values of 19 for the prescaler divider, 5 for the
propagation segment and so forth.
Install and use cantest (note one needs to connect can device to
i.MX35, can tests requires two devices to be used), run LTIB as follows:
./ltib -m prep -p cantest.spec
./ltib -m scbuild -p cantest.spec
./ltib -m scdeploy -p cantest.spec
One can use CAN protocol analyzer such as KVASER CAN.
Also refer to attached files.
Best regards
igor
install ltib, please read AN3984
i.MX35 Board Initialization and Memory Mapping Using the Linux Target Image Builder (LTIB)
i.MX35 Product Development Kit (PDK)|Freescale
L2.6.31_09.12.01_SDK_SOURCE : Linux 2.6.31 Source Code Files 2009.12 Release support i.MX23, i.MX25, i.MX35
hi igropadykov
kernel .config file
CONFIG_CAN=y
CONFIG_CAN_RAW=y
CONFIG_CAN_BCM=y
#
# CAN Device Drivers
#
CONFIG_CAN_VCAN=y
CONFIG_CAN_DEBUG_DEVICES=y
CONFIG_CAN_FLEXCAN=y
# CONFIG_IRDA is not set
CONFIG_BT=y
CONFIG_BT_L2CAP=y
CONFIG_BT_SCO=y
why boot kernel, but CAN_FLEXCAN don't run?
code
static __init int flexcan_init(void)
{
pr_info("Freescale FlexCAN Driver \n");
printk("%s: Freescale FlexCAN Driver \n", __func__);
return platform_driver_register(&flexcan_driver);
}
static __exit void flexcan_exit(void)
{
return platform_driver_unregister(&flexcan_driver);
}
module_init(flexcan_init);
module_exit(flexcan_exit);
boot log:
~ # dmesg | grep Driver
Driver 'sd' needs updating - please use bus_type methods
Driver 'sr' needs updating - please use bus_type methods
MXC MTD nor Driver 2.0
MXC MTD nand Driver 2.5
MXC WatchDog Driver 2.0
RNG Driver: Loading
mxsdhci: MXC SDHCI Controller Driver.
mxsdhci: MXC SDHCI Controller Driver.
Advanced Linux Sound Architecture Driver Version 1.0.18rc3.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
~ # mod
modeline2fb modprobe
~ # modprobe flexcan
flexcan: Unknown symbol regulator_enable
flexcan: Unknown symbol regulator_get
flexcan: Unknown symbol regulator_put
flexcan: Unknown symbol regulator_disable
insmod: cannot insert '/lib/modules/2.6.28-271-gec75a15/kernel/drivers/net/can/flexcan/flexcan.ko': unknown symboe
modprobe: failed to load module flexcan
~ #
flexcan module don't work
you can try Demo image
L2.6.31_MX35_SDK_0912_IMAGE : Linux 2.6.31 Binary Demo Files 2009.12 Release.
hi igropadykov;
I'm very sorry so long didn't reply to you。
I compared the differences between 2.6.28 and 2.6.31(can bus module code) ,their modification is not much。
Now our customers eager to use the product,I can't to modify all of the code。
I can only be modified in the current version。
So I can only modify the CAN bus related parts。
Please provide some guidance related professionals
thanks
Hi 昌清
I am afraid 2.6.28 can not be supported since this is preliminary
BSP, not fully tested. Please migrate to official release
L2.6.31_09.12.01_SDK_SOURCE : Linux 2.6.31 Source Code Files 2009.12
Release support i.MX23, i.MX25, i.MX35, i.MX51..
Size (K): 604060 Format: gz Rev #: 2009.12 Modified: 2/17/2010
~igor
Hi igorpadykov :
Now the driver has a normal load, i can see the flexcan sys information, I have test tool when sending data of two target board, will be in error,
display interrupt a problem, the other can not receive data
i I refer to Socket-CAN Users - Re: How to test flexcan driver
BOARD A:
~ # ifconfig -a
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
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:64
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
can1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
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:64
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth0 Link encap:Ethernet HWaddr 00:2B:41:AA:C9:72
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1038 (1.0 KiB) TX bytes:2360 (2.3 KiB)
Base address:0x8000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 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:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
~ # ifconfig can0 up
changqing: func:flexcan_open start!
gpio_can_active, id:0
file:arch/arm/mach-mx35/mx35_3stack.c,func:flexcan_xcvr_enable,line:1243
file:arch/arm/mach-mx35/mx35_3stack.c,func:flexcan_xcvr_enable,line:1250
file:arch/arm/mach-mx35/mx35_3stack.c,func:flexcan_xcvr_enable,line:1256
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_open,line:308 start!
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_reset,line:107
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_open,line:316
file:drivers/net/can/flexcan/drv.c,func:flexcan_mcr_setup,line:118 start
file:drivers/net/can/flexcan/drv.c,func:flexcan_mcr_setup,line:170 OK!
file:drivers/net/can/flexcan/drv.c,func:flexcan_ctrl_setup,line:176 start
file:drivers/net/can/flexcan/drv.c,func:flexcan_ctrl_setup,line:219 OK!
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_open,line:331 ok!
file:drivers/net/can/flexcan/drv.c,func:flexcan_open,line:541
changqing: flexcan_mbm_init start!
changqing: flexcan_mbm_init ok!
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_start,line:46
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_start,line:65 ,CAN_HW_REG_MCR:0x4dc3023f
file:drivers/net/can/flexcan/drv.c,func:flexcan_open,line:549 ok
~ # cd /sys/devices/
/sys/devices/platform/ /sys/devices/system/
~ # cd /sys/devices/platform/FlexCAN.0/
/sys/devices/platform/FlexCAN.0 # ls
abort br_rjw local_priority subsystem
bcc bus loopback tsyn
bitrate driver maxmb uevent
boff_rec dump_reg modalias wak_src
br_clksrc dump_rx_mb power wakeup
br_presdiv dump_xmit_mb smp xmit_maxmb
br_propseg ext_msg srx_dis
br_pseg1 fifo state
br_pseg2 listen std_msg
/sys/devices/platform/FlexCAN.0 # cat bitrate
changqing: flexcan_show_attr start! the line: 248
500000
/sys/devices/platform/FlexCAN.0 # cat state
changqing: flexcan_show_attr start! the line: 248
Start::normal
/sys/devices/platform/FlexCAN.0 # candump can0
interface = can0, family = 29, type = 3, proto = 1
BOARD B:
~ # ifconfig can0 up
changqing: func:flexcan_open start!
gpio_can_active, id:0
file:arch/arm/mach-mx35/mx35_3stack.c,func:flexcan_xcvr_enable,line:1243
file:arch/arm/mach-mx35/mx35_3stack.c,func:flexcan_xcvr_enable,line:1250
file:arch/arm/mach-mx35/mx35_3stack.c,func:flexcan_xcvr_enable,line:1256
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_open,line:308 start!
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_reset,line:107
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_open,line:316
file:drivers/net/can/flexcan/drv.c,func:flexcan_mcr_setup,line:118 start
file:drivers/net/can/flexcan/drv.c,func:flexcan_mcr_setup,line:170 OK!
file:drivers/net/can/flexcan/drv.c,func:flexcan_ctrl_setup,line:176 start
file:drivers/net/can/flexcan/drv.c,func:flexcan_ctrl_setup,line:219 OK!
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_open,line:331 ok!
file:drivers/net/can/flexcan/drv.c,func:flexcan_open,line:541
changqing: flexcan_mbm_init start!
changqing: flexcan_mbm_init ok!
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_start,line:46
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_start,line:65 ,CAN_HW_REG_MCR:0x4dc3023f
file:drivers/net/can/flexcan/drv.c,func:flexcan_open,line:549 ok
~ # cansend can0 46846946+3
interface = can0, family = 29, tfile:drivers/net/can/flexcan/drv.c,func:flexcan_start_xmit,line:470
ype = 3, proto = 1
file:drivers/net/can/flexcan/drv.c,func:flexcan_start_xmit,line:477
file:drivers/net/can/flexcan/drv.c,func:flexcan_start_xmit,line:482
file:drivers/net/can/flexcan/drv.c,func:flexcan_irq_handler,line:438
file:drivers/net/can/flexcan/drv.c,func:flexcan_irq_handler,line:444
file:drivers/net/can/flexcan/drv.c,func:flexcan_irq_handler,CAN_HW_REG_ESR:16438
file:drivers/net/can/flexcan/drv.c,func:flexcan_err_handler,line:345
file:drivers/net/can/flexcan/drv.c,func:flexcan_err_handler,line:361
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_busoff,line:287
file:drivers/net/can/flexcan/drv.c,func:flexcan_err_handler,line:423
NOHZ: local_softirq_pending 08
I have a question, how to configure arch/arm/mach-mx35/mx35_3stack.c (flexcan)
I find flexcan module requires a power supply, how to allocate the power?
#if defined(CONFIG_CAN_FLEXCAN) || defined(CONFIG_CAN_FLEXCAN_MODULE)
static void flexcan_xcvr_enable(int id, int en)
{
static int pwdn;
#ifdef DEBUG_DZY
printk(KERN_ERR "file:%s,func:%s,line:%d\n",__FILE__,__func__,__LINE__);
#endif
if (id < 0 || id > 1)
return;
#ifdef DEBUG_DZY
printk(KERN_ERR "file:%s,func:%s,line:%d\n",__FILE__,__func__,__LINE__);
#endif
#ifdef CONFIG_MACH_MX35_MDK
#ifdef DEBUG_DZY
printk(KERN_ERR "file:%s,func:%s,line:%d\n",__FILE__,__func__,__LINE__);
#endif
#else
if (en) {
#ifdef DEBUG_DZY
printk(KERN_ERR "file:%s,func:%s,line:%d\n",__FILE__,__func__,__LINE__);
#endif
if (!(pwdn++))
pmic_gpio_set_bit_val(MCU_GPIO_REG_GPIO_CONTROL_2,
1, 0);
} else {
if (!(--pwdn))
pmic_gpio_set_bit_val(MCU_GPIO_REG_GPIO_CONTROL_2,
1, 1);
}
#endif
}
#if 0 //by dengzy
struct flexcan_platform_data flexcan_data[] = {
{
.core_reg = "GPO2",
.io_reg = NULL,
.xcvr_enable = flexcan_xcvr_enable,
.active = gpio_can_active,
.inactive = gpio_can_inactive,},
{
.core_reg = "GPO2",
.io_reg = NULL,
.xcvr_enable = flexcan_xcvr_enable,
.active = gpio_can_active,
.inactive = gpio_can_inactive,},
};
#else
struct flexcan_platform_data flexcan_data[] = {
{
.core_reg =NULL,
.io_reg = NULL,
.xcvr_enable = flexcan_xcvr_enable,
.active = gpio_can_active,
.inactive = gpio_can_inactive,},
{
.core_reg = NULL,
.io_reg = NULL,
.xcvr_enable = flexcan_xcvr_enable,
.active = gpio_can_active,
.inactive = gpio_can_inactive,},
};
#endif // by dengzy
#endif
2.6.28 kernel is very old and not supported.Please migrate to official release
L2.6.31_09.12.01_SDK_SOURCE : Linux 2.6.31 Source Code Files 2009.12
Hi igorpad:
i porting to linux 2.6.31
board A:
~ # ifconfig -a
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
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:64
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
can1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
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:64
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 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:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
~ # ifconfig can0 up
changqing: func:flexcan_open start!
i2c-adapter i2c-0: ACK not received
i2c-adapter i2c-0: ACK not received
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_open,line:301 start!
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_reset,line:107
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_open,line:309
file:drivers/net/can/flexcan/drv.c,func:flexcan_mcr_setup,line:118 start
file:drivers/net/can/flexcan/drv.c,func:flexcan_mcr_setup,line:163 OK!
file:drivers/net/can/flexcan/drv.c,func:flexcan_ctrl_setup,line:169 start
file:drivers/net/can/flexcan/drv.c,func:flexcan_ctrl_setup,line:212 OK!
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_open,line:324 ok!
file:drivers/net/can/flexcan/drv.c,func:flexcan_open,line:527
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_start,line:46
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_start,line:65 ,CAN_HW_REG_MCR:0x4987023f
file:drivers/net/can/flexcan/drv.c,func:flexcan_open,line:535 ok
~ # uname -a
Linux freescale 2.6.31-207-g7286c01 #9 PREEMPT Mon Nov 24 09:27:19 CST 2014 armv6l unknown
~ # cd /sys/devices/platform/FlexCAN.0
/sys/devices/platform/FlexCAN.0 # ls
abort br_rjw local_priority subsystem
bcc bus loopback tsyn
bitrate driver maxmb uevent
boff_rec dump_reg modalias wak_src
br_clksrc dump_rx_mb power wakeup
br_presdiv dump_xmit_mb smp xmit_maxmb
br_propseg ext_msg srx_dis
br_pseg1 fifo state
br_pseg2 listen std_msg
/sys/devices/platform/FlexCAN.0 # cat state
Start::normal
/sys/devices/platform/FlexCAN.0 # candump can0
interface = can0, family = 29, type = 3, proto = 1
board B
MXC Backlight Device mxc_ipu_bl.0 Initialized.
mxc_rtc mxc_rtc.0: setting system clock to 1970-01-01 00:05:02 UTC (302)
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size: 2032902144 bytes (1985256 KiB, 1938 MiB, 3939 LEBs)
UBIFS: journal size: 10452992 bytes (10208 KiB, 9 MiB, 21 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root: 0 bytes (0 KiB)
VFS: Mounted root (ubifs filesystem) on device 0:11.
Freeing init memory: 128K
init started: BusyBox v1.11.2 ()
starting pid 970, tty '': '/etc/rc.d/rcS'
Mounting /proc and /sys
Starting the hotplug events dispatcher udevd
Synthesizing initial hotplug events
Setting the hostname to freescale
Mounting filesystems
Running sysctl
Setting up networking on loopback device:
Setting up networking on eth0:
udhcpc: SIOCGIFINDEX: No such device
Starting inetd:
Starting the dropbear ssh server:
mkdir: cannot create directory '/mnt/udisk': File exists
starting pid 1887, tty '': '/sbin/getty -L ttymxc0 115200 vt100'
Start Qt-4.6
Do not need start ts_calibrate!
arm-none-linux-gnueabi-gcc (GCC) 4.1.2
root filesystem built on Sat, 20 Jun 2009 16:18:46 +0800
Freescale Semiconductor, Inc.
freescale login: Error opening mouse device '/dev/input/mouse0': No such file or directory
QWSTslibMouseHandlerPrivate: ts_open() failed with error: 'No such file or directory'
Please check your tslib installation!
arm-none-linux-gnueabi-gcc (GCC) 4.1.2
root filesystem built on Sat, 20 Jun 2009 16:18:46 +0800
Freescale Semiconductor, Inc.
freescale login: root
login[1887]: root login on 'ttymxc0'
BusyBox v1.11.2 () built-in shell (ash)
Enter 'help' for a list of built-in commands.
~ # ifconfig -a
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
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:64
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
can1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
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:64
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 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:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
~ # ifconfig can0 up
changqing: func:flexcan_open start!
i2c-adapter i2c-0: ACK not received
i2c-adapter i2c-0: ACK not received
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_open,line:301 start!
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_reset,line:107
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_open,line:309
file:drivers/net/can/flexcan/drv.c,func:flexcan_mcr_setup,line:118 start
file:drivers/net/can/flexcan/drv.c,func:flexcan_mcr_setup,line:163 OK!
file:drivers/net/can/flexcan/drv.c,func:flexcan_ctrl_setup,line:169 start
file:drivers/net/can/flexcan/drv.c,func:flexcan_ctrl_setup,line:212 OK!
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_open,line:324 ok!
file:drivers/net/can/flexcan/drv.c,func:flexcan_open,line:527
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_start,line:46
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_start,line:65 ,CAN_HW_REG_MCR:0x4987023f
file:drivers/net/can/flexcan/drv.c,func:flexcan_open,line:535 ok
~ # uname -a
Linux freescale 2.6.31-207-g7286c01 #9 PREEMPT Mon Nov 24 09:27:19 CST 2014 armv6l unknown
~ # cd /sys/devices/platform/FlexCAN.0
/sys/devices/platform/FlexCAN.0 # ls
abort br_rjw local_priority subsystem
bcc bus loopback tsyn
bitrate driver maxmb uevent
boff_rec dump_reg modalias wak_src
br_clksrc dump_rx_mb power wakeup
br_presdiv dump_xmit_mb smp xmit_maxmb
br_propseg ext_msg srx_dis
br_pseg1 fifo state
br_pseg2 listen std_msg
/sys/devices/platform/FlexCAN.0 # cat state
Start::normal
/sys/devices/platform/FlexCAN.0 # cansend can0 123456789
interface = can0, family = 29, tfile:drivers/net/can/flexcan/drv.c,func:flexcan_start_xmit,line:463
ype = 3, proto = 1
file:drivers/net/can/flexcan/drv.c,func:flexcan_start_xmit,line:470
file:drivers/net/can/flexcan/drv.c,func:flexcan_start_xmit,line:475
file:drivers/net/can/flexcan/drv.c,func:flexcan_irq_handler,line:431
file:drivers/net/can/flexcan/drv.c,func:flexcan_irq_handler,line:437
file:drivers/net/can/flexcan/drv.c,func:flexcan_irq_handler,CAN_HW_REG_ESR:16438
file:drivers/net/can/flexcan/drv.c,func:flexcan_err_handler,line:338
file:drivers/net/can/flexcan/drv.c,func:flexcan_err_handler,line:354
file:drivers/net/can/flexcan/drv.c,func:flexcan_hw_busoff,line:280
file:drivers/net/can/flexcan/drv.c,func:flexcan_err_handler,line:416
/sys/devices/platform/FlexCAN.0 #
But the workload will be very large, because the time is tight, I can only modify part of the code 发自网易邮箱 在2014年11月17日 21:05 ,igorpadykov写道: how to bring up imx35 flexCAN bus reply from igorpadykov in i.MX Community - View the full discussion Hi 昌清 I am afraid 2.6.28 can not be supported since this is preliminary BSP, not fully tested. Please migrate to official release L2.6.31_09.12.01_SDK_SOURCE http://www.freescale.com/files/graphic/SECURITYINFOIMAGE.gif : Linux 2.6.31 Source Code Files 2009.12 Release support i.MX23, i.MX25, i.MX35, i.MX51.. Size (K): 604060 Format: gz Rev #: 2009.12 Modified: 2/17/2010 ~igor Did your question get answered? If so, say thanks by clicking Correct Answer in the community thread! Reply to this message by replying to this email, or go to the message on Freescale Community Start a new discussion in i.MX Community by email or at Freescale Community Following how to bring up imx35 flexCAN bus in these streams: Inbox
Hi freescale:
but have this issue
~ # modprobe flexcan
flexcan: Unknown symbol regulator_enable
flexcan: Unknown symbol regulator_get
flexcan: Unknown symbol regulator_put
flexcan: Unknown symbol regulator_disable
insmod: cannot insert
'/lib/modules/2.6.28-271-gec75a15/kernel/drivers/net/can/flexcan/flexcan.ko':
unknown symbole
modprobe: failed to load module flexcan
~ #
Hi 昌清
2.6.28 kernel is outdated, please use latest:
L2.6.31_09.12.01_SDK_SOURCE : Linux 2.6.31 Source Code Files 2009.12 Release support i.MX23, i.MX25, i.MX35
~igor