$ export CROSS_COMPILE=ppc_6xx $ cd >>> Get the sources $ git clone git://git.denx.de/linux-2.6-denx.git $ export KDIR=$PWD/linux-2.6-denx $ svn co http://svn.gna.org/svn/xenomai/branches/v2.4.x xenomai-2.4.x $ export XDIR=$PWD/xenomai-2.4.x $ cd $KDIR $ git checkout origin/DENX-v2.6.24-stable >>> Prepare kernel to use Xenomai $ cd $XDIR $ scripts/prepare-kernel.sh --linux=$KDIR --verbose --arch=powerpc >>> Configure and make the Linux kernel with RT-Socket-CAN support $ cd $KDIR $ make ARCH=powerpc tqm5200_defconfig $ make ARCH=powerpc menuconfig ... enable RT-Socket-CAN and MSCAN driver ... <*> RT-Socket-CAN, CAN raw socket interface [*] Enable debug output (NEW) [ ] Enable TX loopback to local sockets (NEW) (1024) Size of receive ring buffers (must be 2^N) (NEW) (4) Maximum number of devices (NEW) (16) Maximum number of receive filters per device (NEW) < > Virtual CAN bus driver (NEW) <*> MSCAN driver for MPC52xx [*] Enable CAN 1 (NEW) [*] Enable CAN 2 (NEW) (66000000) Clock Frequency in Hz (NEW) Pin Configuration (CAN 1 on I2C1 pins, CAN 2 on TMR01 pin ... $ make ARCH=powerpc uImage $ cp -p arch/powerpc/boot/uImage /tftpboot/tqm5200/ >>> Configure, make and install the Xenomai user space utilities $ cd $XDIR $ ./configure --host=ppc-linux --prefix=/root/xeno-rsc $ make $ export DESTDIR=/opt/eldk/ppc_6xx $ make install >>> Boot the new kernel and mount the rootfs /opt/eldk/ppc_6xx ## Booting kernel from Legacy Image at 00600000 ... Image Name: Linux-2.6.24.7-dirty Created: 2008-05-23 13:01:44 UTC Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 1694392 Bytes = 1.6 MB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK ## Flattened Device Tree blob at 00000000 Booting using the fdt blob at 0x5f0000 Using tqm5200 machine description Linux version 2.6.24.7-dirty (wolf@domain.hid) (gcc version 4.0.0 (DENX ELDK 4.1 4.0.0)) #2 Fri May 23 15:01:42 CEST 2008 Zone PFN ranges: DMA 0 -> 32768 Normal 32768 -> 32768 Movable zone start PFN for each node early_node_map[1] active PFN ranges 0: 0 -> 32768 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512 Kernel command line: root=/dev/nfs rw nfsroot=10.0.30.2:/opt/eldk4/ppc_6xx ip=10.0.30.210:10.0.30.2:::tqm5200:eth0:off panic=1 console=ttyPSC0,115200 MPC52xx PIC is up and running! PID hash table entries: 512 (order: 9, 2048 bytes) clocksource: timebase mult[79364d9] shift[22] registered I-pipe 2.1-03: pipeline enabled. console [ttyPSC0] enabled Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) Memory: 125908k/131072k available (3364k kernel code, 5004k reserved, 152k data, 288k bss, 160k init) SLUB: Genslabs=11, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1 Mount-cache hash table entries: 512 net_namespace: 64 bytes NET: Registered protocol family 16 PCI: Probing PCI hardware DMA: MPC52xx BestComm driver DMA: MPC52xx BestComm engine @f0001200 ok ! SCSI subsystem initialized usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb Time: timebase clocksource has been installed. NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 4096 (order: 3, 32768 bytes) TCP bind hash table entries: 4096 (order: 2, 16384 bytes) TCP: Hash tables configured (established 4096 bind 4096) TCP reno registered I-pipe: Domain Xenomai registered. Xenomai: hal/powerpc started. Xenomai: real-time nucleus v2.5-devel (Flying In A Blue Dream) loaded. Xenomai: starting native API services. Xenomai: starting POSIX services. Xenomai: starting RTDM services. JFFS2 version 2.2. (NAND) ������ 2001-2006 Red Hat, Inc. io scheduler noop registered io scheduler anticipatory registered (default) io scheduler deadline registered io scheduler cfq registered Generic RTC Driver v1.07 Serial: MPC52xx PSC UART driver f0002000.serial: ttyPSC0 at MMIO 0xf0002000 (irq = 129) is a MPC52xx PSC f0002200.serial: ttyPSC1 at MMIO 0xf0002200 (irq = 130) is a MPC52xx PSC f0002400.serial: ttyPSC2 at MMIO 0xf0002400 (irq = 131) is a MPC52xx PSC RAMDISK driver initialized: 16 RAM disks of 32768K size 1024 blocksize loop: module loaded mpc52xx MII bus: probed Driver 'sd' needs updating - please use bus_type methods ata: MPC52xx IDE/ATA libata driver scsi0 : mpc52xx_ata ata1: PATA max PIO4 ata_regs 0xf0003a00 irq 135 usbmon: debugfs is not available ppc-of-ohci f0001000.usb: OF OHCI ppc-of-ohci f0001000.usb: new USB bus registered, assigned bus number 1 ppc-of-ohci f0001000.usb: irq 134, io mem 0xf0001000 usb usb1: configuration #1 chosen from 1 choice hub 1-0:1.0: USB hub found hub 1-0:1.0: 2 ports detected Initializing USB Mass Storage driver... usbcore: registered new interface driver usb-storage USB Mass Storage support registered. i2c /dev entries driver RT-Socket-CAN 0.90.2 - (C) 2006 RT-Socket-CAN Development Team MSCAN: CAN 1 routed to I2C1 pins and CAN2 to TMR01 pins rtcan: registered rtcan0 rtcan0: MSCAN driver loaded (port 1, base-addr 0xf0000900 irq 145) rtcan: registered rtcan1 rtcan1: MSCAN driver loaded (port 2, base-addr 0xf0000980 irq 146) RTCAN SJA1000 driver initialized PEAK-PCI-CAN: initializing device 001c:0001 PEAK-PCI-CAN: base_addr=c907c000 conf_addr=c907a000 irq=16 rtcan: registered rtcan2 PEAK-PCI-CAN: base_addr=c907e400 conf_addr=c907a000 irq=16 rtcan: registered rtcan3 TCP cubic registered Initializing XFRM netlink socket NET: Registered protocol family 1 NET: Registered protocol family 17 RPC: Registered udp transport module. RPC: Registered tcp transport module. drivers/rtc/hctosys.c: unable to open rtc device (rtc0) net eth0: attached phy 0 to driver LXT971 IP-Config: Guessing netmask 255.0.0.0 IP-Config: Complete: device=eth0, addr=10.0.30.210, mask=255.0.0.0, gw=255.255.255.255, host=tqm5200, domain=, nis-domain=(none), bootserver=10.0.30.2, rootserver=10.0.30.2, rootpath= Looking up port of RPC 100003/2 on 10.0.30.2 PHY: f0003000:00 - Link is Up - 100/Full Looking up port of RPC 100005/1 on 10.0.30.2 VFS: Mounted root (nfs filesystem). Freeing unused kernel memory: 160k init modprobe: FATAL: Could not load /lib/modules/2.6.24.7-dirty/modules.dep: No such file or directory modprobe: FATAL: Could not load /lib/modules/2.6.24.7-dirty/modules.dep: No such file or directory INIT: version 2.85 booting Welcome to DENX Embedded Linux Environment Press 'I' to enter interactive startup. Building the cache [ OK ] storage network audio done[ OK ] Timed out waiting for time change. Setting clock : Thu Oct 24 04:56:47 UTC 1963 [ OK ] Setting hostname tqm5200: [ OK ] Mounting local filesystems: [ OK ] Enabling swap space: [ OK ] INIT: Entering runlevel: 3 Entering non-interactive startup Bringing up loopback interface: [ OK ] Starting system logger: [ OK ] Starting kernel logger: [ OK ] Starting portmap: portmap: fork: No such device[ OK ] Mounting NFS filesystems: [ OK ] Mounting other filesystems: [ OK ] Starting xinetd: [ OK ] DENX ELDK version 4.1 build 2007-01-19 Linux 2.6.24.7-dirty on a ppc tqm5200 login: root Last login: Thu Oct 24 04:58:31 from 10.0.30.2 # export PATH=$PATH:/root/xeno-rsc/sbin:/root/xeno-rsc/bin # rtcanconfig rtcan0 -b 500000 up # rtcanconfig rtcan1 -b 500000 up # cat /proc/rtcan/devices Name___________ _Baudrate State___ TX_Counter RX_Counter ____Errors rtcan0 500000 active 0 0 0 rtcan1 500000 active 0 0 0 rtcan2 undefined stopped 0 0 0 rtcan3 undefined stopped 0 0 0 # cat /proc/rtcan/rtcan0/info Device rtcan0 Controller MSCAN-MPC5200 Board unkown Clock-Hz 33000000 Baudrate 500000 Bit-time brp=3 prop_seg=0 phase_seg1=16 phase_seg2=5 sjw=1 sam=0 Ctrl-Mode State active TX-Counter 0 RX-Counter 0 Errors 0 Refcount 0 # cat /proc/rtcan/rtcan2/info Device rtcan2 Controller SJA1000 Board PEAK-PCI Clock-Hz 8000000 Baudrate undefined Bit-time brp=0 prop_seg=0 phase_seg1=0 phase_seg2=0 sjw=0 sam=0 Ctrl-Mode State stopped TX-Counter 0 RX-Counter 0 Errors 0 Refcount 0 # rtcanrecv -v -e 0xffff & interface all Using err_mask=0xffff #0: (2) <0x001> [8] 01 02 03 04 05 06 07 08 #1: (2) <0x001> [8] 01 02 03 04 05 06 07 08 #2: (2) <0x001> [8] 01 02 03 04 05 06 07 08 #3: (2) <0x001> [8] 01 02 03 04 05 06 07 08 #4: (2) <0x001> [8] 01 02 03 04 05 06 07 08 #5: (2) <0x001> [8] 01 02 03 04 05 06 07 08 #6: (2) <0x001> [8] 01 02 03 04 05 06 07 08 #7: (2) <0x001> [8] 01 02 03 04 05 06 07 08 #8: (2) <0x001> [8] 01 02 03 04 05 06 07 08 #9: (2) <0x001> [8] 01 02 03 04 05 06 07 08 # rtcansend -d 500 -l 10 rtcan0 1 2 3 4 5 6 7 8 # cat /proc/rtcan/devices Name___________ _Baudrate State___ TX_Counter RX_Counter ____Errors rtcan0 500000 active 10 0 0 rtcan1 500000 active 0 10 0 rtcan2 undefined stopped 0 0 0 rtcan3 undefined stopped 0 0 0