mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rong Zhang" <rongrong@oss.cipunited.com>
To: "Keguang Zhang" <keguang.zhang@gmail.com>,
	 "Wim Van Sebroeck" <wim@linux-watchdog.org>,
	 "Guenter Roeck" <linux@roeck-us.net>,
	"Rob Herring" <robh@kernel.org>,
	 "Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	 "Conor Dooley" <conor+dt@kernel.org>,
	 "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>
Cc: "Rong Zhang" <i@rong.moe>, "Yao Zi" <me@ziyao.cc>,
	 "Icenowy Zheng" <uwu@icenowy.me>,
	 "Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	<linux-mips@vger.kernel.org>,  <linux-watchdog@vger.kernel.org>,
	<devicetree@vger.kernel.org>,  <linux-kernel@vger.kernel.org>,
	 "Rong Zhang" <rongrong@oss.cipunited.com>
Subject: [PATCH v2 2/8] MIPS: Loongson64: env: Don't warn if UART has clocks node when fixing up FDT
Date: Fri, 13 Nov 2026 18:51:09 +0800	[thread overview]
Message-ID: <20261113-mips-ls7a-wdt-v2-2-e8abd6b2f77c@oss.cipunited.com> (raw)
In-Reply-To: <20261113-mips-ls7a-wdt-v2-0-e8abd6b2f77c@oss.cipunited.com>

A UART with clocks node cannot (and doesn't need to) be fixed up.

The fixup is solely for the case in which the UART use a dedicated clock
source on board (say, a crystal oscillator). IOW, when a UART has a
valid clocks node, it should use an internal clock source that is either
nonconfigurable by the board manufacturer, or retrievable by software.

When fixing up FDT using UART information from LEFI, don't warn if a
UART has a valid clocks node.

Signed-off-by: Rong Zhang <rongrong@oss.cipunited.com>
---
Currently no Loongson64 platform has such UART nodes, so this is not a
fix. Later changes will convert some nodes and depends on this.
---
 arch/mips/loongson64/env.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/mips/loongson64/env.c b/arch/mips/loongson64/env.c
index 7abcca7ab4ed..8135d50c777e 100644
--- a/arch/mips/loongson64/env.c
+++ b/arch/mips/loongson64/env.c
@@ -73,6 +73,12 @@ static int __init lefi_fixup_fdt_serial(void *fdt, u64 uart_addr, u32 uart_clk)
 		if (!reg || len <= 8 || fdt64_ld(reg) != uart_addr)
 			continue;
 
+		if (fdt_getprop(fdt, node, "clocks", &len) && len >= 4) {
+			/* The UART cannot (and doesn't need to) be fixed up. */
+			pr_devel("UART 0x%llx has clocks property\n", uart_addr);
+			return 0;
+		}
+
 		clk = fdt_getprop_w(fdt, node, "clock-frequency", &len);
 		if (!clk) {
 			pr_warn("UART 0x%llx misses clock-frequency property\n",

-- 
2.55.0

  parent reply	other threads:[~2026-11-13 10:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 10:51 [PATCH v2 0/8] watchdog: loongson1: Add Loongson-7A watchdog support Rong Zhang
2026-11-13 10:51 ` [PATCH v2 1/8] dt-bindings: watchdog: loongson,ls1x-wdt: Add compatible for Loongson-7A Rong Zhang
2026-11-13 17:17   ` Conor Dooley
2026-11-13 10:51 ` Rong Zhang [this message]
2026-11-13 10:51 ` [PATCH v2 3/8] MIPS: Loongson64: dts: ls7a-pch: Add missing #address-cells to interrupt controllers Rong Zhang
2026-11-13 10:51 ` [PATCH v2 4/8] MIPS: Loongson64: dts: ls7a-pch: Use hex in ranges and reg properties Rong Zhang
2026-11-13 10:51 ` [PATCH v2 5/8] MIPS: Loongson64: dts: ls7a-pch: Add miscellaneous clock node Rong Zhang
2026-11-13 10:51 ` [PATCH v2 6/8] MIPS: Loongson64: dts: ls7a-pch: Bind UART nodes to miscellaneous clock Rong Zhang
2026-11-13 10:51 ` [PATCH v2 7/8] MIPS: Loongson64: dts: ls7a-pch: Add watchdog node Rong Zhang
2026-11-13 10:51 ` [PATCH v2 8/8] MIPS: loongson3_defconfig: Enable LOONGSON1_WDT by default Rong Zhang

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=20261113-mips-ls7a-wdt-v2-2-e8abd6b2f77c@oss.cipunited.com \
    --to=rongrong@oss.cipunited.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=i@rong.moe \
    --cc=jiaxun.yang@flygoat.com \
    --cc=keguang.zhang@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=me@ziyao.cc \
    --cc=robh@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=uwu@icenowy.me \
    --cc=wim@linux-watchdog.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®