Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(kernel-rolling) can: Add Phytium CAN controller support #221

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions Documentation/devicetree/bindings/net/can/phytium,can.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/can/phytium,can.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title:
Phytium CAN controller

maintainers:
- Chen Baozi <[email protected]>

properties:
compatible:
enum:
- phytium,can
- phytium,canfd

reg:
maxItems: 1
description: Should contain the controller registers location and length

interrupts:
maxItems: 1
description: Should contain IRQ line for the controller

clocks:
maxItems: 1
description: Input clock used by the controller

clock-names:
maxItems: 1
description: Input clock name, should be "can_clk"
const: can_clk

tx-fifo-depth:
$ref: "/schemas/types.yaml#/definitions/uint32"
description: Indicates the length of TX FIFO

rx-fifo-depth:
$ref: "/schemas/types.yaml#/definitions/uint32"
description: Indicates the length of RX FIFO

extend_brp:
description: |
Indicates to apply the extend BRP parameter of bit timming for
early version of CAN controller

required:
- compatible
- reg
- interrupts
- clocks
- clock-names
- tx-fifo-depth
- rx-fifo-depth

allOf:
- $ref: can-controller.yaml#

examples:
- |

can0: can@2800a000 {
compatible = "phytium,canfd";
reg = <0x0 0x2800a000 0x0 0x1000>;
interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&sysclk_600mhz>;
clock-names = "can_clk";
tx-fifo-depth = <64>;
rx-fifo-depth = <64>;
};
1 change: 1 addition & 0 deletions drivers/net/can/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ source "drivers/net/can/ifi_canfd/Kconfig"
source "drivers/net/can/m_can/Kconfig"
source "drivers/net/can/mscan/Kconfig"
source "drivers/net/can/peak_canfd/Kconfig"
source "drivers/net/can/phytium/Kconfig"
source "drivers/net/can/rcar/Kconfig"
source "drivers/net/can/sja1000/Kconfig"
source "drivers/net/can/softing/Kconfig"
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/can/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ obj-$(CONFIG_CAN_SJA1000) += sja1000/
obj-$(CONFIG_CAN_SUN4I) += sun4i_can.o
obj-$(CONFIG_CAN_TI_HECC) += ti_hecc.o
obj-$(CONFIG_CAN_XILINXCAN) += xilinx_can.o

obj-$(CONFIG_CAN_PHYTIUM) += phytium/
subdir-ccflags-$(CONFIG_CAN_DEBUG_DEVICES) += -DDEBUG
34 changes: 34 additions & 0 deletions drivers/net/can/phytium/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SPDX-License-Identifier: GPL-2.0-only
menuconfig CAN_PHYTIUM
tristate "Phytium CAN support"
help
Say Y here if you want support for Phytium CAN controller framework.
This is common support for devices that embed the Phytium CAN IP.

To compile this driver as a module, choose M here: the module will
be called phytium_can.

if CAN_PHYTIUM

config CAN_PHYTIUM_PLATFORM
tristate "Phytium CAN support for io-mapped devices"
depends on HAS_IOMEM
help
Say Y here is you want to support for IO Mapped Phytium CAN controller.
This support is for devices that have the Phytium CAN controller IP
embedded into the device and the IP is IO Mapped to the processor.

To compile this driver as a module, choose M here: the module will
be called phytium_can_platform.

config CAN_PHYTIUM_PCI
tristate "Phytium CAN support for PCI devices"
depends on PCI
help
Say Y here is you want to support for Phytium CAN controller connected
to the PCI bus. This support is for devices that have the Phytium CAN
controller IP embedded into a PCI device.

To compile this driver as a module, choose M here: the module will
be called phytium_can_pci.
endif
8 changes: 8 additions & 0 deletions drivers/net/can/phytium/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Makefile for the Phytium CAN controller drivers.
#
#

obj-$(CONFIG_CAN_PHYTIUM) += phytium_can.o
obj-$(CONFIG_CAN_PHYTIUM_PLATFORM) += phytium_can_platform.o
obj-$(CONFIG_CAN_PHYTIUM_PCI) += phytium_can_pci.o
Loading