[Letux-kernel] X1600 Pullup/down

H. Nikolaus Schaller hns at goldelico.com
Fri Mar 15 12:14:18 CET 2024


Hi Paul,

> Am 15.03.2024 um 12:06 schrieb Paul Boddie <paul at boddie.org.uk>:
> 
> On 2024-03-15 06:48, H. Nikolaus Schaller wrote:
>> it may be that we have a bug for setting the pullup/down registers for the x1600.
>> This is done in ingenic_set_bias().
>> Since the ID_X1600 >= ID_JZ4770 it calls
>> ingenic_config_pin(jzpc, pin, JZ4770_GPIO_PEN, !bias);
>> Now JZ4770_GPIO_PEN is defined as 0x70.
>> But the PULL-UP/DOWN enabled State register is at offset 0x80 and
>> there are SET and CLEAR registers at 0x84 and 0x88. There seems to be no equivalent
>> with any other chip, not even the X1830 or X2000.
> 
> Indeed. The X1600 has a pull enable register at 0x80 and a different edge-related register at 0x70. I hadn't looked at this initially, but my own separate code does pull-up/down configuration and appears to work, at least as far as I have tested it (which isn't much).
> 
>> So we have to add new register constants. Something like
>> #define X1600_GPIO_PEN                         0x80
>>        } else if (is_soc_or_above(jzpc, ID_X1600)) {
>>                 ingenic_config_pin(jzpc, pin, X1600_GPIO_PEN, !bias);
>>        } else if (is_soc_or_above(jzpc, ID_JZ4770)) {
>>                 ingenic_config_pin(jzpc, pin, JZ4770_GPIO_PEN, !bias);
>> BTW: we have the same issue in our letux-5.10.y-lx16 kernel.
>> And it got unnoticed since I had no application so far that relies on
>> pullup/down...
>> Do you think this is the right way to go?
> 
> Yes, I think some kind of test involving the new register is required. Unlike earlier SoCs like the JZ4780, however, it is used to enable, not disable, pull-up/down.

Yes, it is pull-enable.

Attached is my (compile-)tested version if you want to take a look into.

BR,
Nikolaus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-pinctrl-fix-ingenic_set_bias-for-x1600.patch
Type: application/octet-stream
Size: 1844 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20240315/9d0ec2c5/attachment.obj>


More information about the Letux-kernel mailing list