LoongArch: Adjust boot & setup for 32BIT/64BIT

Adjust boot & setup for both 32BIT and 64BIT, including: efi header
definition, MAX_IO_PICS definition, kernel entry and environment setup
routines, etc.

Add a fallback path in fdt_cpu_clk_init() to avoid 0MHz in /proc/cpuinfo
if there is no valid clock freq from firmware.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
This commit is contained in:
Huacai Chen
2025-12-08 18:09:17 +08:00
parent 708ed32c84
commit 7b2afeafaf
8 changed files with 43 additions and 27 deletions

View File

@@ -72,9 +72,12 @@ static int __init fdt_cpu_clk_init(void)
clk = of_clk_get(np, 0);
of_node_put(np);
cpu_clock_freq = 200 * 1000 * 1000;
if (IS_ERR(clk))
if (IS_ERR(clk)) {
pr_warn("No valid CPU clock freq, assume 200MHz.\n");
return -ENODEV;
}
cpu_clock_freq = clk_get_rate(clk);
clk_put(clk);