Linux clk子系統 3 系統呼叫流程

2021-10-25 02:37:09 字數 3373 閱讀 1018

目錄

1. clk的分類

2. 系統呼叫入口

3. leo clk初始化入口

4. of_leo_clocks_init函式leo的clk系統自定義函式

5. of_clk_init

根據clk的特點,clock framework將clock分為fixed rate、gate、devider、mux、fixed factor、composite六類,每一類clock都有相似的功能、相似的控制方式,因而可以使用相同的邏輯,統一處理,這充分體現了物件導向的思想

start_kernel--->  time_init

//arch/arm/kernel/time.c

void __init time_init(void)

else

}

在leo的移植的作業系統中,在arch/arm/mach-leo/platform_dt.c中定義machine_desc中初始化了init_time.

//arch/arm/mach-leo/platform_dt.c

static const char *faraday_dt_match __initconst = ;

dt_machine_start(faraday, "leo")

.atag_offset = 0x100,

.dt_compat = faraday_dt_match,

.smp = smp_ops(faraday_smp_ops),

.map_io = platform_map_io,

.init_time = platform_sys_timer_init,

.init_early = platform_init_early,

.init_machine = platform_init,

.restart = platform_reset,

machine_end

static void __init platform_sys_timer_init(void)

static struct of_device_id faraday_clk_match __initconst = ,

{}};

static void __init platform_clock_init(void)

/**

*driver/clk/faraday/clk-leo.c

*/static const __initconst struct of_device_id leo_clk_match = ,

, ,, ,

, ,, ,

, ,, ,

, ,, ,

, ,, ,

, ,, ,

, ,, ,

, ,, ,

, ,};void __init of_leo_clocks_init(struct device_node *n)

printk(kern_info "pll0: %4ld mhz, pll1 mclk: %4ld mhz, pll2: %4ld mhz, pll3: %4ld mhz\n",

pll0/1000/1000, pll1/1000/1000, pll2/1000/1000, pll3/1000/1000);

printk(kern_info "pll4: %4ld mhz, pll5 mclk: %4ld mhz, pll6: %4ld mhz, pll7: %4ld mhz\n",

pll4/1000/1000, pll5/1000/1000, pll6/1000/1000, pll7/1000/1000);

printk(kern_info "cpu: %ld mhz, ddr mclk: %ld mhz, hclk: %ld mhz, pclk: %ld mhz\n",

cpuclk/1000/1000, mclk/1000/1000, hclk/1000/1000, pclk/1000/1000);

printk(kern_info "spi clk: %ld mhz, ssp clk: %ldmhz, ssp_i2s clk: %ldmhz, sd clk: %ldmhz\n",

spiclk/1000/1000, sspclk/1000/1000, sspclk_i2s/1000/1000, sdclk/1000/1000);

printk(kern_info "lc clk: %ldmhz, irda: %ldmhz , gmac_ref: %ldmhz\n",

lcclk/1000/1000, irdaclk/1000/1000,gmacclk/1000/1000);

}

/**

* driver/clk/clk.c

*//**

* of_clk_init() - scan and init clock providers from the dt

* @matches: array of compatible values and init functions for providers.

* * this function scans the device tree for matching clock providers

* and calls their initialization functions. it also does it by trying

* to follow the dependencies.

*/void __init of_clk_init(const struct of_device_id *matches)

of_node_put(np);

return;

} parent->clk_init_cb = match->data;

parent->np = of_node_get(np);

list_add_tail(&parent->node, &clk_provider_list);

} while (!list_empty(&clk_provider_list))

} /*

* we didn't manage to initialize any of the

* remaining providers during the last loop, so now we

* initialize all the remaining ones unconditionally

* in case the clock parent was not mandatory

*/if (!is_init_done)

force = true;

}}

EAS 系統子系統樹

業務單元 單據轉換 編碼規則 字段許可權 函式 聯合查詢 系統引數 基礎資料型別 許可權想 查詢 查詢和表 子系統 介面 快取 驗證中心 預警。其中常用的包括 子系統 單據轉換 編碼規則 查詢 系統引數。在eas home server metas bos mdbview metas.jar和eas...

輸入子系統

驅動函式操作步驟 在初始化函式中 1.分配乙個input dev結構體 struct input dev buttons dev buttons dev input allocate device 2.設定 2.1 能產生哪類事件 set bit ev key,buttons dev evbit s...

中斷子系統

linux kernel的中斷子系統之 一 綜述 linux kernel的中斷子系統之 二 irq domain介紹 linux kernel的中斷子系統之 三 irq number和中斷描述符 linux kernel的中斷子系統之 四 high level irq event handler ...