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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdW_DUyo=uarCpceKcEq9Hx+q+DHgfHW-m2DOjgAQ5R79Q@mail.gmail.com>
Date: Fri, 9 Jan 2026 11:19:18 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Linus Walleij <linusw@...nel.org>
Cc: Stafford Horne <shorne@...il.com>, LKML <linux-kernel@...r.kernel.org>, 
	Linux OpenRISC <linux-openrisc@...r.kernel.org>, Bartosz Golaszewski <brgl@...nel.org>, 
	Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, 
	linux-gpio@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v2 1/5] dt-bindings: Add compatible string opencores,gpio
 to gpio-mmio

Hi Linus,

On Fri, 9 Jan 2026 at 11:07, Linus Walleij <linusw@...nel.org> wrote:
> On Thu, Jan 8, 2026 at 9:41 AM Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
> > > > What is the rationale behind using brcm,bcm6345-gpio?
> > > > Given brcm,bcm6345-gpio has 32-bit registers, while opencores,gpio
> > > > has 8-bit registers, I doubt the latter is compatible with the former...
>
> Yeah this needs to be fixed/reverted pronto :/
>
> > > I switch the size from 32-bit to 8-bit using the reg = <* 0x1>, <* 0x1> setting.
> > > Also the reg addresses of "dat" and "dirout" are different for the real
> > > brcm,bcm6345-gpio.
> > >
> > > brcm,bcm6345-gpio. Example:
> > >
> > >        /* GPIOs 192 .. 223 */
> > >        gpio6: gpio@518 {
> > >                compatible = "brcm,bcm6345-gpio";
> > >                reg = <0x518 0x04>, <0x538 0x04>;
> > >                reg-names = "dirout", "dat";
> > >                gpio-controller;
> > >                #gpio-cells = <2>;
> > >        };
> > >
> > > vs opencores,gpio Example:
> > >
> > >        gpio0: gpio@...00000 {
> > >                compatible = "opencores,gpio", "brcm,bcm6345-gpio";
> > >                reg = <0x91000000 0x1>, <0x91000001 0x1>;
> > >                reg-names = "dat", "dirout";
> > >                gpio-controller;
> > >                #gpio-cells = <2>;
> > >        };
> >
> > Exactly, the register space and register widths are different
>
> ...as proved here.
>
> Stafford can you send a fixup or revert patch?
> (Only need to revert if you can't make a fix quick enough, which I
> think you can.)
>
> > > The opencores,gpio setup does work.
> > >
> > > Now that I think about it, would it have been better to just add opencores,gpio
> > > to gpio-mmio.c compatible list?
> >
> > I think that would be better.
>
> Yes this is better.
>
> I should have seen this, I guess I was sloppy :(
>
> > > If so I will can revise this patch and add patch to gpio-mmio.c.
> >
> > DT maintainers: Given gpio-mmio is that generic/simple, is there a
> > specific reason there is no generic "gpio-mmio" compatible value that
> > can be used as a fallback, avoiding the need to keep on adding new
> > entries to gpio_mmio_of_match[]?
>
> I think "gpio-mmio" combined with compulsory property of
> bus-width = <nn> (as used by multiple bindings) would be
> generic enough. So a schema that accepts "gpio-mmio" if and
> only if bus-width = 8|16|32|64 would be acceptable.

Each register is described individually, and the width is derived
from the register's size, so no bus-width is needed"

  reg:
    minItems: 1
    description:
      A list of registers in the controller. The width of each register is
      determined by its size. All registers must have the same width. The number
      of GPIOs is set by the width, with bit 0 corresponding to GPIO 0, unless
      the ngpios property further restricts the number of used lines.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ