* [PATCH] Thunderbolt: Add support for Thunderbolt 2 host controllers
@ 2014-06-01 16:13 Matthew Garrett
2014-06-01 20:42 ` Andreas Noever
0 siblings, 1 reply; 3+ messages in thread
From: Matthew Garrett @ 2014-06-01 16:13 UTC (permalink / raw)
To: andreas.noever; +Cc: linux-kernel, linux-pci, greg, bhelgaas, Matthew Garrett
Adding extra device IDs is enough to get this working on the second-gen
Thunderbolt controller in the Mac Pro.
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
---
drivers/pci/quirks.c | 2 ++
drivers/thunderbolt/nhi.c | 5 +++++
drivers/thunderbolt/switch.c | 5 ++++-
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index c3170d4..20e76d0 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3083,6 +3083,8 @@ out:
}
DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, 0x1547,
quirk_apple_wait_for_thunderbolt);
+DECLARE_PCI_FIXUP_SUSPEND_LATE(PCI_VENDOR_ID_INTEL, 0x156d,
+ quirk_apple_wait_for_thunderbolt);
#endif
static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f,
diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
index 6f666fa..85b11d6 100644
--- a/drivers/thunderbolt/nhi.c
+++ b/drivers/thunderbolt/nhi.c
@@ -642,6 +642,11 @@ struct pci_device_id nhi_ids[] = {
.vendor = PCI_VENDOR_ID_INTEL, .device = 0x1547,
.subvendor = 0x2222, .subdevice = 0x1111,
},
+ {
+ .class = PCI_CLASS_SYSTEM_OTHER << 8, .class_mask = ~0,
+ .vendor = PCI_VENDOR_ID_INTEL, .device = 0x156c,
+ .subvendor = 0x2222, .subdevice = 0x1111,
+ },
{ 0,}
};
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 2e19045..1fccdbf 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -294,8 +294,11 @@ static int tb_plug_events_active(struct tb_switch *sw, bool active)
if (active) {
data = data & 0xFFFFFF83;
- if (sw->config.device_id == 0x1547)
+ switch (sw->config.device_id) {
+ case 0x1547:
+ case 0x156d:
data |= 4;
+ }
} else {
data = data | 0x7c;
}
--
2.0.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Thunderbolt: Add support for Thunderbolt 2 host controllers
2014-06-01 16:13 [PATCH] Thunderbolt: Add support for Thunderbolt 2 host controllers Matthew Garrett
@ 2014-06-01 20:42 ` Andreas Noever
2014-06-01 22:05 ` Matthew Garrett
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Noever @ 2014-06-01 20:42 UTC (permalink / raw)
To: Matthew Garrett
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
Greg Kroah-Hartman, Bjorn Helgaas
On Sun, Jun 1, 2014 at 6:13 PM, Matthew Garrett
<matthew.garrett@nebula.com> wrote:
> Adding extra device IDs is enough to get this working on the second-gen
> Thunderbolt controller in the Mac Pro.
>
> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
> ---
> drivers/pci/quirks.c | 2 ++
> drivers/thunderbolt/nhi.c | 5 +++++
> drivers/thunderbolt/switch.c | 5 ++++-
> 3 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index c3170d4..20e76d0 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -3083,6 +3083,8 @@ out:
> }
> DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, 0x1547,
> quirk_apple_wait_for_thunderbolt);
> +DECLARE_PCI_FIXUP_SUSPEND_LATE(PCI_VENDOR_ID_INTEL, 0x156d,
> + quirk_apple_wait_for_thunderbolt);
> #endif
Just to check: Did they split up the device ids? Is 0x156d for the
bridges and 0x156c for the NHI?
>
> static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f,
> diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
> index 6f666fa..85b11d6 100644
> --- a/drivers/thunderbolt/nhi.c
> +++ b/drivers/thunderbolt/nhi.c
> @@ -642,6 +642,11 @@ struct pci_device_id nhi_ids[] = {
> .vendor = PCI_VENDOR_ID_INTEL, .device = 0x1547,
> .subvendor = 0x2222, .subdevice = 0x1111,
> },
> + {
> + .class = PCI_CLASS_SYSTEM_OTHER << 8, .class_mask = ~0,
> + .vendor = PCI_VENDOR_ID_INTEL, .device = 0x156c,
> + .subvendor = 0x2222, .subdevice = 0x1111,
> + },
> { 0,}
> };
>
> diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
> index 2e19045..1fccdbf 100644
> --- a/drivers/thunderbolt/switch.c
> +++ b/drivers/thunderbolt/switch.c
> @@ -294,8 +294,11 @@ static int tb_plug_events_active(struct tb_switch *sw, bool active)
>
> if (active) {
> data = data & 0xFFFFFF83;
> - if (sw->config.device_id == 0x1547)
> + switch (sw->config.device_id) {
> + case 0x1547:
> + case 0x156d:
> data |= 4;
> + }
> } else {
> data = data | 0x7c;
> }
> --
> 2.0.0
>
I have had a look at what os x does. They split between:
1513, 151a, 1549 and 1547, 1548, 1567, 1569, 156b, 156d (the latter
group gets bit 3 set)
It looks like the first 3 are legacy devices, so maybe reverse the check?
So far I could decode:
1547: cactus ridge (2 and 4 port?)
1549: ethernet adapter
156b: 2 port falcon ridge
156d: 4 port falcon ridge
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Thunderbolt: Add support for Thunderbolt 2 host controllers
2014-06-01 20:42 ` Andreas Noever
@ 2014-06-01 22:05 ` Matthew Garrett
0 siblings, 0 replies; 3+ messages in thread
From: Matthew Garrett @ 2014-06-01 22:05 UTC (permalink / raw)
To: andreas.noever@gmail.com
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
greg@kroah.com, bhelga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xtYXR0aGV3LmdhcnJldHRAbmVidWxhLmNvbT4N
Cg==
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-01 22:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-01 16:13 [PATCH] Thunderbolt: Add support for Thunderbolt 2 host controllers Matthew Garrett
2014-06-01 20:42 ` Andreas Noever
2014-06-01 22:05 ` Matthew Garrett
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).