Commit graph

20 commits

Author SHA1 Message Date
Hector Martin
c2c0ac04aa pcie: Add initial t602x support
Signed-off-by: Hector Martin <marcan@marcan.st>
2023-04-12 00:40:06 +09:00
Janne Grunau
c6c426581b pcie: Add link speed override for SD card reader
The SD card reader on Macbook Pro 14"/16" and Mac Studio uses yet
another property to override the port's "maximum-link-speed" property.
Add parsing for "expected-link-speed" and always look in the port's
first child for these properties.
Increases the link speed to PCIe 2.0 which is required for the full
bandwidth of SDXC UHS-II.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-03-12 00:32:10 +09:00
Hector Martin
ecfed3e100 pcie: Add t8112 support
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-07-01 23:37:00 +09:00
Janne Grunau
d0ce92a284 pcie: Set correct link speed for 10gb ethernet
The PCIe 4 link speed is only described as "target-link-speed" in the
"lan-10gb". This changed in macos 12.3 or earlier. Verified on Mac
Studio and with the template Mac Mini ADT.

Reported-by: Jeff Geerling <geerlingguy@mac.com>
Signed-off-by: Janne Grunau <j@jannau.net>
2022-04-16 19:14:00 +09:00
Sven Peter
1254b4bee6 pmgr: s/clock/power/
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-01-16 18:53:29 +09:00
Hector Martin
abee2ecebc pcie: Set link speed capabilities from ADT
This sets both the target and the max link speed of the root ports
to the maximum specified in the ADT.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-12-07 14:03:26 +09:00
Hector Martin
c9dc4401c0 pcie: Enable port speed controls
This makes PCIe train at >Gen1 by default

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-12-02 13:55:25 +09:00
Hector Martin
26b55d4b26 pcie: Wait for port PHY to be idle after init before configuring
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-12-02 13:42:19 +09:00
Hector Martin
9949689a74 pcie: Document APCIE_PHYIF_CTRL
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-12-02 13:41:56 +09:00
Hector Martin
01e84ecef6 pcie: Document reg ranges better
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-22 16:43:22 +09:00
Hector Martin
555965e98a pcie: Calculate the number of reg entries per port
Turns out this isn't hardware-specific, but rather a change Apple made
retroactively in 12.0 RC. Doesn't look like there's a saner way than
this...

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-22 16:24:37 +09:00
Janne Grunau
b6ec7abc2b utils: replace sprintf with snprintf
Converts all current users.

Signed-off-by: Janne Grunau <j@jannau.net>
2021-11-12 23:48:32 +09:00
Hector Martin
efca793572 pcie: Only print the port init msg for existing ports
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-11 01:20:03 +09:00
Hector Martin
510dd53175 pcie: Add t6000 support
This one seems to need one extra magic poke

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-10 20:43:51 +09:00
Hector Martin
a83d0908e5 pcie: Add t6000 fuse bit map and fix fuse bit application
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-10 20:43:51 +09:00
Hector Martin
84acf60c24 Fix warnings when building/linking with clang/llvm
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-08 13:53:04 +09:00
Hector Martin
0c093521de pcie: Basic t600x support
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-04 03:55:48 +09:00
Mark Kettenis
77b0cdb7c9 pcie: Only initialize ports that are actually present
The macbook pro and macbook air only have a single PCIe port

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2021-08-31 02:07:24 +09:00
Hector Martin
bd8ae6f4f6 pcie: Add a pcie_shutdown() function and call it on hv init
Guests don't like it if PCIe is initialized already

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-28 00:03:11 +09:00
Mark Kettenis
9604907b2d pcie: minimal initialization
Minimal initialization of the PCIe hardware such that the tunable
can be applied such that they don't have to be passed along in
the devicetree.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2021-05-16 02:43:44 +09:00