[RFC PATCH 1/3] dt-bindings: pinctrl: jh7110-sys: add force inputs
Linus Walleij
linus.walleij at linaro.org
Wed Apr 23 03:55:19 PDT 2025
On Wed, Apr 23, 2025 at 11:41 AM Icenowy Zheng <uwu at icenowy.me> wrote:
> 于 2025年4月23日 GMT+08:00 17:09:42,Linus Walleij <linus.walleij at linaro.org> 写道:
> >Hi Icenowy,
> >
> >thanks for your patch!
> >
> >On Tue, Apr 22, 2025 at 6:23 PM Icenowy Zheng <uwu at icenowy.me> wrote:
> >
> >> + starfive,force-low-inputs:
> >> + description:
> >> + The list of input signals forced to be low inside the SoC itself.
> >> + $ref: /schemas/types.yaml#/definitions/uint32-array
> >
> >I don't see why you need this hack.
>
> Unfortunately these properties are not for pins, but internal signals that isn't
> bound to external pins.
We don't really care if pins are external or not, we are an operating system
not a philosophy department ;)
You calculate the offset and shift like this and write into a base+offset:
+ offset = 4 * (pin / 4);
+ shift = 8 * (pin % 4);
+
+ val = readl_relaxed(sfp->base +
+ info->gpi_reg_base + offset);
Compare to jh7110_pin_dbg_show():
unsigned int offset = 4 * (pin / 4);
unsigned int shift = 8 * (pin % 4);
u32 dout = readl_relaxed(sfp->base +
info->dout_reg_base + offset);
u32 doen = readl_relaxed(sfp->base +
info->doen_reg_base + offset);
So clearly the entities that you affect are in the same numberspace,
and that is all we care about. They are not enumerated in any way
orthogonal to any other pins AFAICT.
Both pin control and GPIO handle chip-internal lines that are not
routed outside sometimes, that's fine. Just deal with them as any other
"pins".
Yours,
Linus Walleij
More information about the linux-riscv
mailing list