Re: pinconf-single: pinctrl-single,bias-pull{up,down} bits help/explanation

From: Haojian Zhuang
Date: Tue Nov 01 2022 - 02:40:10 EST


On Tue, 1 Nov 2022 at 14:20, Haojian Zhuang <haojian.zhuang@xxxxxxxxxx> wrote:
>
> On Sun, 16 Oct 2022 at 20:14, Marty E. Plummer <hanetzer@xxxxxxxxxxxxx> wrote:
> >
> > Greetings.
> >
> > What I'm having issue with is the pinctrl-single,bias-pull values. From
> > commit abe4e4675dfc62b7f2328e2c4bce8b5bdcdff7c0 I get a bit of it, and I
> > think I have it mostly figured out:
> >
> > // <[input] [enabled] [disabled] [mask]>;
> > pinctrl-single,bias-pullup = <? 1 0 0x100>;
> > pinctrl-single,bias-pulldown = <? 1 0 0x200>;
> >
> > using mask 0x100 to single out bit 8 and mask 0x200 to single out bit 9,
> > enable values being simple binary on/off. What I don't get is how the
> > input value is determined/calculated.
> >
> > Aside from the above mentioned commit for the am335x-pocketbeagle.dts,
> > which uses a differing pullup control scheme, the only users I can find
> > in the tree are a handful of hisi socs which I don't have a datasheet
> > for to map their usage to register definitions and puzzle this out.
> >
> Excuse me for just noticing the email.
>
> #define PULL_DIS 0
> #define PULL_UP 0x100
> #define PULL_DOWN 0x200
>
> // <[input] [enabled] [disabled] [mask]>
>
> // If you want to pull-up, configure the pin as below.
> pinctrl-single,bias-pullup = <PULL_UP PULL_UP 0 PULL_UP>
> // If you want to disable pull-up, configure the pin as below.
> pinctrl-single,bias-pullup = <0 PULL_UP 0 PULL_UP>
>
> It seems that the pin configuration in am335x-pocketbeagle.dts is wrong.
> But I don't have the board to verify it.
>

Sorry. I didn't check the comments in the commit carefully.

Obviously, the pinctrl definition is totally different in am335x chip.

bit4 is used to select pull-up or pull-down.
bit3 is used to enable the pull-up/pull-down.

In Hisilicon chip, bit9 is used to enable pull-down and bit8 is used
to enable pull-up.

They're totally different. I suggest you to enable the value in DTS
file and dump the register
value to check for your own silicon.

Best Regards
Haojian