0
\$\begingroup\$

I have a M.2 M-keyed slot on my laptop, and multiple M.2 PCI-e devices that I'd like to use at the same time. I've been looking for a M.2 switch or splitter of sorts but couldn't find anything, so I decided to design my own & also gain some PCI Express experience.

I tried to look up specifications for PCI Express physical layer but I couldn't find much information. Most articles I found refer to PCI-SIG website which needs a membership with a work email (that I don't have) from one of the member companies. So I tried to learn as much as possible on my own.

As far as I could figure out, a M.2 M-key slot exposes 4x PCI-e lanes. The devices I have are a combination of A/E, E and M keys. The A/E and E key devices require 1 or 2 PCIe lanes. None of the cards I have need the M.2 specific features like USB or DisplayPort. I'm also completely fine with the M-key (x4) devices running on 2 lanes or even a single lane at reduced speeds. I also learned that each PCI-e lane has a differential transmit and receive pair, and there's a reference clock that's provided by the host. So I am wondering;

  • if I design a board that would split the 4 lanes on the M-key slot out to 2 lanes on a M.2 E-key (at the matching pin numbers) plus 2 more lanes on a M.2 M-key (with the other 2 lanes N/C) and use the reference clock on both slots, would that just work?
  • Do I need to buffer the reference clock or can I just tie them together?
  • Since the I2C bus is open drain, can I just tie them all together? (Same with SMBus)
  • What does the CLKREQ# line do in PCI Express? As far as I could figure out, the PCIe card asserts this line when it needs a reference clock. Can I just pull it down, keeping all cards clocked all the time? Or can I use an OR gate so when any card plugged in needs a clock, all cards plugged in receive the reference clock?
  • What's the function of the WAKE# and PERST# lines?
  • Are there any more PCIe signals other than the TX/RX pairs, REFCLK, WAKE, PERST, CLKREQ?
  • Is there a specific power-up sequence for PCI Express?
  • Will the host detect and enumerate all devices separately, or does it need special BIOS or UEFI firmware support for this?
  • Is there anything else I should keep in mind?

I'm looking into this as more of a learning experience than just a solution for my need, so I appreciate any help I can get. Thank you!

\$\endgroup\$
9
  • \$\begingroup\$ That bus is not designed to operate that way, even if you can get them to plug in together without blowing up, software will probably fail. That m.2 slot needs to be owned by a single device. \$\endgroup\$
    – Ron Beyer
    Jun 3 at 0:53
  • \$\begingroup\$ You need a PCI-e bridge to split the lanes for you. Probably something like whatever's under the heatsink in this device. \$\endgroup\$
    – brhans
    Jun 3 at 1:02
  • \$\begingroup\$ @brhans That just looks like a simple multiplexer, I instead want to split the 4 lanes for different devices and be able to use the full bandwidth for all 4 lanes. \$\endgroup\$
    – özg
    Jun 3 at 1:10
  • \$\begingroup\$ PCIe is extremely advanced. Don't mess with it if you need to ask something like whether you can mux it or not. You need to work your way up to something like PCIe. \$\endgroup\$
    – DKNguyen
    Jun 3 at 1:14
  • \$\begingroup\$ @DKNguyen I've seen full-size PCIe risers that split one 16x slot into two 8x slots with minimal circuitry (a clock buffer and a few extra components) and I'm wondering why that wouldn't be possible with M.2 M key which is basically just a PCIe x4 port. Since I should work my way up to it, and I'm looking at it as a learning experience; are there any resources that you can refer me to? \$\endgroup\$
    – özg
    Jun 3 at 1:22
0
\$\begingroup\$

Beyond the physical layer, you have very low level kernel systems on the CPU level that you would need to write complex driver for, perhaps even rewrite the BIOS.

The I2C bus is used for some specific low-level systems and is often not implemented on consumer products, only on high-end motherboard.

Since the I2C bus is open drain, can I just tie them all together? (Same with SMBus)

No, this might disable some of the chips on the motherboard as the line may be shared for other purposes (like power supply controls, etc...).

What's the function of the WAKE# and PERST# lines?

Wake is to wake up the computer from the hardware.

Will the host detect and enumerate all devices separately, or does it need special BIOS or UEFI firmware support for this?

It does, but it doesn't necessarily knows how to communicate with them, thus the driver are required.

Is there anything else I should keep in mind?

The speed of the bus makes it difficult to work with an MCU and usually FPGA / expensive custom chip are required. There is also a lot of IP and not much information is available.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.