I will show you how I successfully enabled pcie gen2 on my Rock Pi 4b and now my nvme is running at 1.1 GB/s.
The solution which you can find on the web to activate pcie gen2 on an Armbian did NOT work for me:
sudo nano /boot/armbianEnv.txt
and insert:
dtoverlay=pcie-gen2
The following solution activated pcie gen2:
0. check your current nvme speed to compare it afterwards with:
sudo dd if=/dev/nvme0n1 of=/dev/null bs=1M count=2048 iflag=direct status=progress
--> 618 MB/s
1. find out which rk3399-rock-pi-xxx.dtb your Rock Pi 4 is using.
cat /boot/armbianEnv.txt | grep fdtfile
--> fdtfile=rockchip/rk3399-rock-pi-4b.dtb
--> In my example I will use rk3399-rock-pi-4b.dtb
2. make a backup of your *.dtb file
sudo cp /boot/dtb/rockchip/rk3399-rock-pi-4b.dtb /boot/dtb/rockchip/rk3399-rock-pi-4b.dtb.bak
3. copy *.dtb to /tmp
sudo cp /boot/dtb/rockchip/rk3399-rock-pi-4b.dtb /tmp/rk3399-rock-pi-4b.dtb
4. we need to make *.dtb into *.dts to edit it
sudo dtc -I dtb -O dts -o /tmp/rk3399-rock-pi-4b.dts /tmp/rk3399-rock-pi-4b.dtb
(4b). If you don't have dtc on rockpi than install it with:
sudo apt-get install device-tree-compiler
5. edit *.dts
sudo nano /tmp/rk3399-rock-pi-4b.dts
search with [Ctrl + w] for the string: max-link-speed
you will find something like this
replace it with:
save your file
6. turn *.dts into *.dtb
sudo dtc -I dts -O dtb /tmp/rk3399-rock-pi-4b.dts -o /tmp/rk3399-rock-pi-4b.dtb
7. copy new *.dtb to /boot/dtb/rockchip
sudo cp /tmp/rk3399-rock-pi-4b.dtb /boot/dtb/rockchip/rk3399-rock-pi-4b.dtb
8. give the file the same rights as before
sudo chmod 0755 /boot/dtb/rockchip/rk3399-rock-pi-4b.dtb
REBOOT
Now check your vnme speed again and if everything worked you should see 1.0 GB/s [ ]
sudo dd if=/dev/nvme0n1 of=/dev/null bs=1M count=2048 iflag=direct status=progress
--> 2134900736 bytes (2.1 GB, 2.0 GiB) copied, 2 s, 1.1 GB/s
"""THERE WE HAVE THE SALAD"""
"""B0F1B0"""