Jump to content

[HowTo] Enable PCIe Gen2 to get max speed of NVMe @ RockPi 4b


bofibo

Recommended Posts

 

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

Zitat

max-link-speed = <0x01>;

 

replace it with:

 

Zitat

max-link-speed = <0x03>;

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  [ :ph34r: ]

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"""

Link to comment
Share on other sites

One reason that didn't work may be because it's a mix of the Armbian syntax and the Debian syntax.  It should be:

 

        overlays=[name of overlay]

 

But I see you also used a different maximum speed.  Assuming that's not a typo, you can create a new overlay like this:

 

1.  Save the following (assuming I didn't make any mistakes) as rockchip-pcie-gen2-updated.d2s (wherever):

 

    /dts-v1/;
    /plugin/;
    / {
            model = "ROCK PI 4B";
            compatible = "rockchip,rockpi", "rockchip,rk3399";
            fragment@0 {
                    target = <&pcie0>;
                    __overlay__ {
                            max-link-speed = <0x03>;
                    };
            };
    };
 

2.  Compile it:

 

    dtc -O dtb -o rockchip-pcie-gen2-updated.dtbo rockchip-pcie-gen2-updated.d2s

 

3.  sudo mv rockchip-pcie-gen2-updated.dtbo /boot/dtb/rockchip/overlay

4.  Edit /boot/armbianEnv.txt and add

 

        overlays=pcie-gen2-updated

 

or if you already have a line, add a space and add "pcie-gen2-updated".  Note that you drop both the extension and the rockchip- prefix in the overlays field.

 

If that doesn't work, try changing &pcie0 to &pcie.

Link to comment
Share on other sites

err unless this is specificly different ,, max-link-speed = <01> is pcie gen1  ,, = <02> is pcie gen2  ,, = <03> is pcie gen3

I doubt that rk3399 can do gen3

But if it works ......

------more----

What you probably have happening is 2 lanes at pcie2 ... to find out..

lspci -nn (to get the bus #, somethiing like 00:00.0,,, then)

lspci -s <bus#> -vvv|grep -i speed

 

Edited by wdtz
more info
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines