lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a2FroDEppfEkPge7Mm4gGF8ZNHvCwL3r-8Cg7f575YhPw@mail.gmail.com>
Date:   Tue, 19 Oct 2021 23:27:09 +0200
From:   Arnd Bergmann <arnd@...nel.org>
To:     Doug Anderson <dianders@...omium.org>
Cc:     Bjorn Andersson <bjorn.andersson@...aro.org>,
        Rajesh Patil <rajpat@...eaurora.org>,
        Andy Gross <agross@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        DTML <devicetree@...r.kernel.org>,
        Rajendra Nayak <rnayak@...eaurora.org>,
        Sai Prakash Ranjan <saiprakash.ranjan@...eaurora.org>,
        msavaliy@....qualcomm.com, satya priya <skakit@...eaurora.org>,
        Stephen Boyd <sboyd@...nel.org>,
        Matthias Kaehlcke <mka@...omium.org>
Subject: Re: [PATCH V10 8/8] arm64: dts: sc7280: Add aliases for I2C and SPI

On Tue, Oct 19, 2021 at 11:11 PM Doug Anderson <dianders@...omium.org> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ