CLK_OF_DECLARE(imx6ul, "fsl,imx6ul-ccm", imx6ul_clocks_init); 存在下图类似的SOC时钟描述语句: 上述语句中无论是imx_clk_mux()还是imx_clk_pllv3()都会调用clk_register()向内核注册时钟资源。 2、驱动层clk 当底层(clk-provider)设计完成后,在驱动层(也称为消费者(Consumer))则可以很方便的获取对应...
intof_clk_add_provider(structdevice_node *np,structclk *(*clk_src_get)(structof_phandle_args *args,void*data),void*data); 1.2 consumer使用时钟 其他设备需要使用时钟,可以再驱动中后去时钟也可以在设备DTS中引用时钟。 structclk *clk_get(structdevice *dev,constchar*id);structclk *devm_clk_get...
//include/linux/clk-provider.hstructclk_ops{int(*prepare)(structclk_hw*hw);void(*unprepare)(structclk_hw*hw);int(*is_prepared)(structclk_hw*hw);void(*unprepare_unused)(structclk_hw*hw);int(*enable)(structclk_hw*hw);void(*disable)(structclk_hw*hw);int(*is_enabled)(structclk_hw*h...
初始化过程中,kernel在驱动初始化阶段处理时钟,不同于CPU初始化,它在bootrom和U-Boot配置基本时钟后进行。CLK_OF_DECLARE宏用于声明初始化函数,通过它声明的函数负责配置时钟。RK3399的时钟初始化涉及cru和pmu,以cru为例,其核心初始化基于rockchip_clk_provider数据结构,通过rk3399.dtsi文件中的sysc...
CLK_OF_DECLARE(fixed_clk,"fixed-clock",of_fixed_clk_setup);struct clk*clk_register_fixed_rate(struct device*dev,constchar*name,constchar*parent_name,unsigned long flags,unsigned long fixed_rate); 2. gate clock 这一类clock只可开关(会提供.enable/.disable回调),可使用下面接口注册: ...
一、clk框架简介 linux内核中实现了一个CLK子系统,用于对上层提供各模块(例如需要时钟信号的外设,USB等)的时钟驱动接口,对下层提供具体SOC的时钟操作细节: 一般情况下,在可运行linux的处理器平台中,都存在非常复杂的时钟树(clock tree)关系,也一定会有一个非常庞大和复杂的树状图,用于描述与时钟相关的器件,以及这些...
drivers/clk/samsung/clk-s3c2410.c:437:CLK_OF_DECLARE(s3c2440_clk,"samsung,s3c2440-clock", s3c2440_clk_init); 定位到drivers/clk/samsung/clk-s3c2410.c文件: staticvoid__init s3c2440_clk_init(structdevice_node *np) { s3c2410_common_clk_init(np,0, S3C2440, NULL); ...
CLK_OF_DECLARE(fixed_clk,"fixed-clock", of_fixed_clk_setup); struct clk *clk_register_fixed_rate(struct device *dev,constchar*name, constchar*parent_name,unsignedlongflags, unsignedlongfixed_rate) ; 2. gate clock 这一类clock只可开关(会提供.enable/.disable回调),可使用下面接口注册: ...
CLK_OF_DECLARE(fixed_clk,"fixed-clock",of_fixed_clk_setup);struct clk*clk_register_fixed_rate(struct device*dev,constchar*name,constchar*parent_name,unsignedlongflags,unsignedlongfixed_rate); 1. 2. 3. 4. 2. gate clock 这一类clock只可开关(会提供.enable/.disable回调),可使用下面接口注册:...
CLK_OF_DECLARE(fixed_clk, "fixed-clock", of_fixed_clk_setup); struct clk *clk_register_fixed_rate(struct device *dev, const char *name, const char *parent_name, unsigned long flags, unsigned long fixed_rate); 2. gate clock 这一类clock只可开关(会提供.enable/.disable回调),可使用下面接...