Skip to contentSkip to conversation

soc vs. clocks in device-tree

U-Boot Benjamin Tietz 2 participants 3 messages Jun 20, 2016 – Jun 23, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

in my device-tree (for stm32f429 - as found in the linux kernel) exist two branches /soc and /clocks. While /soc contains all embedded functionality of the SOC, /clocks contain the external crystal, like in the following snippet.

/ {
	clocks {
		clk_hse: clk-hse {
			#clock-cells = <0>;
			compatible = "fixed-clock";
			clock-frequency = <0>;
		};
	};

	soc {
		rcc: rcc at 40023810 {
			#clock-cells = <2>;
			compatible = "st,stm32f42xx-rcc", "st,stm32-rcc";
			reg = <0x40023800 0x400>;
			clocks = <&clk_hse>;
		};
		...
	};
};

While /soc is detected in u-boot using the simple-bus class, /clocks is ignored completely, Because of that, the crystal isn't detected, too. If I move the crystal into the /soc branch, it is found and can be referenced.

Poking through the code I haven't yet found the reason, why soc is initialized as simple-bus and clocks is not. Could someone please enlighten me?

best regards
Benjamin Tietz

#1 lore raw

Hi Benjamin,

Quoted 28 lines · Benjamin Tietz

Hello,

in my device-tree (for stm32f429 - as found in the linux kernel) exist two branches /soc and /clocks. While /soc contains all embedded functionality of the SOC, /clocks contain the external crystal, like in the following snippet.

/ {
        clocks {
                clk_hse: clk-hse {
                        #clock-cells = <0>;
                        compatible = "fixed-clock";
                        clock-frequency = <0>;
                };
        };

        soc {
                rcc: rcc at 40023810 {
                        #clock-cells = <2>;
                        compatible = "st,stm32f42xx-rcc", "st,stm32-rcc";
                        reg = <0x40023800 0x400>;
                        clocks = <&clk_hse>;
                };
                ...
        };
};
Quoted 4 lines

While /soc is detected in u-boot using the simple-bus class, /clocks is ignored completely, Because of that, the crystal isn't detected, too. If I move the crystal into the /soc branch, it is found and can be referenced.

Can you add this:

compatible = "simple-bus";

Quoted 4 lines

Poking through the code I haven't yet found the reason, why soc is initialized as simple-bus and clocks is not. Could someone please enlighten me?

No, I don't understand that either. From what I know of it, there is no special case logic for "soc".

Quoted 2 lines

best regards
Benjamin Tietz

Regards,
Simon

#2 lore raw

Hi Simon,

Quoted 31 lines · Simon Glass

Hi Benjamin,

Quoted 28 lines · Benjamin Tietz

Hello,

in my device-tree (for stm32f429 - as found in the linux kernel) exist two branches /soc and /clocks. While /soc contains all embedded functionality of the SOC, /clocks contain the external crystal, like in the following snippet.

/ {
        clocks {
                clk_hse: clk-hse {
                        #clock-cells = <0>;
                        compatible = "fixed-clock";
                        clock-frequency = <0>;
                };
        };

        soc {
                rcc: rcc at 40023810 {
                        #clock-cells = <2>;
                        compatible = "st,stm32f42xx-rcc", "st,stm32-rcc";
                        reg = <0x40023800 0x400>;
                        clocks = <&clk_hse>;
                };
                ...
        };
};
Quoted 8 lines
Quoted 4 lines

While /soc is detected in u-boot using the simple-bus class, /clocks is ignored completely, Because of that, the crystal isn't detected, too. If I move the crystal into the /soc branch, it is found and can be referenced.

Can you add this:

compatible = "simple-bus";

Thank you, that is the solution.

Quoted 8 lines
Quoted 5 lines

Poking through the code I haven't yet found the reason, why soc is initialized as simple-bus and clocks is not. Could someone please enlighten me?

No, I don't understand that either. From what I know of it, there is no special case logic for "soc".

There really is no special logic. For the soc-part that line is hidden within the processor-specific dts-file (armv7-m.dtsi in this case.). The "clock" doesn't appear there, so no compatible line was parsed and the node ignored.

Quoted 6 lines
Quoted 3 lines

best regards
Benjamin Tietz

Regards,
Simon

Regards
Benjamin