linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pinctrl-amd: What hardware does it apply to?
@ 2017-12-20 22:25 Andrew Cooks
  2017-12-21 10:11 ` Linus Walleij
  2017-12-21 13:02 ` Christian Lamparter
  0 siblings, 2 replies; 11+ messages in thread
From: Andrew Cooks @ 2017-12-20 22:25 UTC (permalink / raw)
  To: Linus Walleij, linux-gpio, linux-kernel
  Cc: Nehal Shah, Shyam Sundar S K, Ken Xue, Tobias Diedrich,
	Sudheesh Mavila, platypus-sw

Hi Linus

I'm working on gpio for an AMD Family 16h Model 30h system[1]. The SoC is the same as the GX412-TC used in the PC Engines APU2. 

There is an out-of-tree gpio driver (gpio-amd) for this SoC in the meta-amd yocto layer[2].
Another driver (gpio-sb8xx) was submitted for upstream inclusion, but was knocked back with the suggestion that pinctrl is the way forward[3].

I would much prefer to use a mainline driver for the system I'm working on, so I'm looking at the pinctrl-amd driver to see whether it applies to our SoC, or whether it could be extended, or used as starting point for a new driver.

The out-of-tree drivers apply to the GX412-TC SoC and uses PCI for probing:

gpio-amd registers a platform driver that applies to { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS }
gpio-sb8xx applies to { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS } and { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS }

These IDs make it easy to cross reference with the datasheet, and keeps the coupling between ACPI and the driver low. 
These drivers do not provide a mechanism for firmware (ACPI or DT) to specify which gpios are safe to use or how to use them.

In contrast, the pinctrl-amd driver only mentions the newer KERNCZ platform name and uses ACPI for probing without disclosing any Family or Model numbers.

pinctrl-amd applies to "AMD0030" and "AMDI0030"

The ACPI HID matching makes it difficult to determine what family and model the driver applies to, or rather, I have not been able to find such a mapping of HIDs to family and model numbers. It's also impossible to guess an ACPI _HID that may or may not exist for the Family 16h Model 30h platform and even if I allocate a new HID for our ACPI implementation, that HID has little hope of being accepted into the mainline driver.

I would like to extend the generically named, but very specifically implemented pinctrl-amd driver to also work on Family 16h, Model 30h (specifically the FT3b package), and I propose to use the PCI_DEVICE_ID_AMD_16H_M30H_NB_F3 symbol to probe for the device.

Does this seem like a sensible way forward?

Thanks!

Andrew

1. http://support.amd.com/TechDocs/52740_16h_Models_30h-3Fh_BKDG.pdf
2. http://git.yoctoproject.org/cgit/cgit.cgi/meta-amd/tree/meta-steppeeagle/recipes-kernel/amd-gpio/files/gpio-amd.c
3. https://lkml.org/lkml/2015/6/20/202

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-12-22 17:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-20 22:25 pinctrl-amd: What hardware does it apply to? Andrew Cooks
2017-12-21 10:11 ` Linus Walleij
2017-12-21 12:12   ` Mika Westerberg
2017-12-22  0:37     ` Andrew Cooks
2017-12-22  6:05       ` Mika Westerberg
2017-12-22  0:44   ` Andrew Cooks
     [not found]   ` <CAOdcoTnpiWkPu4_eOJ6bzUE58PqRHw-y5yHY2T8M3Ymp_2v0MQ@mail.gmail.com>
2017-12-22  1:05     ` Andrew Cooks
2017-12-21 13:02 ` Christian Lamparter
2017-12-22  1:17   ` Andrew Cooks
2017-12-22  7:48     ` Linus Walleij
2017-12-22 17:49       ` Christian Lamparter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).