Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp155294rdb; Tue, 16 Jan 2024 19:25:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHL9adedTFqx4sltEVUNcScH2Axi2YGNmNYDIs+FczVM6L0hpmU2ELQKCYZSL31b8ceZd8M X-Received: by 2002:a05:6214:1c45:b0:681:7706:c37e with SMTP id if5-20020a0562141c4500b006817706c37emr209327qvb.45.1705461909377; Tue, 16 Jan 2024 19:25:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705461909; cv=pass; d=google.com; s=arc-20160816; b=VFwirGgOW97ho44jYhAlVBb/6Br1CVxQNZX+RBooBTFtK/wjakkMfT4yv9ZCZAMn80 mzbu2fpMTUCVIRFphjI9bZ0ZYeoiF+eZM5BBdnOuAjTfLMwiWH5UXZHYWMDRLtKQboJh Ey+R+V4Wms/p+mdOQ6hyrslEMJqyJokwNjyRJiUxSKO6JNn6Dcwt0BhoVLQ5BWOeYy17 ptXRVbF6FMrIS7QU7BiaeklRISVV7fgXANele01LlNd09TWeQ8+Xlm7fqNFq7tFNLaZt hK9ag97K5k+d7V+SapGxSr+d+HmHaqhXJGS7gekYcv0EXaB6auqIQz1QwcalYu62oMkq en/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=hrR0tHpidkGB05XRXnhTobUQZ0agqDLMMD3A5T7XObQ=; fh=6BiYVYSAVJn+eOQZZm3G+5dMrUGWG1eublQWqkmy7tA=; b=rF0rLVBss1FweXHNvNi0+bkHMkRXnEQ2nLHDHby9gXXLBtfMc9omk+iDgGTLj+Ua64 for9h6R8nwVkmUay8i6JfYby5dmml0biNavB+egGP4Ep8SPiFx1T7vvSyJBJvPG2iid2 kcyBhhEFaPBiUfL2C/S+nZS8Pkw5i9Z9l2gMiU4npJkyGJwLw8nKkm5BgcxY7g6Vn+31 wZyKgZM8f9Rewtf68p/VfenohHbOcj8pHDNYBbaG1zmhUWl1A0j5ZUI9v6za5Q2rr2wi Vp80v52NZLlGSh9qxiQUhf57FrLMA3guND5HlopV/DzOAMKCTYuWVrHV4wetUTagadgE QC6Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nr3tdwd+; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-28499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28499-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v1-20020a0ce1c1000000b00681743f707dsi1740872qvl.138.2024.01.16.19.25.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 19:25:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nr3tdwd+; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-28499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28499-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 28DB31C24417 for ; Wed, 17 Jan 2024 03:25:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 994BD46BB; Wed, 17 Jan 2024 03:24:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nr3tdwd+" Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DF791864; Wed, 17 Jan 2024 03:24:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705461896; cv=none; b=McgRW+OhRDdwevO9hcZbz3WRFd3S0wRi5TULs1oLLni3CSiZsW/NCuVnnaYWuikGTZzt3gGk0EXmFGq+Vi9n/V3+b6CRPiSn6e6xf1WDSShIbp09AOdp0eO8K6RMWHpI7FexNRkwLmsoNwTUuAj5LMWycQvLZSQHqpjZNfeBSCY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705461896; c=relaxed/simple; bh=O6UyS1EMd2El1cJhogceDXs4CkCPSiWrYf8da+BURv4=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:MIME-Version: References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc: Content-Type:Content-Transfer-Encoding; b=Y7TArAbL9Xd174a5mAXKsKdt1bja/5rc/8ntCZd8Did8xGMn8xBovLGeQd+Y6BE6voHCQtDpTwA3e2Sl9RVIaG0UpDl8FmQmTsS3uJU+7lUpRRN33sUWwaaGVpGoQ/m51VyUCzI8q1oI7ivsxdgk2k4/tJI/1hY+WIEpbIh2Lic= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nr3tdwd+; arc=none smtp.client-ip=209.85.161.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-59505514213so4692869eaf.0; Tue, 16 Jan 2024 19:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705461894; x=1706066694; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hrR0tHpidkGB05XRXnhTobUQZ0agqDLMMD3A5T7XObQ=; b=nr3tdwd+uWj7vdRMTGMZN32aLCGnqoJBLQclPh7e1YbKFEtqTEZwrU3Z3x4Zut5ZLq nY1VLCByfWIUWNnCq8RCuhEzF8zdaVbs9SOwtOFKMYSEjR6aL1NleBKybAtW2P0rrdOi XLPFuirOz5Su4new/bhPZsuLx1T9HB4gbyhjU13ZUUr0MVhIZC0D+ztnRW34xG3FASRH YALeVZ1dW/waFUC3z8R2BrmvWtnKBSYmGGVcGo8SPk10bdiap7tVhoD9kSPHcZQWQyy9 W84Jj8kmPLHwcBAKOg42ye3a3vKUmd4m59NkA+yBGWcu41HbaGx0Gitd+FShUaqPSA/g Z8Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705461894; x=1706066694; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hrR0tHpidkGB05XRXnhTobUQZ0agqDLMMD3A5T7XObQ=; b=jfeU+s071s/hrbHE/wsYi4uwcoFjkBCQb7mU4KjHA2tcV40yI1eOOK2sEBESYPepNb 0KL+SNViVjd4oEVq400mJMq7yifiALstK3N1RJiKt/VasA/3R7bQTfEe41USOjOL5oOh W2zlAQYzClNx2YaDTz81w12JCuhOGyfyU3Cl/w4JbG2Mqjzf9SlCg+7P/b8yNjnaVPJO lDS3kJSJMZ1v7oTL2mBcBhKT7yXme+Jj85tnnTRrqcgXFRHH1I/IB9wl5LoyvIhA1pzL 8N211pthXtrZ8lJhKvFcj3OEjBu/59KWZsetAje611BMJa7gqEnho3E4lb4DNKGhG0Yx 7cbg== X-Gm-Message-State: AOJu0YxYeK0GzKnvLFpNIi3/x27AkQEWMQH/Nn0OzKJL2mmoEfD69S7W D7Wfau+TySWsGMvWnDtmlvIs62rsF1UmfQJAK5gw9drE4j2S0k4ygdaU62qXfUhlBx+CGZkf5hW VaOJMCJfbHzckyPDDS5fgHXgapG0= X-Received: by 2002:a05:6820:2a15:b0:599:27c8:d7f9 with SMTP id dr21-20020a0568202a1500b0059927c8d7f9mr76965oob.8.1705461893991; Tue, 16 Jan 2024 19:24:53 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240115160600.5444-1-qiujingbao.dlmu@gmail.com> <20240115160600.5444-4-qiujingbao.dlmu@gmail.com> <007e8c14-13eb-4917-b9da-8d47d6c965c7@linaro.org> In-Reply-To: From: Jingbao Qiu Date: Wed, 17 Jan 2024 11:24:43 +0800 Message-ID: Subject: Re: [PATCH v6 3/3] riscv: dts: sophgo: add rtc dt node for CV1800 To: Krzysztof Kozlowski Cc: alexandre.belloni@bootlin.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, chao.wei@sophgo.com, unicorn_wang@outlook.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dlan@gentoo.org, inochiama@outlook.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 17, 2024 at 12:58=E2=80=AFAM Krzysztof Kozlowski wrote: > > On 16/01/2024 17:29, Jingbao Qiu wrote: > > On Wed, Jan 17, 2024 at 12:03=E2=80=AFAM Krzysztof Kozlowski > > wrote: > >> > >> On 16/01/2024 16:51, Jingbao Qiu wrote: > >>>>> CV1800 is a RISCV based SOC that includes an RTC module. The RTC > >>>>> module has an OSC oscillator > >>>> > >>>> > >>>> I am not going to read pages of description. Please write concise re= plies. > >>> > >>> Thanks, What I mean is that this hardware includes two functions, RTC > >>> and POR. How should I describe their relationship? > >> > >> Your POR does not need to take any resources, so no need to describe a= ny > >> relationship. > >> > >> ... > >> > >>>>> Your suggestion is, firstly, the por submodule does not have any > >>>>> resources, so it should be deleted. > >>>> > >>>> So where did you delete it? I still see it in this patch. > >>> > >>> Should I completely delete him? How can a por driver obtain device in= formation? > >> > >> Delete completely. > >> > >> Device information? What is this? We already agreed you don't have any > >> resources for POR. > >> > >> .... > >> > >>>> Device is only one thing, not two. > >>>> > >>>>> reg =3D <0x5025000 0x2000>; > >>>>> interrupts =3D <17 IRQ_TYPE_LEVEL_HIGH>; > >>>>> clocks =3D <&osc>; > >>>>> }; > >>>>> However, in reality, the POR submodule does not use IRQ and CLK. > >>>>> Please do not hesitate to teach. Thanks. > >>>> > >>>> I expect one device node. How many drivers you have does not matter:= you > >>>> can instantiate 100 Linux devices in 100 Linux device drivers. > >>> > >>> I understand what you mean. A device node corresponds to multiple dri= vers. > >>> Should I completely delete the POR device tree node and add it when > >>> submitting the POR driver? > >> > >> ? I wrote it in previous messages and twice in this thread. Completely > >> delete. You do not add it back! Because if you ever intended to add it > >> back, it should be added since beginning. I don't understand what > >> submitting later would solve. > >> > >>> If that's the case, how can I explain that the rtc device tree node > >>> uses the syscon tag? > >>> How can I describe a POR device in DTS? POR is a submodule of RTC, an= d > >>> it also has corresponding drivers. > >> > >> I said, there is no need for POR in DTS, because you have nothing ther= e. > >> Why do you insist on putting it on DTS? > >> > >>> It's just that his resources are only shared with RTC's Reg. > >> > >> What resources? Reg? That's not a separate resource. > > I meant, separate from the RTC. I had impression that IO space is shared > or mixed with RTC? If it is separate, why it wasn't listed? > > > > > I'm very sorry about this. > > But I found a binding file that only contains Reg and Compatible. > > > > rtc@80920000 { > > compatible =3D "cirrus,ep9301-rtc"; > > reg =3D <0x80920000 0x100>; > > }; > > > > Link: Documentation/devicetree/bindings/rtc/cirrus,ep9301-rtc.yaml > > And? > > > > >> > >> To summarize: Drop POR from DTS and never bring it back, unless you co= me > >> with some different arguments, which you did not say already. > >> > > > > You are right, if there is no por device tree node, how can the por > > driver obtain the Reg? > > The same as currently. Does your POR node has reg? No, so according to > your logic it cannot obtain address space. > > Children Linux devices share regmap with parent device. > Thanks, Power-On-Reset/POR driver requires Reg to complete its functions. The compatible of POR is required in DTS to load the corresponding driver. The POR driver was not submitted in the patch. However, this patch requires the addition of RTC in DTS. Considering the future addition of POR driver, I added a POR node. I'm not sure why the POR node needs to be deleted, just because it only has the compatible attribute? Or maybe it's because I didn't submit the POR driver, so I need to delete the POR node. I found an example. st: timer@fffffd00 { compatible =3D "atmel,at91rm9200-st", "syscon", "simple-mfd"; reg =3D <0xfffffd00 0x100>; interrupts =3D <1 IRQ_TYPE_LEVEL_HIGH 7>; clocks =3D <&slow_xtal>; watchdog { compatible =3D "atmel,at91rm9200-wdt"; }; }; Link:arch/arm/boot/dts/microchip/at91rm9200.dtsi:114 Like this, when the por driver insmod is activated, the por driver can obtain the regs of the parent device. Thank you again. Best regards, Jingbao Qiu