All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yao Zi <ziyao@disroot.org>
To: Huacai Chen <chenhuacai@loongson.cn>,
	Arnd Bergmann <arnd@arndb.de>,
	Huacai Chen <chenhuacai@kernel.org>,
	Huacai Chen <chenhuacai@kernel.org>,
	f@disroot.org
Cc: loongarch@lists.linux.dev, linux-arch@vger.kernel.org,
	Xuefeng Li <lixuefeng@loongson.cn>, Guo Ren <guoren@kernel.org>,
	Xuerui Wang <kernel@xen0n.name>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 04/14] LoongArch: Adjust boot & setup for 32BIT/64BIT
Date: Tue, 18 Nov 2025 17:09:00 +0000	[thread overview]
Message-ID: <aRyoLBjD_8Hz91DV@pie> (raw)
In-Reply-To: <20251118112728.571869-5-chenhuacai@loongson.cn>

On Tue, Nov 18, 2025 at 07:27:18PM +0800, Huacai Chen wrote:
> Adjust boot & setup for both 32BIT and 64BIT, including: efi header
> definition, MAX_IO_PICS definition, kernel entry and environment setup
> routines, etc.
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> ---
>  arch/loongarch/include/asm/addrspace.h |  2 +-
>  arch/loongarch/include/asm/irq.h       |  5 ++++
>  arch/loongarch/kernel/efi-header.S     |  4 +++
>  arch/loongarch/kernel/efi.c            |  4 ++-
>  arch/loongarch/kernel/env.c            |  9 ++++--
>  arch/loongarch/kernel/head.S           | 39 +++++++++++---------------
>  arch/loongarch/kernel/relocate.c       |  9 +++++-
>  7 files changed, 45 insertions(+), 27 deletions(-)
> 

...

> diff --git a/arch/loongarch/kernel/env.c b/arch/loongarch/kernel/env.c
> index 23bd5ae2212c..3e8a25eb901b 100644
> --- a/arch/loongarch/kernel/env.c
> +++ b/arch/loongarch/kernel/env.c
> @@ -68,18 +68,23 @@ static int __init fdt_cpu_clk_init(void)
>  
>  	np = of_get_cpu_node(0, NULL);
>  	if (!np)
> -		return -ENODEV;
> +		goto fallback;
>  
>  	clk = of_clk_get(np, 0);
>  	of_node_put(np);
>  
>  	if (IS_ERR(clk))
> -		return -ENODEV;
> +		goto fallback;
>  
>  	cpu_clock_freq = clk_get_rate(clk);
>  	clk_put(clk);
>  
>  	return 0;
> +
> +fallback:
> +	cpu_clock_freq = 200 * 1000 * 1000;

Why pick 200MHz here? And shouldn't the clock being always provided in
devicetree if it's necessary for kernel to function?

Per the schema for LoongArch CPUs (loongarch/cpus.yaml), "clocks"
property is also described as mandantory, thus I don't think such
fallback makes sense.

> +
> +	return -ENODEV;
>  }
>  late_initcall(fdt_cpu_clk_init);

Best regards,
Yao Zi

  reply	other threads:[~2025-11-18 17:09 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-18 11:27 [PATCH V2 00/14] LoongArch: Add basic LoongArch32 support Huacai Chen
2025-11-18 11:27 ` [PATCH V2 01/14] LoongArch: Add atomic operations for 32BIT/64BIT Huacai Chen
2025-11-18 11:27 ` [PATCH V2 02/14] LoongArch: Add adaptive CSR accessors " Huacai Chen
2025-11-18 11:27 ` [PATCH V2 03/14] LoongArch: Adjust common macro definitions " Huacai Chen
2025-11-18 11:27 ` [PATCH V2 04/14] LoongArch: Adjust boot & setup " Huacai Chen
2025-11-18 17:09   ` Yao Zi [this message]
2025-11-19  4:28     ` Huacai Chen
2025-11-19  6:03       ` Jiaxun Yang
2025-11-19  7:51         ` Huacai Chen
2025-11-19 14:28           ` Yao Zi
2025-11-19 14:43             ` Huacai Chen
2025-11-18 11:27 ` [PATCH V2 05/14] LoongArch: Adjust memory management " Huacai Chen
2025-11-18 11:27 ` [PATCH V2 06/14] LoongArch: Adjust process " Huacai Chen
2025-11-18 11:27 ` [PATCH V2 07/14] LoongArch: Adjust time routines " Huacai Chen
2025-11-18 11:27 ` [PATCH V2 08/14] LoongArch: Adjust module loader " Huacai Chen
2025-11-18 11:27 ` [PATCH V2 09/14] LoongArch: Adjust system call " Huacai Chen
2025-11-20 10:40   ` WANG Xuerui
2025-11-20 12:05     ` Huacai Chen
2025-11-18 11:27 ` [PATCH V2 10/14] LoongArch: Adjust user accessors " Huacai Chen
2025-11-18 11:27 ` [PATCH V2 11/14] LoongArch: Adjust misc routines " Huacai Chen
2025-11-20 10:45   ` WANG Xuerui
2025-11-20 12:04     ` Huacai Chen
2025-11-18 11:27 ` [PATCH V2 12/14] LoongArch: Adjust VDSO/VSYSCALL " Huacai Chen
2025-11-18 13:41   ` Arnd Bergmann
2025-11-18 14:34     ` Huacai Chen
2025-11-18 11:27 ` [PATCH V2 13/14] LoongArch: Adjust default config files " Huacai Chen
2025-11-18 13:45   ` Arnd Bergmann
2025-11-19  8:01     ` Huacai Chen
2025-11-19  8:13       ` Arnd Bergmann
2025-11-19 14:13         ` Huacai Chen
2025-11-20  8:11   ` Thomas Weißschuh
2025-11-20  8:16     ` Huacai Chen
2025-11-20  8:26       ` Thomas Weißschuh
2025-11-20  8:54         ` Huacai Chen
2025-11-18 11:27 ` [PATCH V2 14/14] LoongArch: Adjust build infrastructure " Huacai Chen
2025-11-18 14:07 ` [PATCH V2 00/14] LoongArch: Add basic LoongArch32 support Arnd Bergmann
2025-11-18 14:30   ` Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aRyoLBjD_8Hz91DV@pie \
    --to=ziyao@disroot.org \
    --cc=arnd@arndb.de \
    --cc=chenhuacai@kernel.org \
    --cc=chenhuacai@loongson.cn \
    --cc=f@disroot.org \
    --cc=guoren@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kernel@xen0n.name \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=loongarch@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.