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: <b911cd23-8590-55bb-7606-718f16e8ed42@linaro.org>
Date:   Mon, 14 Aug 2023 21:18:39 +0200
From:   Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To:     Yinbo Zhu <zhuyinbo@...ngson.cn>,
        Bartosz Golaszewski <brgl@...ev.pl>
Cc:     Conor Dooley <conor@...nel.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>, linux-gpio@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jianmin Lv <lvjianmin@...ngson.cn>, wanghongliang@...ngson.cn,
        loongson-kernel@...ts.loongnix.cn
Subject: Re: [PATCH v3 1/2] gpio: dt-bindings: add parsing of loongson gpio
 offset

On 14/08/2023 05:39, Yinbo Zhu wrote:
> 
> 
> 在 2023/8/11 下午10:25, Bartosz Golaszewski 写道:
>> On Thu, Aug 10, 2023 at 8:19 AM Yinbo Zhu <zhuyinbo@...ngson.cn> wrote:
>>>
>>>
>>>
>>> 在 2023/8/9 下午11:39, Conor Dooley 写道:
>>>> On Wed, Aug 09, 2023 at 03:47:55PM +0800, Yinbo Zhu wrote:
>>>>> 在 2023/8/8 下午8:05, Conor Dooley 写道:
>>>>>> On Mon, Aug 07, 2023 at 03:40:42PM +0800, Yinbo Zhu wrote:
>>>>
>>>>>>> +  loongson,gpio-ctrl-mode:
>>>>>>> +    $ref: /schemas/types.yaml#/definitions/uint32
>>>>>>> +    description:
>>>>>>> +      This option indicate this GPIO control mode, where '0' represents
>>>>>>> +      bit control mode and '1' represents byte control mode.
>>>>>>
>>>>>> How is one supposed to know which of these modes to use?
>>>>>
>>>>>
>>>>> Byte mode is to access by byte, such as gpio3, the base address of the
>>>>> gpio controller is offset by 3 bytes as the access address of gpio3.
>>>>>
>>>>> The bit mode is the normal mode that like other platform gpio and it is
>>>>> to access by bit.
>>>>>
>>>>> If both modes are supported, it is recommended to prioritize using byte
>>>>> mode that according to spec.
>>>>
>>>> So, sounds like this property should instead be a boolean that notes
>>>> whether the hardware supports the mode or not, rather than the current
>>>> enum used to determine software policy.
>>>
>>>
>>> okay, I got it, I will use boolean,
>>>
>>
>> Why do you want to put it into device-tree so badly? This is not the
>> first driver that would have of_match_data for different variants
>> where you can have a structure that would keep offsets for different
>> models. It's not like you will have hundreds of "compatible" chips
>> anyway, most likely just a few?
> 
> 
> Using this ways that put offset property into device-tree that can be
> compatible with future GPIO chips without the need to modify drivers,

That's not an argument for putting into DT.

> such as more 2K chips in the future, but use of_match_data and data
> field of_device_id, which every time a new SoC is released, the GPIO
> driver needs to be modified once, which is not friendly to us.

Sorry, "friendly" is again hardly an argument what should or should not
be in DT.

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ