Message ID | 1396422700-3962-4-git-send-email-s.trumtrar@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed 2014-04-02 09:11:38, Steffen Trumtrar wrote: > Add both can controllers to the dtsi. > > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> I have had similar patch here, except that it only listed 2 interrupts for each d_can controller. Otherwise it looks identical. Reviewed-by: Pavel Machek <pavel@denx.de>
Hi! > > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> > > I have had similar patch here, except that it only listed 2 interrupts > for each d_can controller. > > Otherwise it looks identical. > > Reviewed-by: Pavel Machek <pavel@denx.de> Actually, does it work for you? Here it produces warnings during boot c_can_platform ffc00000.d_can: invalid resource c_can_platform ffc00000.d_can: control memory is not used for raminit c_can_platform ffc00000.d_can: c_can_platform device registered (regs=9085c000, irq=163) ... can: controller area network core (rev 20120528 abi 9) NET: Registered protocol family 29 can: raw protocol (rev 20120528) can: broadcast manager protocol (rev 20120528 t) can: netlink gateway (rev 20130117) max_hops=1 . Then can0 is correctly registered, and seems to even receive packets, but only when enter is pressed on serial console... which is kind of weird. I suspected irq problems, but same symptomps with "irqpoll" -- it leads to generate 2000 irqs/second, but still waits for enter. [Aha, and we have just two interrupts listed, but I don't think that explains all the problems. Unfortunately, that particular target uses human for remote power switch...]. Any ideas? Thanks, Pavel
On Fri, 2014-04-25 at 21:53 +0200, ZY - pavel wrote: > Hi! > > > > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> > > > > I have had similar patch here, except that it only listed 2 interrupts > > for each d_can controller. > > > > Otherwise it looks identical. > > > > Reviewed-by: Pavel Machek <pavel@denx.de> > > Actually, does it work for you? Here it produces warnings during boot > > c_can_platform ffc00000.d_can: invalid resource > c_can_platform ffc00000.d_can: control memory is not used for raminit > c_can_platform ffc00000.d_can: c_can_platform device registered > (regs=9085c000, irq=163) > ... > can: controller area network core (rev 20120528 abi 9) > NET: Registered protocol family 29 > can: raw protocol (rev 20120528) > can: broadcast manager protocol (rev 20120528 t) > can: netlink gateway (rev 20130117) max_hops=1 > > . Then can0 is correctly registered, and seems to even receive > packets, but only when enter is pressed on serial console... which is > kind of weird. I suspected irq problems, but same symptomps with > "irqpoll" -- it leads to generate 2000 irqs/second, but still waits > for enter. > > [Aha, and we have just two interrupts listed, but I don't think that > explains all the problems. Unfortunately, that particular target uses > human for remote power switch...]. > > Any ideas? CC'ing Thor Thayer. He's done the CAN testing on the SOCFPGA platform. Dinh > > Thanks, > Pavel
On Fri, 2014-04-25 at 15:24 -0500, Dinh Nguyen wrote: > On Fri, 2014-04-25 at 21:53 +0200, ZY - pavel wrote: > > Hi! > > > > > > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> > > > > > > I have had similar patch here, except that it only listed 2 interrupts > > > for each d_can controller. > > > > > > Otherwise it looks identical. > > > > > > Reviewed-by: Pavel Machek <pavel@denx.de> > > > > Actually, does it work for you? Here it produces warnings during boot > > > > c_can_platform ffc00000.d_can: invalid resource > > c_can_platform ffc00000.d_can: control memory is not used for raminit > > c_can_platform ffc00000.d_can: c_can_platform device registered > > (regs=9085c000, irq=163) Hi! Yes, these warnings are being addressed in a patch I submitted that is currently being reviewed. (http://article.gmane.org/gmane.linux.can/5620/match=tthayer) > > ... > > can: controller area network core (rev 20120528 abi 9) > > NET: Registered protocol family 29 > > can: raw protocol (rev 20120528) > > can: broadcast manager protocol (rev 20120528 t) > > can: netlink gateway (rev 20130117) max_hops=1 > > > > . Then can0 is correctly registered, and seems to even receive > > packets, but only when enter is pressed on serial console... which is > > kind of weird. I suspected irq problems, but same symptomps with > > "irqpoll" -- it leads to generate 2000 irqs/second, but still waits > > for enter. > > > > [Aha, and we have just two interrupts listed, but I don't think that > > explains all the problems. Unfortunately, that particular target uses > > human for remote power switch...]. > > > > Any ideas? > > CC'ing Thor Thayer. He's done the CAN testing on the SOCFPGA platform. > > Dinh To get this working well, I had to install a few of the patches that Benedict Spranger submitted ([PATCH 05/16] c_can: use 32 bit access for D_CAN) on 9/9/2013. I have the patches on our rocketboard branch (rocketboards.org/gitweb/?p=linux-socfpga-git;a=summary) I planned to upstream these changes but there have been some major changes to CAN recently that may require some refactoring. Thor > > > > Thanks, > > Pavel > >
diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi index 292c3b2..c8ced33 100644 --- a/arch/arm/boot/dts/socfpga.dtsi +++ b/arch/arm/boot/dts/socfpga.dtsi @@ -470,6 +470,22 @@ status = "disabled"; }; + can0: can@ffc00000 { + compatible = "bosch,d_can"; + reg = <0xffc00000 0x1000>; + interrupts = <0 131 4>, <0 132 4>, <0 133 4>, <0 134 4>; + clocks = <&can0_clk>; + status = "disabled"; + }; + + can1: can@ffc01000 { + compatible = "bosch,d_can"; + reg = <0xffc01000 0x1000>; + interrupts = <0 135 4>, <0 136 4>, <0 137 4>, <0 138 4>; + clocks = <&can1_clk>; + status = "disabled"; + }; + i2c0: i2c@ffc04000 { #address-cells = <1>; #size-cells = <0>;
Add both can controllers to the dtsi. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> --- Changes since v1: - correct node naming scheme arch/arm/boot/dts/socfpga.dtsi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)