0

Zynq SoCの周辺機器用に同様のドライバーを開発するために、devfreq電源管理で使用されるexynos4_bus.cドライバーを調べています。私が心配している方法はこれです:

static int exynos4210_set_busclk(struct busfreq_data *data, struct opp *opp)
{
        ...
        __raw_writel(tmp, EXYNOS4_CLKDIV_DMC0);
        ...

}

raw_writelExynosクロックレジスタに、実行すべき周波数を書き込んでいるように見えます。このレジスタはで定義されていarch/arm/mach-exynos/include/mach/regs-clock.hます。現在arch\arm\mach-zynq\include\mach\zynq_soc.h、Zynqのセットアップに相当するものを探していますが、定義されているクロックがかなりあるため、どちらを設定すべきかわかりません。誰か助けてもらえますか?

4

2 に答える 2

1

Zynqはカーネルクロックフレームワークを使用します。

宣言を含める:

#include <linux/clk.h>

名前で、必要な時計のハンドルを取得します。

struct clk *fclk = clk_get_sys("FPGA0", NULL);
long requested_rate = 125000000;

最も近いサポートされている周波数を見つけます。

long actual_rate = clk_round_rate(fclk, requested_rate);

次に、クロックレートを設定します。

 int status;
    if ((status = clk_set_rate(fclk, actual_rate))) {
        printk(KERN_INFO "[%s:%d] err\n", __FUNCTION__, __LINE__);
        return status;
    }
于 2014-05-23T13:30:36.300 に答える
0

You can change the Zynq FCLK directly by its register. The easiest way to test it is to write to the address directly using devmem from busybox.

The name of the register is FPGA0_CLK_CTRL for the FCLK_CLK0 Zynq output. A possible solution to get the address is opening SDK and open the ps7_init.html and search the register.

Bit 0-7 selects the clock source (0x00 for IO_PLL, 0x20 ARM_PLL, 0x30 DDR_PLL)

Bit 8-15 is the first divisor

Bit 16-19 is reserved

Bit 20-25 is the second divisor

Example: for my Zynq-7000 I want to have 28MHz so I have DIV0=36, DIV1=1 and want to use the IO_PLL.You can get the values in the Zynq block by setting the corresponding FCLK in the Clock Configuration section and look in the Advanced Clocking tab. The command to set this in Linux would be "devmem 0xF8000170 32 0x002401".

于 2018-05-08T10:45:48.530 に答える