Jailhouse Linux inmate DTB clock configuration

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Jailhouse Linux inmate DTB clock configuration

1,203 Views
slimSHA
Contributor III

I was trying to bring up LCD in jailhouse inmate Linux in an imx8mp based custom board.

here is my inmate Linux dtb file excerpt ( full inmate dtb is attached below )

 

			lcdif1: lcd-controller@32e80000 {
				#address-cells = <1>;
				#size-cells = <0>;
				compatible = "fsl,imx8mp-lcdif1";
				reg = <0x32e80000 0x10000>;
				/**
					clocks = <&clk IMX8MP_CLK_MEDIA_DISP1_PIX_ROOT>,
					<&clk IMX8MP_CLK_MEDIA_AXI_ROOT>,
					<&clk IMX8MP_CLK_MEDIA_APB_ROOT>;
				*/
				clocks = <&clk_250m>,<&clk_500m>,<&clk_200m>;
				clock-names = "pix", "disp-axi", "disp-apb";
				/**
					assigned-clocks = <&clk IMX8MP_CLK_MEDIA_DISP1_PIX>,
					<&clk IMX8MP_CLK_MEDIA_AXI>,
					<&clk IMX8MP_CLK_MEDIA_APB>;
					assigned-clock-parents = <&clk IMX8MP_VIDEO_PLL1_OUT>,
					<&clk IMX8MP_SYS_PLL2_1000M>,
					<&clk IMX8MP_SYS_PLL1_800M>;
					assigned-clock-rates = <0>, <500000000>, <200000000>;
				*/
				assigned-clocks = <&clk_250m>,<&clk_500pm>,<&clk_200pm>;
				assigned-clock-parents = <&clk_1190m>,<&clk_1000m>,<&clk_800m>;
				assigned-clock-rates = <0>, <500000000>, <200000000>;
				
				interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
				blk-ctl = <&mediamix_blk_ctl>;
				power-domains = <&mediamix_pd>;
				status = "okay";

				lcdif1_disp: port@0 {
					reg = <0>;

					lcdif_to_dsim: endpoint {
						remote-endpoint = <&dsim_from_lcdif>;
					};
				};
			};

 


I provided fixed-clock as assigned-clock and assigned-clock-parent. but I'm getting the following error while booting

 

[    1.423787] clk: failed to reparent clk_200pm to clk_800m: -22
[    1.432102] imx-lcdifv3 32e80000.lcd-controller: No pix clock get
[    1.438737] clk: failed to reparent clk_250m to clk_1190m: -22
[    1.444350] clk: failed to reparent clk_500pm to clk_1000m: -22
[    1.450040] clk: failed to reparent clk_200pm to clk_800m: -22
[    1.455685] imx-lcdifv3 32e80000.lcd-controller: No pix clock get
[    1.462292] clk: failed to reparent clk_250m to clk_1190m: -22
[    1.467919] clk: failed to reparent clk_500pm to clk_1000m: -22
[    1.473614] clk: failed to reparent clk_200pm to clk_800m: -22
[    1.479250] imx-lcdifv3 32e80000.lcd-controller: No pix clock get

 

Any idea how to use clocks properly in inmate Linux?

0 Kudos
2 Replies

1,146 Views
Peng_Fan
NXP Employee
NXP Employee

Need let root cell configure the clk ready before you start inmate. Because there is only one clk hardware controller, and the controller is owned by root cell, so inmate not have a hardware clk controller.

Kernel & Virtualization Engineer
0 Kudos

1,117 Views
slimSHA
Contributor III

As per this I added lcdif clocks in init-on-array

This is my rootcell dtb init-on-array

&clk {
	init-on-array = <IMX8MP_CLK_USDHC3_ROOT
			 IMX8MP_CLK_NAND_USDHC_BUS
			 IMX8MP_CLK_HSIO_ROOT
			 IMX8MP_CLK_UART4_ROOT
			 IMX8MP_CLK_I2C3_ROOT
			 IMX8MP_CLK_MEDIA_DISP1_PIX_ROOT
			 IMX8MP_CLK_MEDIA_AXI_ROOT
			 IMX8MP_CLK_MEDIA_APB_ROOT
			 IMX8MP_CLK_MEDIA_MIPI_PHY1_REF
			 IMX8MP_CLK_OCOTP_ROOT>;
};

based on the im8mp-evk-inmate.dts UART4 example, I added fixed clocks  for the lcdif1 node in inmate dtb as follows 

.....
	clk_500m:clock@11{
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <500000000>;
		clock-output-names = "clk_500m";	
	};
......
lcdif1: lcd-controller@32e80000 {
				#address-cells = <1>;
				#size-cells = <0>;
				compatible = "fsl,imx8mp-lcdif1";
				reg = <0x32e80000 0x10000>;
				/**
					clocks = <&clk IMX8MP_CLK_MEDIA_DISP1_PIX_ROOT>,
					<&clk IMX8MP_CLK_MEDIA_AXI_ROOT>,
					<&clk IMX8MP_CLK_MEDIA_APB_ROOT>;
				*/
				clocks = <&clk_250m>,<&clk_500m>,<&clk_200m>;
				clock-names = "pix", "disp-axi", "disp-apb";
				/**
					assigned-clocks = <&clk IMX8MP_CLK_MEDIA_DISP1_PIX>,
					<&clk IMX8MP_CLK_MEDIA_AXI>,
					<&clk IMX8MP_CLK_MEDIA_APB>;
					assigned-clock-parents = <&clk IMX8MP_VIDEO_PLL1_OUT>,
					<&clk IMX8MP_SYS_PLL2_1000M>,
					<&clk IMX8MP_SYS_PLL1_800M>;
					assigned-clock-rates = <0>, <500000000>, <200000000>;
				*/
				assigned-clocks = <&clk_250m>,<&clk_500pm>,<&clk_200pm>;
				assigned-clock-parents = <&osc_24m>,<&osc_24m>,<&osc_24m>;
				assigned-clock-rates = <0>, <500000000>, <200000000>;
				
				interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
				blk-ctl = <&mediamix_blk_ctl>;
				power-domains = <&mediamix_pd>;
				status = "okay";

				lcdif1_disp: port@0 {
					reg = <0>;

					lcdif_to_dsim: endpoint {
						remote-endpoint = <&dsim_from_lcdif>;
					};
				};
			};

But I'm still not getting my secondary LCD working on the inmate cell, also when I enable lcdif1, the primary LCD screen (which belongs to the root cell ) goes down as soon as I start inmate cell.

How do properly configure LCDIF1 clocks in root cell and use them in inmate?

0 Kudos