Posting on behalf of felix_123
Where is the place to activate Clocks/Devices in Linux Kernel? I think this is most probably done in the Device Tree files. PCIE1 Module for instance has the following entry in arch/arm64/boot/dts/ti/k3-j721e-main.dtsi:
pcie1_rc: pcie@2910000 {
compatible = "ti,j721e-pcie-host";
reg = <0x00 0x02910000 0x00 0x1000>,
<0x00 0x02917000 0x00 0x400>,
<0x00 0x0d800000 0x00 0x00800000>,
<0x00 0x18000000 0x00 0x00001000>;
reg-names = "intd_cfg", "user_cfg", "reg", "cfg";
ti,syscon-pcie-ctrl = <&pcie1_ctrl>;
max-link-speed = <3>;
num-lanes = <2>;
power-domains = <&k3_pds 240 TI_SCI_PD_EXCLUSIVE>;
clocks = <&k3_clks 240 1>;
clock-names = "fck";
#address-cells = <3>;
#size-cells = <2>;
bus-range = <0x0 0xf>;
cdns,max-outbound-regions = <16>;
cdns,no-bar-match-nbits = <64>;
vendor-id = /bits/ 16 <0x104c>;
device-id = /bits/ 16 <0xb00d>;
msi-map = <0x0 &gic_its 0x10000 0x10000>;
dma-coherent;
ranges = <0x01000000 0x0 0x18001000 0x00 0x18001000 0x0 0x0010000>,
<0x02000000 0x0 0x18011000 0x00 0x18011000 0x0 0x7fef000>;
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 7>;
interrupt-map = <0 0 0 1 &pcie1_intc 0>, /* INT A */
<0 0 0 2 &pcie1_intc 0>, /* INT B */
<0 0 0 3 &pcie1_intc 0>, /* INT C */
<0 0 0 4 &pcie1_intc 0>; /* INT D */
pcie1_intc: legacy-interrupt-controller {
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&gic500>;
interrupts = <GIC_SPI 324 IRQ_TYPE_EDGE_RISING>;
};
};
the field "clocks" would match with the already mentioned device list (https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j721e/devices.html), because of the Device ID 240. If this is the correct place to activate Modules in Linux, then there is still a missing link to how Linux knows the correct frequency to power up this module? Can you point me to the right direction where this is done?
For context: J721E_DEV_PCIE1 for instance is neither activated in R5 SPL, nor in U-Boot. I verified this by using an Baremetal application for MCU2_0, which consumes J721E_DEV_PCIE1. This application throws errors, when executed after U-Boot boot (The corresponding option to activate the Clocks is not passed to theBoard_init() function). After Linux has booted, J721E_DEV_PCIE1 is enabled and this previous mentioned application works as expected.
Thanks again and best regards