TS-CAN1 TS-7800-V2: Difference between revisions

From embeddedTS Manuals
(Created page with "===SocketCAN Driver for TS-7800-V2=== The Linux Kernel provides upstream compatibility for ISA-based SJA1000 CAN controllers. This driver can make up to three TS-CAN1 periph...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
===SocketCAN Driver for TS-7800-V2===
==SocketCAN Driver for TS-7800-V2==


The Linux Kernel provides upstream compatibility for ISA-based SJA1000 CAN controllers.  This driver can make up to three TS-CAN1 peripherals show up as network devices in Linux thus:
The Linux Kernel provides upstream compatibility for ISA-based SJA1000 CAN controllers.  This driver can make up to three TS-CAN1 peripherals show up as network devices in Linux thus:
Line 16: Line 16:
</pre>
</pre>


The driver module is provided already installed in all embeddedTS hardware that supports SocketCAN with the TS-CAN1.  To load the driver, configure the PLD configuration registers, and load the driver with the appropriate comma-separated IO and IRQ configurations (commas only necessary for multiple TS-CAN1), for example, on the TS-7800-V2:
The driver module is provided already installed in all embeddedTS software packages that supports SocketCAN with the TS-CAN1.  Set the [[#PLD_Register_Map|PLD registers for operation]] and load the driver with the appropriate comma-separated IO and IRQ configurations (commas only necessary for multiple TS-CAN1).  Example, for one TS-CAN1 used on the TS-7800-V2:


<pre style="font-family:monospace,Courier New ;background:black; width:20cm; white-space: pre-wrap; white-space: -moz-pre-wrap; word-wrap: break-word; color:white; ">
<pre style="font-family:monospace,Courier New ;background:black; width:20cm; white-space: pre-wrap; white-space: -moz-pre-wrap; word-wrap: break-word; color:white; ">
Line 28: Line 28:
[  92.146672] sja1000_isa sja1000_isa.0: sja1000_isa device registered (reg_base=0xf1634100, irq=123)
[  92.146672] sja1000_isa sja1000_isa.0: sja1000_isa device registered (reg_base=0xf1634100, irq=123)
[  92.159233] Legacy sja1000_isa driver for max. 8 devices registered
[  92.159233] Legacy sja1000_isa driver for max. 8 devices registered
</pre>
Two TS-CAN1 would be very similar to the above example, instead set up each TS-CAN1 with addreses separately, then call the driver just once with the list of TS-CAN1 to be instantiated:
<pre style="font-family:monospace,Courier New ;background:black; width:20cm; white-space: pre-wrap; white-space: -moz-pre-wrap; word-wrap: break-word; color:white; ">
root@ts-7800-v2:~# modprobe sja1000_isa mem=0xfa000100,0xfa000200 irq=6,6
</pre>
</pre>

Latest revision as of 17:10, 21 February 2022

SocketCAN Driver for TS-7800-V2

The Linux Kernel provides upstream compatibility for ISA-based SJA1000 CAN controllers. This driver can make up to three TS-CAN1 peripherals show up as network devices in Linux thus:

root@ts-7800-v2:~# ifconfig can1
can1: flags=128<NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 123  base 0x100

root@ts-7800-v2:~#

The driver module is provided already installed in all embeddedTS software packages that supports SocketCAN with the TS-CAN1. Set the PLD registers for operation and load the driver with the appropriate comma-separated IO and IRQ configurations (commas only necessary for multiple TS-CAN1). Example, for one TS-CAN1 used on the TS-7800-V2:

root@ts-7800-v2:~# source /sbin/ts7800.subr   #load the TS-7800-V2 BASH Macro set
root@ts-7800-v2:~# pc104on                    #enable PC104 with the appropriate macro
root@ts-7800-v2:~# peekpoke 8 0xfa000150      #Check the peripheral ID for presence of the TS-CAN1
0xF6
root@ts-7800-v2:~# peekpoke 8 0xfa000155 0x40 #Enable SJA1000 functions on PC104 IO offset 0x100
0x40
root@ts-7800-v2:~# modprobe sja1000_isa mem=0xfa000100 irq=123 clk=25000000
[   92.146672] sja1000_isa sja1000_isa.0: sja1000_isa device registered (reg_base=0xf1634100, irq=123)
[   92.159233] Legacy sja1000_isa driver for max. 8 devices registered

Two TS-CAN1 would be very similar to the above example, instead set up each TS-CAN1 with addreses separately, then call the driver just once with the list of TS-CAN1 to be instantiated:

root@ts-7800-v2:~# modprobe sja1000_isa mem=0xfa000100,0xfa000200 irq=6,6