Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: Cunhao Lu <1579567540@qq.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	kernel@pengutronix.de, Vincent Mailhol <mailhol@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Quentin Schulz <quentin.schulz@cherry.de>
Cc: linux-can@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	Heiko Stuebner <heiko.stuebner@cherry.de>
Subject: Re: [PATCH v4 4/4] arm64: dts: rockchip: Enable CAN controller on RK3588-Tiger-Haikou
Date: Fri, 03 Jul 2026 16:23:22 +0200	[thread overview]
Message-ID: <3078012.2VHbPRQshP@diego> (raw)
In-Reply-To: <e03fcd5c-de56-4f39-90c2-3ba0636a1cca@cherry.de>

Am Freitag, 3. Juli 2026, 16:05:18 Mitteleuropäische Sommerzeit schrieb Quentin Schulz:
> Hi Heiko, Cunhao,
> 
> On 7/3/26 10:01 AM, Cunhao Lu wrote:
> > From: Heiko Stuebner <heiko.stuebner@cherry.de>
> > 
> > CAN0 is piped through the Q7-connector to the CAN-Header on the Haikou
> > base-board, so enable support for it there.
> > 
> > At least on RK3588-Tiger, the CAN clocks default to 99MHz, limiting
> > usable CAN bitrates without skew. Errata documentation mentions
> > 300MHz as the default frequency on RK3568, so replicate this here
> > to allow more bitrates.
> > 
> > Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
> > Signed-off-by: Cunhao Lu <1579567540@qq.com>
> > ---
> >   arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts | 6 ++++++
> >   1 file changed, 6 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
> > index 873fbeb8daa1..6273e695b039 100644
> > --- a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
> > +++ b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
> > @@ -155,6 +155,12 @@ vddd_audio_1v6: regulator-vddd-audio-1v6 {
> >   	};
> >   };
> >   
> > +&can0 {
> > +	assigned-clocks = <&cru CLK_CAN0>;
> > +	assigned-clock-rates = <300000000>;
> 
> Why is this not SoC-specific? We are only routing the signal from the 
> SoC after all.

My main reason was that I have no clue what a reasonable controller
frequency is. The default on Tiger on boot  is 99MHz, which causes
problems with accurate rates.

Similarly the controller has issues with low clock rates (erratum 5 if
I'm not mistaken) and ther Mark wrote that at 300MHz the issue is less
visible. So I took that frequency, but have no clue what the "right"
frequency is.

Similarly, only Renesas socs seem to set their can frequency in the DT
and that to 40MHz.

In the Rockchip vendor-kernel I've seen rates to set to 150MHz, 200MHz
(or left alone) on a board-level

rk3568-ok3568c.dts even sets both 150MHZ AND 200MHz depending
on the CAN controller (200 for can0+1, 150 for can2) .

This does suggest the usable frequency being specific to the board-design.


> If it cannot be put into rk3588-base.dtsi for some reason and is 
> product-specific... Why is this in the baseboard DTS and not in the SoM 
> DTSI? I would like to avoid our customers to have to copy things over if 
> they should just work on their baseboard too if they don't do crazy 
> things there.

We can of course move the clk-rate to the tiger.dtsi.
(This should not affect the rest of the series, as I'll be applying the
dts patches anyway)


Heiko


> I'll try to find time to test the three CAN controllers on RK3588 Jaguar 
> with the CAN1-CAN2-UART4 Mezzanine adapter board and will contribute an 
> overlay for that if it goes well. I don't have a CAN-FD adapter though 
> but I hope they reused the exact same IP for the three controllers in 
> the SoC :)






      reply	other threads:[~2026-07-03 14:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260703-master-v4-0-47d40bbf5fda@qq.com>
2026-07-03  8:01 ` [PATCH v4 1/4] dt-bindings: can: rockchip: add rk3588 CAN-FD compatible Cunhao Lu
2026-07-03  8:01 ` [PATCH v4 2/4] can: rockchip: add RK3588 CAN support Cunhao Lu
2026-07-03  8:01 ` [PATCH v4 3/4] arm64: dts: rockchip: add CAN-FD nodes for RK3588 Cunhao Lu
2026-07-03 13:59   ` Quentin Schulz
2026-07-03 14:53     ` Cunhao Lu
2026-07-03  8:01 ` [PATCH v4 4/4] arm64: dts: rockchip: Enable CAN controller on RK3588-Tiger-Haikou Cunhao Lu
2026-07-03 14:05   ` Quentin Schulz
2026-07-03 14:23     ` Heiko Stübner [this message]

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=3078012.2VHbPRQshP@diego \
    --to=heiko@sntech.de \
    --cc=1579567540@qq.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko.stuebner@cherry.de \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mailhol@kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=quentin.schulz@cherry.de \
    --cc=robh@kernel.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