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 11CBFCEBF89 for ; Fri, 27 Sep 2024 09:01:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=L+nFUwTG8TeeWwku7cS7rWiWP38oV+D+0z+Xf1wWA7E=; b=ruuLzpbMwIXiIfaykzhqPI1eM4 nkGP7mcK+u7RiOiez4KvmiLv6kIxi9R+1uc6fl9ZJFV92rnDrGFRuFnPi3cKysyCOwteEf/t4nSpM y/PQ2n9edR/FIZxQNgQDRaY9J/eSK0v90i4+bgDI1pp/dXG/qG67w0Y7JIJ3lSyPxPT2FP2hhNywS mKgxtIS391NjOyVvn6QCUjne93TUzL0eARg/HSka3/1fAe1tb7qXFFt84Zb6zLT03NfIARVxGk8pS YoD+ex7Zo1yjBJdnH/RVj/NnOCG+hAsk71tk4xeVGPlCVk/gHtgKJukowkjHOfYlP7QitRHSTZJAl FsSOhcgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1su6qM-0000000Ab9Y-3aZn; Fri, 27 Sep 2024 09:00:54 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1su5qb-0000000APge-1Ufd for linux-arm-kernel@lists.infradead.org; Fri, 27 Sep 2024 07:57:42 +0000 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5c8856e3e99so5858a12.3 for ; Fri, 27 Sep 2024 00:57:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727423823; x=1728028623; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=L+nFUwTG8TeeWwku7cS7rWiWP38oV+D+0z+Xf1wWA7E=; b=I4acg6qxV/UXCYti1VZ+JILXXKqcOgimi0kw7+IA+hCFmSQ3Wli1vLcM9EHYBUQkWf udWxsEZsFvCWpeKDOsqkxbNKfpuZoRl+SQzWRpwoz/yNtx0bg3QHOYtDKAVLbnWvYjC7 n5QUOSmU/B8SOqcr7XcELEArKBaZm8wychhI9yfiidjEcPW9iZB/J44JC2pqQB85/bXv f4ehRswswSmoR02yo5hZiU3OY63oM2zmDmiyX4eGD9IVBboWx+obmCD9D1Bs/7CV65qT 8Wo8zOBr095D7OnE9nPgT0naAzgbzRGGpB8CuJwLntUowUxhPXIzxSlj+G9A560CTxSJ W96w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727423823; x=1728028623; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=L+nFUwTG8TeeWwku7cS7rWiWP38oV+D+0z+Xf1wWA7E=; b=isSdl2WG0Fbjx72GQwlaNCBt7zx+NF0hRZk9XmfTO1wULcEksNMVaRfVw/SwVFqCVC 2lEwvbarAxKKR+tluyVSJ96u86ZZXyGtudxoAuobr3iYbDcdAdqEEIVZXYkqTm3NVmEM H2mT9NWxXFusuGrAbmei3dXKf8p7B/8LmZkxuySG4alRzTyBnOtnzhtO4nKQa2ShNmkW /7Bv5t41xFDbhBfdp2qYetN4XCMK38eE4R4Lp/tpPX6C1x5dMmROLF5ForlaEcNt+q4U dg5HptaXPqkprJ+vb1VamQ2qa28T5UvAM+Jy+9gwhelTKsUjNzzIt68tSY/IzzInAeyH mePA== X-Forwarded-Encrypted: i=1; AJvYcCWBinUxEEoWrY/q5PHESAvm30qZg6YmVZKjP4WFow2xv49X7vrFdQX1sJezz9gN523Hsk0hIur5VnU3uvZLADHj@lists.infradead.org X-Gm-Message-State: AOJu0YzSCvfboGM7hMAo3RpCTkMT3RLLTciqxCztn/CJ+nFj9HVWXDBr suEEXzvvdAc261Xuk+PM88aAEOc6CueMv60UAjOSZyY+Hg14REdeZE3iy2ybGNA= X-Google-Smtp-Source: AGHT+IFi7rOXtdUqAxhUetMwe8gtb6a/xV9ZXm9g63edqmUl5elGNWyp7G8/RmAbdH72cxyAjilTug== X-Received: by 2002:a17:907:1c8b:b0:a8d:2623:dd19 with SMTP id a640c23a62f3a-a93c4ade9bcmr88134366b.14.1727423823198; Fri, 27 Sep 2024 00:57:03 -0700 (PDT) Received: from [192.168.0.18] (78-11-220-99.static.ip.netia.com.pl. [78.11.220.99]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c294747asm96048666b.107.2024.09.27.00.57.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Sep 2024 00:57:02 -0700 (PDT) Message-ID: Date: Fri, 27 Sep 2024 09:57:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/5] dt-bindings: remoteproc: sse710: Add the External Systems remote processors To: Abdellatif El Khlifi Cc: mathieu.poirier@linaro.org, Adam.Johnston@arm.com, Hugues.KambaMpiana@arm.com, Drew.Reed@arm.com, andersson@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, liviu.dudau@arm.com, lpieralisi@kernel.org, robh@kernel.org, sudeep.holla@arm.com, robin.murphy@arm.com References: <20240919093517.GA43740@e130802.arm.com> <222b3b11-151a-4ad0-91ea-54ae8f280bcb@kernel.org> <20240919145741.GA7940@e130802.arm.com> <85a223e9-05a4-4034-87a5-57d3eb9409b7@kernel.org> <20240920141958.GA288724@e130802.arm.com> <7784248d-4372-4cf1-a01a-5b731b3f6b96@kernel.org> <20240920163851.GA385919@e130802.arm.com> <20240923114945.GA133670@e130802.arm.com> <20240923171948.GA348509@e130802.arm.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzysztof.kozlowski@linaro.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/BIfXXfC68nMp9BZoy3So4Zs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ybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <20240923171948.GA348509@e130802.arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240927_005705_469023_CFE54A4A X-CRM114-Status: GOOD ( 48.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 23/09/2024 19:19, Abdellatif El Khlifi wrote: >>> >>> The Host Base System Control [3] is the big block containing various functionalities (MMIO registers). >>> Among the functionalities, the two remote cores registers (aka External system 0 and 1). >>> The remote cores have two registers each. >>> >>> 1/ In the v1 patchset, a valid point was made by the community: >>> >>> Right now it seems somewhat tenuous to describe two consecutive >>> 32-bit registers as separate "reg" entries, but *maybe* it's OK if that's >> >> ARM is not special, neither this hardware is. Therefore: >> 1. Each register as reg: nope, for obvious reasons. >> 2. One device for entire syscon: quite common, why do you think it is >> somehow odd? >> 3. If you quote other person, please provide the lore link, so I won't >> spend useless 5 minutes to find who said that or if it was even said... > > Please have a look at this lore link [1]. The idea is to add syscon > and regmap support which I did in the v2 patchset. > > [1]: https://lore.kernel.org/all/ZfMVcQsmgQUXXcef@bogus/ There is nothing there about DT bindings. We do not talk here about drivers. MFD and regmap are Linux driver stuff, not bindings. I said nothing about not using MFD, regmap or whatever driver stuff you want. We talk *only* about bindings. Syscon is mentioned there but I am sorry - that quite a stretch to call a block syscon just because you want regmap. > >> >>> all there ever is. However if it's actually going to end up needing several >>> more additional MMIO and/or memory regions for other functionality, then >>> describing each register and location individually is liable to get >>> unmanageable really fast, and a higher-level functional grouping (e.g. these >>> reset-related registers together as a single 8-byte region) would likely be >>> a better design. >>> >>> The Exernal system registers are part of a bigger block with other functionality in place. >>> MFD/syscon might be better way to use these registers. You never know in >>> future you might want to use another set of 2-4 registers with a different >>> functionality in another driver. >>> >>> I would see if it makes sense to put together a single binding for >>> this "Host Base System Control" register (not sure what exactly that means). >>> Use MFD/regmap you access parts of this block. The remoteproc driver can >>> then be semi-generic (meaning applicable to group of similar platforms) >>> based on the platform compatible and use this regmap to provide the >>> functionality needed. >> >> I don't understand how this lengthy semi-quote answers my concerns. >> Please write concise points as arguments to my questions. >> >> For example, I don't care what your remote proc driver does and it >> should not matter in the terms of this binding. > > I just wanted to show why we are using syscon based on the arguments > of other reviewers. > >> >>> >>> 2/ There are many examples in the kernel that use syscon as a parent node of >>> child nodes for devices located at an offset from the syscon base address. >>> Please see these two examples [1][2]. I'm trying to follow a similar design if that >>> makes sense. >> >> Yeah, for separate devices. If you have two words without any resources, >> I claim you might not have here any separate devices or "not separate >> enough", because all this is somehow fluid. Remote core sounds like >> separate device, but all your arguments about need of extid which cannot >> be used in reg does not support this case. >> >> The example in the binding is also not complete - missing rest of >> devices - which does not help. > > Here I would like to explain the current suggestion and suggest an alternative solution. > > 1/ For more clarity, here is a complete example of use of both remote cores > at the same time: > > syscon@1a010000 { > compatible = "arm,sse710-host-base-sysctrl", "simple-mfd", "syscon"; > reg = <0x1a010000 0x1000>; > > #address-cells = <1>; > #size-cells = <1>; > > remoteproc@310 { > compatible = "arm,sse710-extsys0"; > reg = <0x310 8>; > firmware-name = "es0_flashfw.elf"; > mboxes = <&mhu0_hes0 0 1>, <&mhu0_es0h 0 1>; > mbox-names = "txes0", "rxes0"; > memory-region = <&extsys0_vring0>, <&extsys0_vring1>; > }; > > remoteproc@318 { > compatible = "arm,sse710-extsys1"; > reg = <0x318 8>; > firmware-name = "es1_flashfw.elf"; > mboxes = <&mhu0_hes1 0 1>, <&mhu0_es1h 0 1>; > mbox-names = "txes0", "rxes0"; > memory-region = <&extsys1_vring0>, <&extsys1_vring1>; > }; > }; > > Here we have 2 cores, each one have 2 registers mapped respectively > at 0x1a010310 and 0x1a010318. All this looks fine, resources are indeed reasonable, except that I still do not understand why do you need to call them 0 and 1 (now via compatible). Your driver code shows this nicely - it is entirely redundant! The 'reg' - so the base - is already there! You just duplicate it with the extsys_id, instead of relying on the base. So think what is the point of 'reg' property if you do not use it? > > Definetly these cores have seperate HW resources associated with them > which are the MHUs (mailboxes HW). There are 2 pairs of MHUs associated > with each core. These mailbox peripherals are obviously seperate. > Furthermore, the vring buffers used for communication are seperate. > > Moreover, the remote cores are independent. They are not SMP cores of one processor. > > They can have different default firmware to use. In this example es0_flashfw.elf > and es1_flashfw.elf > > The current HW implementation (Corstone-1000) provides one remote core only. > However, the second core control registers are at 0x1a010318 do exist. > > Support for a second core is taken into consideration in this work to help > end users who want to add a second core to their HW. > > 2/ Here I'm suggesting an alternative solution by using one remoteproc node for both cores as > follows: > > syscon@1a010000 { > compatible = "arm,sse710-host-base-sysctrl", "simple-mfd", "syscon"; > reg = <0x1a010000 0x1000>; > > remoteproc { > compatible = "arm,sse710-extsys"; > firmware-name = "es0_flashfw.elf"; > mboxes = <&mhu0_hes0 0 1>, <&mhu0_es0h 0 1>, <&mhu0_hes1 0 1>, <&mhu0_es1h 0 1>; > mbox-names = "txes0", "rxes0", "txes1", "rxes1"; > memory-region = <&extsys0_vring0>, <&extsys0_vring1>, <&extsys1_vring0>, <&extsys1_vring1>; > }; > }; > > Does this meet your expectations please ? > >> >>> >>> 3/ Since there are two registers for each remote core. I'm suggesting to set the >>> size in the reg property to 8. >> >> How is this related? >> >>> The driver will read the match data to get the right >>> offset to be used with regmap APIs. >> >> Sorry, no talks about driver. Don't care, at least in this context. >> >> You can completely omit address space from children in DT and everything >> will work fine and look fine from bindings point of view. >> >>> >>> Suggested nodes: >>> >>> >>> syscon@1a010000 { >>> compatible = "arm,sse710-host-base-sysctrl", "simple-mfd", "syscon"; >>> reg = <0x1a010000 0x1000>; >>> >>> #address-cells = <1>; >>> #size-cells = <1>; >>> >>> remoteproc@310 { >>> compatible = "arm,sse710-extsys0"; >>> reg = <0x310 8>; >>> firmware-name = "es_flashfw.elf"; >>> mboxes = <&mhu0_hes0 0 1>, <&mhu0_es0h 0 1>; >>> mbox-names = "txes0", "rxes0"; >>> memory-region = <&extsys0_vring0>, <&extsys0_vring1>; >>> }; >>> >>> remoteproc@318 { >>> compatible = "arm,sse710-extsys1"; >>> reg = <0x318 8>; >>> firmware-name = "es_flashfw.elf"; >> >> Same firmware? Always or only depends? > > The firmware of the second core depends on the end user choice. > Currently the second core is not implemented in the HW. > Users who want to tweak Corstone-1000 HW can add > a second core. Two cores make more sense in such case. Best regards, Krzysztof