All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Douthit <stephend@silicom-usa.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] i350 software defined pins sysfs access
Date: Thu, 13 Jun 2019 14:02:09 +0000	[thread overview]
Message-ID: <91ca0c21-d1c2-bf4d-0a0a-6c04c65381d1@silicom-usa.com> (raw)
In-Reply-To: <640C4F07-20AB-4D98-8A6D-770F0CE1C412@flussonic.com>

On 6/13/19 2:51 AM, Max Lapshin wrote:
> 
>>
>> The igb driver already uses these pins for PTP if that's configured and
>> the 82575 uses SDP3 as a power enable for SFP cages, sgmii PHYs, etc.
>> You'll need to avoid letting userspace poke at SDPs that the driver is
>> already using.
> 
> I should write code to avoid touching these registers for these cases?

If you use the gpiolib framework, then I believe refactoring the
existing SDP peeks/pokes in the igb driver to use gpio descriptors
should take care of this for you.  In the cases where the driver needs
the SDPs it will have already requested those gpio descriptors and they
won't be available to other requesters like user space.

>> Assuming this can coexist with the existing usage, why not register this
>> as a gpio_chip with the gpiolib framework?
> 
> Ok, I will ?take a look at it.
> 
> 
>>
>>> Subject: [PATCH] i350: Add support for Intel i350 software defined pins
>>>
>>> +
>>> +/* Software defined pins 2-3 */
>>> +#define IGB_CTRL_EXT_SDP2_DATA E1000_CTRL_EXT_SDP2_DATA /* Value of SW Defineable Pin 2 */
>>> +#define IGB_CTRL_EXT_SDP3_DATA E1000_CTRL_EXT_SDP3_DATA /* Value of SW Defineable Pin 3 */
>>> +#define IGB_CTRL_EXT_SDP2_DIR ?E1000_CTRL_EXT_SDP2_DIR ?/* SDP2 Data direction */
>>> +#define IGB_CTRL_EXT_SDP3_DIR ?E1000_CTRL_EXT_SDP3_DIR ?/* SDP3 Data direction */
>>
>> Looks like e1000_defines.h already has this info.
>>
> 
> Only partially, so I decided to copy it to avoid situtation then I have in one code ?IGB_ and E1000_ ?defines.
> 
> It is not good?

I think it would be preferable to just add to e1000_defines.h where
they're all currently located rather than duplicating them.

-Steve

      reply	other threads:[~2019-06-13 14:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-11 21:01 [Intel-wired-lan] i350 software defined pins sysfs access Max Lapshin
2019-06-12 21:03 ` Stephen Douthit
2019-06-13  6:51   ` Max Lapshin
2019-06-13 14:02     ` Stephen Douthit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91ca0c21-d1c2-bf4d-0a0a-6c04c65381d1@silicom-usa.com \
    --to=stephend@silicom-usa.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.