MCO2 issue (OSD32MP1-BRK)

Forums Devices OSD32MP15x MCO2 issue (OSD32MP1-BRK)

Viewing 3 reply threads
  • Author
    Posts
    • #11325
      Sylvain BourréSylvainB
      Participant

        Hi,

        I’m trying to enable MCO2 (to PA14) on the OSD32MP1-BRK board to ouptut the HSE clock.

        I get 24MHz as expected however Linux does not boot anymore (“Starting Kernel …” then nothing but a watchdog reboot 32s later).
        If I use the original kernel dts, Linux boots OK but MCO2 gets disabled during the Linux startup.

        Find attached “git diff” against DT files in the repository.

        I’m using dunfell branch softwares (TF-A 2.2 + u-boot 2020.01 + Linux Kernel 5.4.56).

        Please advise !

        Thanks,
        Sylvain.

      • #11326
        Sylvain BourréSylvainB
        Participant

          As the .txt file got rejected, here is a gzipped version

        • #11336
          Eshtaartha Basu
          Moderator

            Hello SylvainB,

            This is a known bug. Two potential workarounds are given below. The examples below are for MCO1 through pin PA8. Please adopt them suitably for your use case:

            Declare PA14 as gpio under the peripheral node that is supposed to use it (Note: If PA14 is declared under RCC node in your device tree, remove the declaration and declare it under peripheral node only).

            Below is an example of pin PA8 (MCO1) being bound to camera module OV5640 (adopt it suitably for your use case):

            &i2c5{

            pinctrl-names = “default”, “sleep”;

            pinctrl-0 = <&i2c5_pins_mx>;

            pinctrl-1 = <&i2c5_sleep_pins_mx>;

            status = “okay”;

            / USER CODE BEGIN i2c5 /

            clock-frequency = <400000>;

            i2c-scl-rising-time-ns = <185>;

            i2c-scl-falling-time-ns = <20>;

            /delete-property/ dmas;

            /delete-property/ dma-names;

            ov5640:camera@3c{

            compatible = “ovti,ov5640”;

            pinctrl-names = “default”, “sleep”;
            pinctrl-0 = <&rcc_mco1_pin>;
            pinctrl-1 = <&rcc_mco1_sleep_pin>;
            reg = <0x3c>;
            clocks = <&rcc CK_MCO1>;
            clock-names = “xclk”;
            ….

            }

            };

            Alternatively, you could also modify the following in clk-stm32mp1.c (search for this line, add CLK_IS_CRITICAL like below):

            COMPOSITE(CK_MCO1, “ck_mco1”, mco1_src, CLK_IS_CRITICAL | CLK_OPS_PARENT_ENABLE |
            CLK_SET_RATE_NO_REPARENT,
            _GATE(RCC_MCO1CFGR, 12, 0),
            _MUX(RCC_MCO1CFGR, 0, 3, 0),
            _DIV(RCC_MCO1CFGR, 4, 4, 0, NULL)),

            In the device tree, just the pinctrl entry should do to configure PA8 as alternate 0

          • #11341
            Sylvain BourréSylvainB
            Participant

              Thank you Eshtaartha !

              We added CLK_IS_CRITICAL to the clk driver and did not update the kernel DT so Linux is able to boot keep MCO2 running.

              My issue is solved even if it is not really convenient because CubeIDE always update the kernel DT regarding MCO configuration…

              Have a good day,
              Sylvain.

          Viewing 3 reply threads
          • You must be logged in to reply to this topic.