forked from Minki/linux
can: grcan: Add device driver for GRCAN and GRHCAN cores
This driver supports GRCAN and CRHCAN CAN controllers available in the GRLIB VHDL IP core library. Signed-off-by: Andreas Larsson <andreas@gaisler.com> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
c70edb9e8a
commit
6cec9b07fe
35
Documentation/ABI/testing/sysfs-class-net-grcan
Normal file
35
Documentation/ABI/testing/sysfs-class-net-grcan
Normal file
@ -0,0 +1,35 @@
|
||||
|
||||
What: /sys/class/net/<iface>/grcan/enable0
|
||||
Date: October 2012
|
||||
KernelVersion: 3.8
|
||||
Contact: Andreas Larsson <andreas@gaisler.com>
|
||||
Description:
|
||||
Hardware configuration of physical interface 0. This file reads
|
||||
and writes the "Enable 0" bit of the configuration register.
|
||||
Possible values: 0 or 1. See the GRCAN chapter of the GRLIB IP
|
||||
core library documentation for details. The default value is 0
|
||||
or set by the module parameter grcan.enable0 and can be read at
|
||||
/sys/module/grcan/parameters/enable0.
|
||||
|
||||
What: /sys/class/net/<iface>/grcan/enable1
|
||||
Date: October 2012
|
||||
KernelVersion: 3.8
|
||||
Contact: Andreas Larsson <andreas@gaisler.com>
|
||||
Description:
|
||||
Hardware configuration of physical interface 1. This file reads
|
||||
and writes the "Enable 1" bit of the configuration register.
|
||||
Possible values: 0 or 1. See the GRCAN chapter of the GRLIB IP
|
||||
core library documentation for details. The default value is 0
|
||||
or set by the module parameter grcan.enable1 and can be read at
|
||||
/sys/module/grcan/parameters/enable1.
|
||||
|
||||
What: /sys/class/net/<iface>/grcan/select
|
||||
Date: October 2012
|
||||
KernelVersion: 3.8
|
||||
Contact: Andreas Larsson <andreas@gaisler.com>
|
||||
Description:
|
||||
Configuration of which physical interface to be used. Possible
|
||||
values: 0 or 1. See the GRCAN chapter of the GRLIB IP core
|
||||
library documentation for details. The default value is 0 or is
|
||||
set by the module parameter grcan.select and can be read at
|
||||
/sys/module/grcan/parameters/select.
|
28
Documentation/devicetree/bindings/net/can/grcan.txt
Normal file
28
Documentation/devicetree/bindings/net/can/grcan.txt
Normal file
@ -0,0 +1,28 @@
|
||||
Aeroflex Gaisler GRCAN and GRHCAN CAN controllers.
|
||||
|
||||
The GRCAN and CRHCAN CAN controllers are available in the GRLIB VHDL IP core
|
||||
library.
|
||||
|
||||
Note: These properties are built from the AMBA plug&play in a Leon SPARC system
|
||||
(the ordinary environment for GRCAN and GRHCAN). There are no dts files for
|
||||
sparc.
|
||||
|
||||
Required properties:
|
||||
|
||||
- name : Should be "GAISLER_GRCAN", "01_03d", "GAISLER_GRHCAN" or "01_034"
|
||||
|
||||
- reg : Address and length of the register set for the device
|
||||
|
||||
- freq : Frequency of the external oscillator clock in Hz (the frequency of
|
||||
the amba bus in the ordinary case)
|
||||
|
||||
- interrupts : Interrupt number for this device
|
||||
|
||||
Optional properties:
|
||||
|
||||
- systemid : If not present or if the value of the least significant 16 bits
|
||||
of this 32-bit property is smaller than GRCAN_TXBUG_SAFE_GRLIB_VERSION
|
||||
a bug workaround is activated.
|
||||
|
||||
For further information look in the documentation for the GLIB IP core library:
|
||||
http://www.gaisler.com/products/grlib/grip.pdf
|
@ -905,6 +905,24 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
gpt [EFI] Forces disk with valid GPT signature but
|
||||
invalid Protective MBR to be treated as GPT.
|
||||
|
||||
grcan.enable0= [HW] Configuration of physical interface 0. Determines
|
||||
the "Enable 0" bit of the configuration register.
|
||||
Format: 0 | 1
|
||||
Default: 0
|
||||
grcan.enable1= [HW] Configuration of physical interface 1. Determines
|
||||
the "Enable 0" bit of the configuration register.
|
||||
Format: 0 | 1
|
||||
Default: 0
|
||||
grcan.select= [HW] Select which physical interface to use.
|
||||
Format: 0 | 1
|
||||
Default: 0
|
||||
grcan.txsize= [HW] Sets the size of the tx buffer.
|
||||
Format: <unsigned int> such that (txsize & ~0x1fffc0) == 0.
|
||||
Default: 1024
|
||||
grcan.rxsize= [HW] Sets the size of the rx buffer.
|
||||
Format: <unsigned int> such that (rxsize & ~0x1fffc0) == 0.
|
||||
Default: 1024
|
||||
|
||||
hashdist= [KNL,NUMA] Large hashes allocated during boot
|
||||
are distributed across NUMA nodes. Defaults on
|
||||
for 64-bit NUMA, off otherwise.
|
||||
|
@ -110,6 +110,15 @@ config PCH_CAN
|
||||
is an IOH for x86 embedded processor (Intel Atom E6xx series).
|
||||
This driver can access CAN bus.
|
||||
|
||||
config CAN_GRCAN
|
||||
tristate "Aeroflex Gaisler GRCAN and GRHCAN CAN devices"
|
||||
depends on CAN_DEV && OF
|
||||
---help---
|
||||
Say Y here if you want to use Aeroflex Gaisler GRCAN or GRHCAN.
|
||||
Note that the driver supports little endian, even though little
|
||||
endian syntheses of the cores would need some modifications on
|
||||
the hardware level to work.
|
||||
|
||||
source "drivers/net/can/mscan/Kconfig"
|
||||
|
||||
source "drivers/net/can/sja1000/Kconfig"
|
||||
|
@ -22,5 +22,6 @@ obj-$(CONFIG_CAN_BFIN) += bfin_can.o
|
||||
obj-$(CONFIG_CAN_JANZ_ICAN3) += janz-ican3.o
|
||||
obj-$(CONFIG_CAN_FLEXCAN) += flexcan.o
|
||||
obj-$(CONFIG_PCH_CAN) += pch_can.o
|
||||
obj-$(CONFIG_CAN_GRCAN) += grcan.o
|
||||
|
||||
ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
|
||||
|
1756
drivers/net/can/grcan.c
Normal file
1756
drivers/net/can/grcan.c
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user