Since radxa release the Rock 5B, I had been considering its ability to work as NAS to replace my RK3399 NAS used for years.
To make the most from the board, I would like to have:-
- 10Gbps network ability
- RAID 1 3.5" HDD with fast SSD to saturate the bandwidth
- potential usage of ZFS
- installation of OMV for NAS usage.
- small footprint as a NAS
However, it took me nearly a year to get all these done
The whole set-up is housed inside a 5x 3.5" HDD cage, including Rock 5B, 2x 3.5 HDD, 1x 2280 nvme ssd, 10G NIC w/adaptor, 12V -5V regulated power supply and PWM-controlled 12V cooling fan – one 12V dc supply cable, one 10G spf+ cable and that’s it
First of all is the bandwidth. Rock 5B provided a 4 lanes PCIe 3.0 m-key m2 slot which in theory providing a bandwidth of 8GT/s x4, a total of 32GT/s, which is roughly 4GB/s if saturated.
There is another 1 lane PCIe 2.1 e-key m2 slot which I use it for SATA extension board for the 2x 3.5" HDD at 500MB/s.
To have a decent NAS with 10G NIC, I hope this board can work with ~ 1GB/s during file transfer.
The only hope to get two 1GB/s file transfer working would be bifurcation of PCIe 3.0 lanes form x4 into x2 + x2, which should be supported by RK3588 SoC.
This turn out to be the easiest part, as @Semi was generous enough to share us his hardwork from another thread and on altium.
Altium
Thread
However, to get the bifurcation work, the armbian path is not working since their mainline kernel is too advanced and not working with the bifurcation. After repeated trial of kernel recompilation, the kernel can only recognized the device in the first two lanes of the bifurcation board, this lead me back to Radxa official image.
With this image at kernel 5.10, we need to modify the Device Tree Sources to tell the kernel the PCIe 3.0 phy is running at bifurcation mode.
For a better reference, I would hereattach the dts I’ve used which could successfully load both of the PCIe slots.
rk3588-rock-5b.zip (5.1 KB)
For manual editing, I’ve altered ./linux/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts
You will need to modify the following nodes:-
&pcie30phy {
rockchip,pcie30-phymode = <PHY_MODE_PCIE_NANBNB>; /* 3 modes available, x4, x2+x2, x1+x1+x1+x1*/
status = “okay”;
};
&pcie3x2 {
reset-gpios = <&gpio4 RK_PB4 GPIO_ACTIVE_HIGH>; /* check your gpio pin for prst*/
vpcie3v3-supply = <&vcc3v3_pcie30>;
rockchip,perst-inactive-ms = <1000>;
supports-clkreq;
max-link-speed = <3>; /* PCIe speed */
status = “okay”;
};
&pcie3x4 {
num-lanes = <2>; /* limit lanes for 2x+2x bifurcation*/
reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>; /* check your gpio pin for prst*/
vpcie3v3-supply = <&vcc3v3_pcie30>;
rochchip,perst-inactive-ms = <1000>;
supports-clkreq;
max-link-speed = <3>;
status = “okay”;
};
Now we have both the PCIe slots detected in kernel. Please note that the current bifurcation board does not support NVME SSD to operate simutaneously in both slots. (disk will drop out when copying data between them) I suspected it could not provide sufficent 3.3V power for both SSD to operate and additional power shall be required if you want to do so.
Nevertheless, we need an adapter to fit PCIe slot NIC into m-key m2 slot.
This is the adapter I’ve used in this setup
Please note that the adapter actually require additional power input for 12V through the small 4pin plugs while drawing 3.3V directly from Rock5B. The NIC won’t be detected without 12V inputs.
Now we need to choose the NIC. I’ve tested quite a few 10NIC on hands, including Mellanox CX341 (mlx4), CX4411 (mlx5), Intel X520 (ixgbe) and Boardcom Blade Engine 3 (be2net). Most of them have bandwidth/ compatibility problem due to PCIe (Details refer to this thread) except CX4411 in my setup.
All these kernel modules were included in the NAS image.
For the NIC, I take some second hand OCP 10G NICs at good price, but make sure you use a proper adapter for OCP to PCIe.
Always choose the one with 5V converter and make sure no 12V goes into 5V. I’ve burnt a CX4411 for that