MCLK from Hikey960 ISP_CLK0/GPIO_024 pin

96boards

#1

Hi All,

I am trying to take MCLK from Hikey960 GPIO_024 pin for my codec driver, for this I added code in dts & dtsi files.
https://archive.armlinux.org.uk/lurker/message/20170614.082323.17817b21.en.html

As per above patch,

  •    gpio24: gpio@fff0d000 { +            compatible = "arm,pl061", "arm,primecell"; +            reg = <0 0xfff0d000 0 0x1000>; +            interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>; +            gpio-controller; +            #gpio-cells = <2>; +            /* GPIO192 */ +            gpio-ranges = <&pmx4 0 13 8>; +            interrupt-controller; +            #interrupt-cells = <2>; +            clocks = <&sctrl HI3660_PCLK_AO_GPIO2>; +            **clock-names = "gpio_clk";** +        };
    

modified clock-names = “gpio_clk”, and defined gpio_clk in dts file as “clock-frequency = <19200000>”.

After build and flash on the board, but I am not getting any clock at GPIO_024 pin.

Please help me, how to proceed further.


#2

I can’t actually help you get a clock out of that pin, but I would like to discuss your project with you if that’s ok.

First of all, if you are designing a product, I would caution you to avoid using pins outside of the scope for which the 96boards CE designates those pins. The reason is because you can’t count on that pin being able to perform the same job on a different board unless that pin is designated for that specific function in the spec.

Second, unless you can guarantee that the MCLK that you drive out that pin is going to be synchronized with the BCLK, it won’t actually do you any good. In other words, the MCLK has to actually be the clock that the BCLK is divided off of, otherwise, you’re going to need to use the codec’s PLL anyway.

What are you trying to achieve? What codec are you trying to connect? Does your codec not have a decent PLL? Can your codec not use a crystal?

Most decent codec’s, for instance, the TI codecs on this; https://groupgets.com/campaigns/485-i2s-mezzanine have the capability of deriving their MCLK from the BCLK. That particular board, you will notice, also has a crystal on it, although that crystal is not actually necessary (nor do I even bother activating it for my use) – the reality is that the crystal is there so that the 3 codecs can function for the most part without the SBC, i.e. with the PCM1865 in master mode. Nor does it have any MCLK connection to the SBC. All 3 codecs (1 PCM1865 and 2 PCM5142) are able to derive their MCLK from the BCLK, however, the PCM1865 can also derive its MCLK from the crystal, and deliver that MCLK to the PCM5142’s.


#3

Thanks for your quick reply.
I CODEC driver development is done, PLL is available. Objective of this exercise is to measure the CODEC power consumption for that trying to get MCLK from HiKey96 board GPIO24 pin, I need to help to update this pin information in dts & dtsi files and i need to change the GPIO24 pin direction also, please help me, if anyone worked on GPIOs.

Thanks,


#4

Hi All,

Is there any way to provide MCLK to GPIO_024 pin to Hikey960 board,without using external OSC?
That pin is connected to ISP_CLK0/GPIO_024.

Thanks in Advance.