Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: dts: Fix dcan driver probe failed on am437x platform

Got following d_can probe errors with kernel 5.8-rc1 on am437x

[ 10.730822] CAN device driver interface
Starting Wait for Network to be Configured...
[ OK ] Reached target Network.
[ 10.787363] c_can_platform 481cc000.can: probe failed
[ 10.792484] c_can_platform: probe of 481cc000.can failed with error -2
[ 10.799457] c_can_platform 481d0000.can: probe failed
[ 10.804617] c_can_platform: probe of 481d0000.can failed with error -2

actually, Tony has fixed this issue on am335x with the patch [3]

Since am437x has the same clock structure with am335x
[1][2], so reuse the code from Tony Lindgren's patch [3] to fix it.

[1]: https://www.ti.com/lit/pdf/spruh73 Chapter-23, Figure 23-1. DCAN
Integration
[2]: https://www.ti.com/lit/pdf/spruhl7 Chapter-25, Figure 25-1. DCAN
Integration
[3]: commit 516f1117d0fb ("ARM: dts: Configure osc clock for d_can on
am335x")

Fixes: 1a5cd7c23cc5 ("bus: ti-sysc: Enable all clocks directly during init to read revision")
Signed-off-by: dillon min <dillon.minfei@gmail.com>
[tony@atomide.com: aligned commit message a bit for readability]
Signed-off-by: Tony Lindgren <tony@atomide.com>

authored by

dillon min and committed by
Tony Lindgren
2a4117df a18fb076

+10 -4
+10 -4
arch/arm/boot/dts/am437x-l4.dtsi
··· 1541 1541 reg = <0xcc020 0x4>; 1542 1542 reg-names = "rev"; 1543 1543 /* Domains (P, C): per_pwrdm, l4ls_clkdm */ 1544 - clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN0_CLKCTRL 0>; 1545 - clock-names = "fck"; 1544 + clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN0_CLKCTRL 0>, 1545 + <&dcan0_fck>; 1546 + clock-names = "fck", "osc"; 1546 1547 #address-cells = <1>; 1547 1548 #size-cells = <1>; 1548 1549 ranges = <0x0 0xcc000 0x2000>; ··· 1551 1550 dcan0: can@0 { 1552 1551 compatible = "ti,am4372-d_can", "ti,am3352-d_can"; 1553 1552 reg = <0x0 0x2000>; 1553 + clocks = <&dcan0_fck>; 1554 + clock-names = "fck"; 1554 1555 syscon-raminit = <&scm_conf 0x644 0>; 1555 1556 interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; 1556 1557 status = "disabled"; ··· 1564 1561 reg = <0xd0020 0x4>; 1565 1562 reg-names = "rev"; 1566 1563 /* Domains (P, C): per_pwrdm, l4ls_clkdm */ 1567 - clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN1_CLKCTRL 0>; 1568 - clock-names = "fck"; 1564 + clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN1_CLKCTRL 0>, 1565 + <&dcan1_fck>; 1566 + clock-names = "fck", "osc"; 1569 1567 #address-cells = <1>; 1570 1568 #size-cells = <1>; 1571 1569 ranges = <0x0 0xd0000 0x2000>; ··· 1574 1570 dcan1: can@0 { 1575 1571 compatible = "ti,am4372-d_can", "ti,am3352-d_can"; 1576 1572 reg = <0x0 0x2000>; 1573 + clocks = <&dcan1_fck>; 1574 + clock-name = "fck"; 1577 1575 syscon-raminit = <&scm_conf 0x644 1>; 1578 1576 interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>; 1579 1577 status = "disabled";