linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mkl@pengutronix.de (Marc Kleine-Budde)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5] can: xilinx CAN controller support.
Date: Mon, 10 Mar 2014 16:10:31 +0100	[thread overview]
Message-ID: <531DD5E7.7090406@pengutronix.de> (raw)
In-Reply-To: <531DD493.3030306@monstr.eu>

On 03/10/2014 04:04 PM, Michal Simek wrote:
> Hi Marc,
> 
> On 03/10/2014 03:57 PM, Marc Kleine-Budde wrote:
>> On 03/04/2014 02:20 PM, Kedareswara rao Appana wrote:
>>> This patch adds xilinx CAN controller support.
>>> This driver supports both ZYNQ CANPS and Soft IP
>>> AXI CAN controller.
>>>
>>> Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
>>> ---
>>> This patch is rebased on the 3.14 rc5 kernel.
>>> Changes for v5:
>>> - Updated the driver with the review comments.
>>> - Remove the check for the tx fifo full interrupt condition
>>>   form Tx interrupt routine as we are checking it in the _xmit
>>>   routine.
>>> - Clearing the txok interrupt in the tx interrupt routine for
>>>   every Tx can frame.
>>> Changes for v4:
>>> - Added check for the tx fifo full interrupt condition in
>>>   Tx interrupt routine.
>>> - Added be iohelper functions.
>>> - Moved the clock enable/disable to probe/remove because of
>>>   Added big endian support for AXI CAN controller case(reading
>>>   a register during probe for that we need to enable clock).
>>> Changes for v3:
>>> - Updated the driver with the review comments.
>>> - Modified the tranmit logic as per Marc suggestion.
>>> - Enabling the clock when the interface is up to reduce the
>>>   Power consumption.
>>> Changes for v2:
>>> - Updated with the review comments.
>>> - Removed the unnecessary debug prints.
>>> - include tx,rx fifo depths in ZYNQ CANPS case also.
>>> ---
>>>  .../devicetree/bindings/net/can/xilinx_can.txt     |   45 +
>>>  drivers/net/can/Kconfig                            |    7 +
>>>  drivers/net/can/Makefile                           |    1 +
>>>  drivers/net/can/xilinx_can.c                       | 1195 ++++++++++++++++++++
>>>  4 files changed, 1248 insertions(+), 0 deletions(-)
>>>  create mode 100644 Documentation/devicetree/bindings/net/can/xilinx_can.txt
>>>  create mode 100644 drivers/net/can/xilinx_can.c
>>>
>>> diff --git a/Documentation/devicetree/bindings/net/can/xilinx_can.txt b/Documentation/devicetree/bindings/net/can/xilinx_can.txt
>>> new file mode 100644
>>> index 0000000..0e57103
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/net/can/xilinx_can.txt
>>> @@ -0,0 +1,45 @@
>>> +Xilinx Axi CAN/Zynq CANPS controller Device Tree Bindings
>>> +---------------------------------------------------------
>>> +
>>> +Required properties:
>>> +- compatible		: Should be "xlnx,zynq-can-1.00.a" for Zynq CAN
>>> +			  controllers and "xlnx,axi-can-1.00.a" for Axi CAN
>>> +			  controllers.
>>> +- reg			: Physical base address and size of the Axi CAN/Zynq
>>> +			  CANPS registers map.
>>> +- interrupts		: Property with a value describing the interrupt
>>> +			  number.
>>> +- interrupt-parent	: Must be core interrupt controller
>>> +- clock-names		: List of input clock names - "ref_clk", "aper_clk"
>>> +			  (See clock bindings for details. Two clocks are
>>> +			   required for Zynq CAN. For Axi CAN
>>> +			   case it is one(ref_clk)).
>>> +- clocks		: Clock phandles (see clock bindings for details).
>>> +- tx-fifo-depth		: Can Tx fifo depth.
>>> +- rx-fifo-depth		: Can Rx fifo depth.
>>> +
>>> +
>>> +Example:
>>> +
>>> +For Zynq CANPS Dts file:
>>> +	zynq_can_0: zynq-can at e0008000 {
>>> +			compatible = "xlnx,zynq-can-1.00.a";
>>> +			clocks = <&clkc 19>, <&clkc 36>;
>>> +			clock-names = "ref_clk", "aper_clk";
>>> +			reg = <0xe0008000 0x1000>;
>>> +			interrupts = <0 28 4>;
>>> +			interrupt-parent = <&intc>;
>>> +			tx-fifo-depth = <0x40>;
>>> +			rx-fifo-depth = <0x40>;
>>> +		};
>>> +For Axi CAN Dts file:
>>> +	axi_can_0: axi-can at 40000000 {
>>> +			compatible = "xlnx,axi-can-1.00.a";
>>> +			clocks = <&clkc 0>;
>>> +			clock-names = "ref_clk" ;
>>> +			reg = <0x40000000 0x10000>;
>>> +			interrupt-parent = <&intc>;
>>> +			interrupts = <0 59 1>;
>>> +			tx-fifo-depth = <0x40>;
>>> +			rx-fifo-depth = <0x40>;
>>> +		};
>>> diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig
>>> index 9e7d95d..b180239 100644
>>> --- a/drivers/net/can/Kconfig
>>> +++ b/drivers/net/can/Kconfig
>>> @@ -125,6 +125,13 @@ config CAN_GRCAN
>>>  	  endian syntheses of the cores would need some modifications on
>>>  	  the hardware level to work.
>>>  
>>> +config CAN_XILINXCAN
>>> +	tristate "Xilinx CAN"
>>> +	depends on ARCH_ZYNQ || MICROBLAZE
>>
>> Is Zynq multiarch already?
> 
> let me just answer this. Zynq is device with hardcoded dual arm cortex-a9 + some IPs
> and programmable logic.
> It means if you add Microblaze to PL or another CPU then you get multi architecture setup.

Sorry for the confusion, I'm not talking about
more-than-one-architecture-in-a-FPGA, but the feature of the ARM-Linux
Kernel to run on different ARM architecture. For example, it's possible
to start the same kernel on a freescale imx6 and a the new marvel ebu
platform. If the Zynq Kernel supports this feature, too, we should not
limit to ARCH_ZYNQ, but use ARM instead.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 242 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140310/2b41668b/attachment.sig>

  reply	other threads:[~2014-03-10 15:10 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04 13:20 [PATCH v5] can: xilinx CAN controller support Kedareswara rao Appana
2014-03-04 23:51 ` Sören Brinkmann
2014-03-05  6:58   ` Oliver Hartkopp
2014-03-05  7:04     ` Appana Durga Kedareswara Rao
     [not found] ` <20140304235115.GN13293@xsjandreislx>
2014-03-05  7:03   ` Appana Durga Kedareswara Rao
2014-03-10 14:57 ` Marc Kleine-Budde
2014-03-10 15:04   ` Michal Simek
2014-03-10 15:10     ` Marc Kleine-Budde [this message]
2014-03-10 15:15       ` Arnd Bergmann
2014-03-10 15:26         ` Michal Simek
2014-03-11  4:45           ` Fengguang Wu
2014-03-11  9:38             ` Michal Simek
2014-03-13 11:21               ` Fengguang Wu
2014-03-11 12:34   ` Appana Durga Kedareswara Rao
2014-03-11 12:48     ` Marc Kleine-Budde
2014-03-11 14:08       ` Appana Durga Kedareswara Rao
2014-03-11 14:31         ` Marc Kleine-Budde
2014-03-12 10:18           ` Michal Simek
2014-03-12 16:18             ` Sören Brinkmann
2014-03-12 10:01       ` Michal Simek
2014-03-20  4:41         ` Appana Durga Kedareswara Rao
2014-03-10 15:15 ` Rob Herring
2014-03-10 15:22   ` Michal Simek
     [not found]   ` <531DD8C3.5050006@xilinx.com>
2014-03-11 12:35     ` Appana Durga Kedareswara Rao
     [not found] <1393939253-30245-1-git-send-email-appanad@xilinx.com>
2014-03-10  7:12 ` Appana Durga Kedareswara Rao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=531DD5E7.7090406@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).