Re: longterm kernel 4.9, flexcan: clk_per, clk_ipg should be initialized always

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"

At least this interface is not intended nor functional for this. The
clock routing setup is done in drivers/clk/imx/.

"


Indeed it is, however despite of that the driver sees own "clocks" namespace and e.g. "per" clock is a copy (different pointer) of instance created in e.g. imx6ul_clocks_init(): clks[*_CAN1_SERIAL], (dts binds various device "namespaces" and the static struct clk * clks)

and because the routing is done properly over there then driver can still apply clk_set_rate() which will tune underlying hardware finally. (and according to what it really is, divider, pll, mux, etc)

Using clk_set_rate( clk_get( ,"per")) will modify CAN_PODF "clock" instance finally.


Just give a try. If you add a debug which will show clock rate read back in flexcan_probe() then you will see that initialization of 2nd can instance (imx6ull - verified) will read clock rate set during initialization of 1st can instance. This happens because CAN_PODF is common clock to both can instances and "gating clocks" (e.g. "per") were setup correctly.


Pozdrawiam / Best Regards / Freundliche Grüße

Krzysztof Błaszkowski
Projektant / Elektronik



Ekoenergetyka-Polska Sp. z o.o.
ul.Nowy Kisielin - Wysockiego 8,
66-002 Zielona Góra

Tel./Fax +48 68 328 20 68
/
/www.ekoenergetyka.com.pl <http://www.ekoenergetyka.com.pl/>

_Dane do faktury*:*_

Ekoenergetyka - Polska sp. z o.o.
ul. Nowy Kisielin - A. Wysockiego 8
66-002 Zielona Góra
NIP: 973-101-39-38
Regon: 081115852
BDO: 000014716
Sąd Rejonowy w Zielonej Górze, VIII Wydział Gospodarczy KRS
KRS: 0000452958
Kapitał zakładowy: 133.300,00 zł
On 09/26/2018 12:57 PM, Marc Kleine-Budde wrote:
On 09/26/2018 12:37 PM, Krzysztof Blaszkowski wrote:
I didn't know about this special feature for old PPC. Changing clock
rate may be useful still for someone who wants to reduce bitrate error
for his non-standard application.
At least this interface is not intended nor functional for this. The
clock routing setup is done in drivers/clk/imx/.

I'm not sure what's the correct interface to reparent the clock. Do you
have this usecase?

My next thought was if these old PPC kernels don't have clock subsystem
then flexcan module may not even compile.
It does - I think there are static inline nops for the clock framework.

Marc





[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux