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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AE6CC433EF for ; Tue, 19 Oct 2021 21:27:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 373136101A for ; Tue, 19 Oct 2021 21:27:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229498AbhJSV3l (ORCPT ); Tue, 19 Oct 2021 17:29:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:38352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbhJSV3k (ORCPT ); Tue, 19 Oct 2021 17:29:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4D639611C7; Tue, 19 Oct 2021 21:27:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634678847; bh=n5oKhj49goNe7lHOmGWW8DH88TSwDNvemsZekDVUD+g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=hA8jLmLCMkT0f8JITb9xNQlvJW/fBCTKXqZqkYvpXpW9mIuTSpdqXIQJYXFgGnyqb XAU6fUA6S4YpfO7TT9OTDvEJklw/Sxr4JV2Gy8XsUhJCYCAiR+tVsAhE9AO7tsWfRG 7KM3wKkpTlyultA7pI12K4mjHuLzfBrOeIXS+1X6/G9nlmO9KMZ158dGkcrBtsuoSz Y21Z0w0DxNlxhb0UrG1ccW4ehLnJMBGfAZzh9DCsxQyt3VXuxM/+kGNgBXrJhJ1fFI PgSl0UsxBrkNcJGWUQBqkaso6+9h7eXXUmIFEGEfM0iZFuyV1QCOGRJYsrs/1Ln6nX A7pyLacvyHGZg== Received: by mail-wm1-f50.google.com with SMTP id v127so14540204wme.5; Tue, 19 Oct 2021 14:27:27 -0700 (PDT) X-Gm-Message-State: AOAM532/i/abnc/NQwMetnRfgvhYWR9014cAOHspg2rCUx47sB9g+MIn G1fuwotp/+P+GnEmK9AAHz1amxnTwElIhjFPwBI= X-Google-Smtp-Source: ABdhPJyhBvMAj7E4hwSuCHCizWK1p4jiSiUNfn+Rg4ldLs8/ysSNQSLbiYhlq6WQaCwWkA1g6gF7Za9VyAjZbwku+l8= X-Received: by 2002:adf:e292:: with SMTP id v18mr45066638wri.369.1634678845729; Tue, 19 Oct 2021 14:27:25 -0700 (PDT) MIME-Version: 1.0 References: <1632399378-12229-1-git-send-email-rajpat@codeaurora.org> <1632399378-12229-9-git-send-email-rajpat@codeaurora.org> In-Reply-To: From: Arnd Bergmann Date: Tue, 19 Oct 2021 23:27:09 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V10 8/8] arm64: dts: sc7280: Add aliases for I2C and SPI To: Doug Anderson Cc: Bjorn Andersson , Rajesh Patil , Andy Gross , Rob Herring , linux-arm-msm , Linux Kernel Mailing List , DTML , Rajendra Nayak , Sai Prakash Ranjan , msavaliy@qti.qualcomm.com, satya priya , Stephen Boyd , Matthias Kaehlcke Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Tue, Oct 19, 2021 at 11:11 PM Doug Anderson wrote: > On Tue, Oct 19, 2021 at 1:57 PM Bjorn Andersson > > Hrm. I know this gets into slightly controversial topics, but I'm a > little curious what the downside of having these in the dtsi is. In > the case where these i2c/spi/mmc devices _don't_ have "well defined" > numbers in the hardware manual of the SoC then I can agree that it > doesn't make sense to list these in the dtsi file. However, in the > case of sc7280 these numbers are well defined at the SoC level for i2c > and SPI. > > Said another way: if you have a board that's got peripherals connected > on the pins labelled "i2c2" and "i2c6" on the SoC then it's a really > nice thing if these show up on /dev/i2c-2 and /dev/i2c-6. > > ...so I'm not sure what board exactly would be overriding and > re-numbering? Unless a board really has a strong use case where they > need the device connected to the pins for "i2c2" to show up on > "/dev/i2c-0"? There are multiple things going on here: - The aliases are traditionally managed by the bootloader, same way as the /chosen nodes including the kernel command line, so the numbers are local policy, and the per-board defaults are just for convenience. - IMHO there should not be any aliases for status="disabled" nodes, and the status is usually set in the board files. - The labels on the board don't always match what the SoC calls them, or there might not be any labels at all. This is more important for things like serial ports that are often bare connectors rather than already wired up. The aliases should normally match how the board numbers the connectors, not how they are attached internally. - For i2c, it's not uncommon to have i2c devices attached behind expanders on i2c/spi/gpio/usb/pci devices Arnd