Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp397443lqm; Wed, 1 May 2024 04:20:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXTQKjELyQKyasEHornOM8lZ9wtDpC704aQatexWb72Nj//tltv40i1IWjYdfpCaNm2GjvpJktG/6lxPwdWORX33LMvqfj3bpz6QZbsxA== X-Google-Smtp-Source: AGHT+IH+9jtpyj2J7vVhHGnj7tRjXt6wsznau1wePmI4bm6lWOGdja1HfFU7XW8/n+du59S0mU6v X-Received: by 2002:a50:cc9b:0:b0:572:7e9f:c124 with SMTP id q27-20020a50cc9b000000b005727e9fc124mr1734634edi.9.1714562423804; Wed, 01 May 2024 04:20:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714562423; cv=pass; d=google.com; s=arc-20160816; b=u0SbUGFSCV7toYapl8YGY4wpD7/DPPmwtvvyXXvBCGVcRGPAmZLEmjrbpACyh+yXhV JfYmSRUMMbM21d7cvwHR+alI8yHc7JJGZ64C/PNhgDy/sz4B4ub9qL16jhhTHC7h/otR THagsB4rfTlQFCgc7ZbMueu68NuswWwV0l0Mq8WQJjH5zei5NiBoJEhEG57ot6dPYsRJ /w21DRAyQHsVC46qmG/6LpcJ9ax87s18sV2bkiZK3C2aUo+1MMhMSSBvlmoo+7GAhQLr tCxR2engtdY69iqcNCIEPtrVcUmGXopG/z3PxXuE1sTV189EW3wbgIjWqyNttTAvEOzO VzhQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+cNJcR4HKthr4uVQ8bZMEc3QTkCQ0VDxcnetbrScSKg=; fh=+focyH5sS/0D6Oyw3syzW7OYhHh5H+96iB2VrgIgXZE=; b=Krp5xBTd9TFLTdt9dyiF2EdApZKfk/r6JpG2l6z67hA6hB0hP0/vIunQxkY8PwAe5f 53uKqeAdqnXuqP3H0v1khUsZ9tfHTBiC9GGjtI/dk3Cnw884vxIhHB/3flcMRih2jeU1 aLZeV+tC7lXx8lQnk30OEdW4dzlCnvp9y3Ps9cp4KbrYIZyj+QeR6Hz8kY1k1iOsSQKW mDYoad0MKpyftAuTjLn1+e5v4WnjTQwGp147qdIohO3py/34nUWyhF94OmoKBqSv9yib o8Iv11v69wzI/ObHANcjfd9OZZUkg1KPWPegLtxYXaJYIaFnt6hOFxMouk6BdZl0qw9j SziQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=BVDh0Yk6; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-165180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s3-20020a056402036300b00572b0dae1c6si260847edw.645.2024.05.01.04.20.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 04:20:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=BVDh0Yk6; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-165180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 88C571F234F2 for ; Wed, 1 May 2024 11:20:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 728F660253; Wed, 1 May 2024 11:20:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="BVDh0Yk6" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D93F856B63; Wed, 1 May 2024 11:20:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714562414; cv=none; b=tRsva6PVhjY+h/qilwPURxzbjAhv4VbGKd3UhSUOVAqlchQrHuYQc0Q8LQANpnhLHNAzLTVCuJgpkAQB2ipkKBEqGntqZd17zVjie1hl3vzFiQoB/VBevf7w/IN7oqoyupj6HXkTDE7KNKfsae8n1cWyqrf5hyR6Fi7SkLO+EJU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714562414; c=relaxed/simple; bh=VdaxhUn/XM6Ym1rOWk8SQaeNn5/QJQcnrhKtg4irLf0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=m6VOpakN3EwgsCxEPuIaHJMValg5hEmmnAge1wHL+3RP+9a6oMK7Bp+r/j7NgdBfjHpDzByzfPIXLEfgMuEtKkm/XYiolL0tSKnluWM6r/NNNxLTs0EE4YQf1JDLvBZAA+GxmAGCwAbda6PH/QjnmYrM0GFrinfEluqGWUajwqE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=BVDh0Yk6; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id BFD2324000C; Wed, 1 May 2024 11:20:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714562403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+cNJcR4HKthr4uVQ8bZMEc3QTkCQ0VDxcnetbrScSKg=; b=BVDh0Yk6zShpiP0lUaFPccR0hocR9I7SgxGCP1iFeWYYv8Hjj3fFidC+tuWwRSRv7ygAHx Y0239OrhnxD0dawobTnFpggmXx2SNnDuluNCBRXuirnvhg4JvuYz4KctaDHzWErIHMpLYD fkKR9MmCCBXK7DIK0NqceuT+odWLR3bB2/70HJOaWSbMXR+o4IxeTYyFPDwoGamqe87AbO lKZI1frIGFZqDPgB94mNLtTtwVlcNfYnBSm9YJbfnvot02lfclM9UnnwSracs4zwF5QcTh olBgKp5IBR28GBPHyLOvVV2houTWn+b66Xze0nXZuuqgtM6SleFZiYxJFyVJfQ== Date: Wed, 1 May 2024 13:20:01 +0200 From: Alexandre Belloni To: Jingbao Qiu Cc: Inochi Amaoto , robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, 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, dlan@gentoo.org Subject: Re: [PATCH v8 2/2] rtc: sophgo: add rtc support for Sophgo CV1800 SoC Message-ID: <20240501112001dc47d549@mail.local> References: <20240204044143.415915-1-qiujingbao.dlmu@gmail.com> <20240204044143.415915-3-qiujingbao.dlmu@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-GND-Sasl: alexandre.belloni@bootlin.com On 01/05/2024 17:14:43+0800, Jingbao Qiu wrote: > On Wed, May 1, 2024 at 3:43 PM Inochi Amaoto wrote: > > > > On Wed, May 01, 2024 at 01:03:58PM GMT, Jingbao Qiu wrote: > > > Hi, Inochi > > > > > > On Wed, May 1, 2024 at 10:19 AM Inochi Amaoto wrote: > > > > > Another thing is that I do not think is a good way to let the > > > > rtc driver access RTC_CTRL area directly. You have already > > > > know there is a 8051 device in the 0x05025000. It is necessary > > > > to make some room for this device. Maybe you want to implement > > > > them all in the rtc driver? If so, I do think it is a bad idea. > > > > > > > > > Do you mean that RTC drivers should not directly access the 0x05025000 address? > > > Because there is an 8051 subsystem on this address. > > > > Yes. At least we need some mechanism to share these address between > > this devices. > > > > > Firstly, I do not intend to implement 8051 in the RTC driver, > > > but the 8051 subsystem is located within a module independently > > > powered by the RTC. > > > So if we want to implement the 8051 subsystem in the future, it can be > > > used as a node in RTC? I'm not sure. > > > > Yes, this is what I care about. > > > > > Then, Alexandre told me that there are operations related to PM in > > > RTC, such as the following files. > > > This matches the description of address 0x05025000. > > > > > > drivers/rtc/rtc jz4740. c > > > > > > > I do not think this is something related to the PM. 8051 is more > > like remoteproc. So it is necessary to arrange them carefully. > > > > You are right. > I learned from official documents that 8051 works in the RTC domain. > Linux does not provide relevant interfaces to operate 8051, > Just providing a mailbox for communication between them, or through > interruptions. > I don't understand how 8051 works, so I shouldn't write to the > corresponding registers in RTC. > > https://milkv.io/docs/duo/getting-started/8051core Then you will have to have a driver for the 8051 firmware before being able to access registers that are outside of the RTC range. However, I se the firmware is using RTC_INFOx without any form of locking but I guess this just means Linux will have to ensure it never writes to those. > > > > > > > 2.25.1 > > > > > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com