From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AA66D326956; Mon, 17 Nov 2025 10:41:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763376077; cv=none; b=lZhMPy2SnpkmKkf1hprvqH0vx5RhdTaOn/IeQ+UrwXfqwHwDa3Ywd8AJY9X3Ott6Hftm2i2Sc9CY1hvfgcTQqNlrqo78LNXGkMw3NeFiOzwvINRsdBzssSvqzOcpKCRyxhR/d1UCj5QZEh746Opng8HPLVgPET8RYT4kHUEVFuw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763376077; c=relaxed/simple; bh=2qPbx9mVBr3uy8j3ss2BO+2cePvtQMpugZQlpaK/bIo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qz+wzP4J5Xg68daPUenvgvx1mby6udEuRqBY+l8Z0buEk3aaddmSKrxHgJY/NVE8A56FkpVfgk8y/zFPySo8tM+ewkRD3DWLbE935bNqG24WJI+zbBn0R8X0zDNxjTkkZlVhznIoa/5x0fM/MBGDZWeCOx8URCNx16kwH9ySG1E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HHWAfKxb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HHWAfKxb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46DD4C116B1; Mon, 17 Nov 2025 10:41:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763376076; bh=2qPbx9mVBr3uy8j3ss2BO+2cePvtQMpugZQlpaK/bIo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=HHWAfKxb8rm1c4pgZb38nfg4FuY+J34nPxeZtTyhjftyeCCEFHCRSGk4UD/fuACE3 uzwULp020SbmEjTqlxKgVAG8ou6XNoWsc3r8xiHX9OUySNcN4nml7PlRlNYnVuk+xX +i/Pesb23uvdWgu2fH2ItAwO7TdDxB2ZoxZQfznBkCspwOqihmYULl9qxnhzSgB6wx Um9E+zkFWQ1rga8V4yGTOH7y3sNCErX0NC1Tpuikn79vvsGdlUWGN442bUS+4/bRwd EsZiAdvAUVz1dbobTBTM6suK9A69HCThy8poH2By3Dz4wDAMElnHl+/OIOjCwKwrZ2 a/fKlZpz27MOQ== Message-ID: Date: Mon, 17 Nov 2025 11:41:12 +0100 Precedence: bulk X-Mailing-List: devicetree-spec@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: SoC-specific device tree aliases? To: Sascha Hauer Cc: Ahmad Fatoum , "devicetree@vger.kernel.org" , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree-spec@vger.kernel.org, "kernel@pengutronix.de" , quentin.schulz@cherry.de References: <58816b68-3b09-4320-9a4e-09f2c2b2d0fa@kernel.org> <8ce701c9-6c8d-4b3e-8706-760b8aba89fc@kernel.org> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH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lXJs5/42hAXKsk+PDg3wyEFb4NpyA1v qmx7SfAzk9Hf6lWwU1O6AbqNMbh6PjEwadKUk1m04S7EjdQLsj/MBSgoQtCT3MDmWUUtHZd5 RYIPnPq3WVB47GtuO6/u375tsxhtf7vt95QSYJwCB+ZUgo4T+FV4hquZ4AsRkbgavtIzQisg Dgv76tnEv3YHV8Jn9mi/Bu0FURF+5kpdMfgo1sq6RXNQ//TVf8yFgRtTUdXxW/qHjlYURrm2 H4kutobVEIxiyu6m05q3e9eZB/TaMMNVORx+1kM3j7f0rwtEYUFzY1ygQfpcMDPl7pRYoJjB dSsm0ZuzDaCwaxg2t8hqQJBzJCezTOIkjHUsWAK+tEbU4Z4SnNpCyM3fBqsgYdJxjyC/tWVT AQ18NRLtPw7tK1rdcwCl0GFQHwSwk5pDpz1NH40e6lU+NcXSeiqkDDRkHlftKPV/dV+lQXiu jWt87ecuHlpL3uuQ0ZZNWqHgZoQLXoqC2ZV5KrtKWb/jyiFX/sxSrodALf0zf+tfHv0FZWT2 zHjUqd0t4njD/UOsuIMOQn4Ig0SdivYPfZukb5cdasKJukG1NOpbW7yRNivaCnfZz6dTawXw XRIV/KDsHQiyVxKvN73bThKhONkcX2LWuD928tAR6XMM2G5ovxLe09vuOzzfTWQDsm++9UKF a/A= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 17/11/2025 11:34, Sascha Hauer wrote: > On Mon, Nov 17, 2025 at 10:52:49AM +0100, Krzysztof Kozlowski wrote: >> On 17/11/2025 09:26, Sascha Hauer wrote: >>> On Mon, Nov 17, 2025 at 08:38:48AM +0100, Krzysztof Kozlowski wrote: >>>> On 13/11/2025 09:28, Ahmad Fatoum wrote: >>>>> Hello, >>>>> >>>>> With /chosen/bootsource now part of dt-schema, I would like to raise a >>>>> related point: The need for SoC-specific device tree aliases. >>>>> >>>>> For many SoCs, there is a canonical numbering for peripherals; it's used >>>>> in the datasheet and BootROMs often makes use of it at runtime to report >>>>> the bootsource as a pair: >>>>> >>>>> - One value to enumerate type of boot medium (e.g. mmc, spi-nor..) >>>>> - Another value that describes which instance (e.g. SDHC1, SPI3, ...) >>>>> >>>>> Some examples, where this is the case, are AT91, STM32MP or i.MX. >>>>> >>>>> barebox has traditionally used /aliases to translate BootROM information >>>>> to a device tree node to fixup /chosen/bootsource. >>>>> >>>>> This doesn't work out for many newer SoC support, because of different >>>>> expectations: For upstream, aliases are relevant to a board, while >>>>> barebox traditionally expected them to be SoC-specific (because they >>>>> used to be on i.MX, probably). >>>> >>>> Please state exactly the problem - you have aliases in DTS but >>>> bootsource in DTSI? Then that's clearly mixup - you need to define them >>>> in the same place. Aliases are in DTS (I see here other thread on that), >>>> so stdout-path is also in DTS. >>>> >>>> Or you don't have bootsource in DTSI at all because barebox invents it >>>> regardless of actual aliases? Then shouldn't this be an obvious issue? >>>> You cannot have barebox as second source of aliases. >>>> >>>>> >>>>> To accommodate this, barebox nowadays extends upstream device trees with >>>>> /chosen/barebox,bootsource-${alias} properties, which can be used as >>>>> translation table instead of aliases. >>>>> >>>>> This solves the issue, but there is occasional breakage when upstream >>>>> decides to remove aliases from the SoC DTSI and move them into the >>>>> boards until barebox is made to add the /chosen/barebox, overrides. >>>>> >>>>> As described above, I think the data sheet numbering is pretty much an >>>>> aspect of the hardware and it has a place in the upstream SoC DTSI. >>>>> >>>>> >>>>> So what are the thoughts on adding /soc/aliases or some other top-level >>>>> node to hold this information? >>>>> Or would a h"ardware-label" property or similar be more tenable? >>>> >>>> So you want to map full node path to some alias, so later you can map >>>> that alias back to full node path, right? This sounds like quite >>>> redundant information in DTS just to avoid impact of node reshuffling >>>> (like unit address changes). In DTS-source-code realm, we solved it with >>>> phandles. Maybe this would help here? >>> >>> We want aliases that map from the hardware numbers of a device as used >>> in the reference manuals to the actual device nodes. One reason why we >>> need it is to get the device node a SoC has booted from. Many SoCs have >>> registers which describe . We want to get >>> the device node from that information. >> >> Ah, so you don't map from full node path but from some value in register >> and you want to store these values as alias. > > Not sure if we mean the same when you say "store these values as alias". > > What we want to do is a SoC dtsi providing something like: I meant how your bootloader/barebox generates this information. Best regards, Krzysztof