Currently the SSD NVMe is not detected at boot by default due to a Kernel bug:
[ 3.150189] rockchip-pcie f8000000.pcie: PCIe link training gen1 timeout!
This is caused by too short PCI-E link training time:
/* 500ms timeout value should be enough for Gen1/2 training */
err = readl_poll_timeout(rockchip->apb_base + PCIE_CLIENT_BASIC_STATUS1,
status, PCIE_LINK_UP(status), 20,
500 * USEC_PER_MSEC);
if (err) {
dev_err(dev, "PCIe link training gen1 timeout!\n");
goto err_power_off_phy;
}
This causes system to not be bootable without patching or special configuration.
To make the NVMe SSD be detected you will need to compile some modules directly into the kernel:
PHY_ROCKCHIP_PCIE y
PCIE_ROCKCHIP_HOST y
To do this in NixOS configuration use:
{
boot.kernelPackages = pkgs.linuxPackages_5_18;
boot.kernelPatches = [{
name = "pcie-rockchip-config.patch";
patch = null;
extraConfig = ''
PHY_ROCKCHIP_PCIE y
PCIE_ROCKCHIP_HOST y
'';
}];
}
It's a good idea to also lock the kernel verison to avoid rebuilds.
The other way is to include the patch that adds support for the pcie_rk_bus_scan_delay
kernel parameter:
But that patch is only for 5.9
version of Linux Kernel.