Thread (69 messages) 69 messages, 11 authors, 2024-04-17

Re: [RFC PATCH v2 29/31] kvx: Add support for cpuinfo

From: Krzysztof Kozlowski <hidden>
Date: 2023-01-22 11:57:18
Also in: bpf, linux-arch, linux-doc, linux-mm, linux-riscv, lkml

On 20/01/2023 15:10, Yann Sionneau wrote:
+static int __init setup_cpuinfo(void)
+{
+	int cpu;
+	struct clk *clk;
+	unsigned long cpu_freq = 1000000000;
+	struct device_node *node = of_get_cpu_node(0, NULL);
+
+	clk = of_clk_get(node, 0);
+	if (IS_ERR(clk)) {
+		printk(KERN_WARNING
+		       "Device tree missing CPU 'clock' parameter. Assuming frequency is 1GHZ");
+		goto setup_cpu_freq;
+	}
+
+	cpu_freq = clk_get_rate(clk);
What about cpufreq? I don't think this is useful.

Best regards,
Krzysztof
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help