From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C781C021B2 for ; Sat, 22 Feb 2025 11:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YGQaZwkc3Ok05W9HiqzI8EctSVwzQCyByVbQucq+cyY=; b=OrXgOkmpWtfYHm NwfPGiqWRGVdfChENIy6lgqXHyuo/gu/8Zt5dOURY1dY1RPkkmIo27DHtS8uGFqwGMMw9b6DGOImp V//wANNzH4mv4er7AzCIqSxX3OJBB48diMa80KtubbTP2fGHNiXV9WkbYBNnIbkWeDBqS1Ldphbu1 ToLK4X46+uR3EAyCbg+E5bCbDVIguOkBI65fx9lLWDaBFZm3JPJaTV3EttrYEgUc1IlZJ9C0KXsvv KNjMB0nRXQFfsZJ5ZRyvsPhLBuRabSBYmCZhL3YHatGSIIooGxlEjHQcNU4SL5ZB6HRHtO025neAh hHdE261BjelkxuUf07kQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tlo1X-00000007wz2-2KO2; Sat, 22 Feb 2025 11:50:23 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tlo1U-00000007wyG-4BW2 for linux-riscv@lists.infradead.org; Sat, 22 Feb 2025 11:50:22 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 16FBD5C2777; Sat, 22 Feb 2025 11:49:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23507C4CED1; Sat, 22 Feb 2025 11:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740225019; bh=WHtr1zZ9a93GA1KijUCd5YYQ9Yepb+ZGhVADmwPbocI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SXBs45JIAQyCjrBLXFrXylEYrGln2xUNPbeu/mD4vEJFXqrMqWTebBpkRako/hov1 KItQno/KnBo6RrMbMozSpT7L8sN+RpMWywtbc+REHb6CMl+1ysNTRHOiY5LEHX1RDS 00ntIoyFm3VgYjFqm8Vp04Y2jzPkthHwPrUWX0deZ0uIjFX8Dtjt4kqoMBYuIgKvtU xlEwAzxTCHrii9X/eBnZT/4Co2YKCF/9SUQY8pFG3Kqw9vyTtLp+KcMVNf82X5tFQj 4IUkYYaF415Uk7xN5xKitt1Wl2YhDcnm6nq3Wi7nldFfSYXkdhTlRgvesm8RlTFjWT zRRa2L4s4ssxQ== Message-ID: <6ea8ac17-42c8-46fa-b970-77ba89de66c4@kernel.org> Date: Sat, 22 Feb 2025 12:50:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 2/4] dt-bindings: soc: spacemit: Add spacemit,k1-syscon To: Haylen Chu , Alex Elder Cc: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Haylen Chu , Yixun Lan , linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Inochi Amaoto , Chen Wang , Jisheng Zhang , Meng Zhang , Guodong Xu References: <20250103215636.19967-2-heylenay@4d2.org> <20250103215636.19967-4-heylenay@4d2.org> <19e5129b-8423-4660-8e4f-8b898214d275@kernel.org> <2ab715bd-e26c-41bb-ac64-baa864d90414@kernel.org> <7c697e9a-d6d9-4672-9738-93ce3a71beb6@riscstar.com> <4f7bf109-bf18-42be-971c-5d5edd9595b5@kernel.org> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMBCgA/AhsDBgsJCAcDAgYVCAIJCgsE FgIDAQIeAQIXgBYhB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rL7+nXG2 5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250222_035021_171173_9902AD83 X-CRM114-Status: GOOD ( 26.88 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On 22/02/2025 11:48, Haylen Chu wrote: > On Sat, Feb 22, 2025 at 10:59:09AM +0100, Krzysztof Kozlowski wrote: >> On 22/02/2025 00:40, Alex Elder wrote: >>> I have a general proposal on how to represent this, but I'd >>> like to know whether it makes sense. It might be what Krzysztof >>> is suggesting, but in any case, I hope this representation would >>> work, because it could simplify the code, and compartmentalizes >>> things. >>> >>> Part of what motivates this is that I've been looking at the >>> downstream reset code this week. It contains a large number of >>> register offset definitions identical to what's used for the >>> clock driver. The reset driver uses exactly the same registers >>> as the clock driver does. Downstream they are separate drivers, >>> but the clock driver exports a shared spinlock for both drivers >>> to use. >>> >>> These really need to be incorporated into the same driver for >>> upstream. >> >> Why? First, it is not related to the topic here at all. You can design >> drivers as you wish and still nothing to do with discussion about binding. >> Second, different subsystems justify different drivers and Linux handles >> this well already. No need for custom spinlock - regmap already does it. >> >> >>> >>> The clock code defines four distinct "units" (a term I'll use >>> from here on; there might be a better name): >>> MPMU Main Power Management Unit >>> APMU Application Power Management Unit >>> APBC APB Clock >>> APBS APB Spare >>> >>> The reset code defines some of those, but doesn't use APBS. >>> It also defines three more: >>> APBC2 Another APB Clock >>> RCPU Real-time CPU? >>> RCPU2 Another Real-time CPU >>> >>> Each of these "units" has a distinct I/O memory region that >>> contains registers that manage the clocks and reset signals. >> >> So there are children - mpmu, apmu, apbclock, apbspare, apbclock2, rcpu >> 1+2? But previous statements were saying these are intermixed? >> >> " I'll make APMU/MPMU act as a whole device" > > My reply seems somehow misleading. The statement means I will merge the > children with the syscon into one devicetree node, which applies for > both APMU and MPMU. I wasn't going to say that APMU and MPMU are > intermixed. > > As Alex said, all these units have their own distinct and separate MMIO > regions. > >>> >>> I suggest a single "k1-clocks" device be created, which has >> >> For four devices? Or for one device? > > By Alex's example, I think he means a device node taking all these > distinct MMIO regions as resource. You still do not answer about the hardware: how many devices is there? > > clock { > compatible = "spacemit,k1-clocks"; > > reg = <0x0 0xc0880000 0x0 0x2050>, > <0x0 0xc0888000 0x0 0x30>, > <0x0 0xd4015000 0x0 0x1000>, > <0x0 0xd4050000 0x0 0x209c>, > <0x0 0xd4090000 0x0 0x1000>, > <0x0 0xd4282800 0x0 0x400>, > <0x0 0xf0610000 0x0 0x20>; > reg-names = "rcpu", > "rcpu2", > "apbc", > "mpmu", > "apbs", > "apmu", > "apbc2"; > > /* ... */ > }; > >> No, it's again going to wrong direction. I already said: >> >> "You need to define what is the device here. Don't create fake nodes ust >> for your drivers. If registers are interleaved and manual says "this is >> block APMU/MPMU" then you have one device, so one node with 'reg'." >> >> So what is the device here? Can you people actually answer? >> > > I'm not sure about the apbc2, rcpu and rcpu2 regions; they aren't > related to the thread, either. For APBC, MPMU, APBS and APMU, I'm pretty > sure they're standalone blocks with distinct and separate MMIO regions, > this could be confirmed by the address mapping[1]. They were brought here to discuss for some reason. Long discussions, long emails, unrelated topics like hardware or different devices - all this is not making it easier for me to understand. Best regards, Krzysztof _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv