Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8093

Compute Module • Re: CM5 external PCIe to FPGA for audio

$
0
0
I found the source for the ALSA and designware c files, they call a function called clk_set_rate but I cannot find any implementation of this function. Any hint as to how this is done and where the source for this is? I presume there is some information sent over the PCIe interface but I can't find out how this is done, or find the source code in the driver that does this.
For any kernel function that will be present in the mainline kernel (not a Raspberry Pi specific change), using elixir.bootlin.com is the quickest route to search for it. (If it is a Pi specific change, then using "git grep <search term>" in a checkout of the source tree is generally pretty swift).

In this case https://elixir.bootlin.com/linux/v6.12. ... lk.c#L2575

The clock framework will follow the defined clock and request the desired frequency.
For RP1 you'll find the clock defined via device tree in https://github.com/raspberrypi/linux/bl ... .dtsi#L417

Code:

rp1_i2s0: i2s@a0000 {reg = <0xc0 0x400a0000  0x0 0x1000>;compatible = "snps,designware-i2s";// Providing an interrupt disables DMA// interrupts = <RP1_INT_I2S0 IRQ_TYPE_LEVEL_HIGH>;clocks = <&rp1_clocks RP1_CLK_I2S>;clock-names = "i2sclk";#sound-dai-cells = <0>;dmas = <&rp1_dma RP1_DMA_I2S0_TX>,<&rp1_dma RP1_DMA_I2S0_RX>;dma-names = "tx", "rx";dma-maxburst = <4>;status = "disabled";};rp1_i2s1: i2s@a4000 {reg = <0xc0 0x400a4000  0x0 0x1000>;compatible = "snps,designware-i2s";// Providing an interrupt disables DMA// interrupts = <RP1_INT_I2S1 IRQ_TYPE_LEVEL_HIGH>;clocks = <&rp1_clocks RP1_CLK_I2S>;clock-names = "i2sclk";#sound-dai-cells = <0>;dmas = <&rp1_dma RP1_DMA_I2S1_TX>,<&rp1_dma RP1_DMA_I2S1_RX>;dma-names = "tx", "rx";dma-maxburst = <4>;status = "disabled";};rp1_i2s2: i2s@a8000 {reg = <0xc0 0x400a8000  0x0 0x1000>;compatible = "snps,designware-i2s";// Providing an interrupt disables DMA// interrupts = <RP1_INT_I2S2 IRQ_TYPE_LEVEL_HIGH>;clocks = <&rp1_clocks RP1_CLK_I2S>;status = "disabled";};
So in each case they point to rp1_clocks with the ID enum of RP1_CLK_I2S

rp1_clocks is defined at https://github.com/raspberrypi/linux/bl ... si#L24-L60, and the driver is at https://github.com/raspberrypi/linux/bl ... /clk-rp1.c. It'll instruct the clock block of RP1 what clock frequency to generate.

Statistics: Posted by 6by9 — Wed Jun 25, 2025 10:16 am



Viewing all articles
Browse latest Browse all 8093

Trending Articles