RockPro64 with PCIe slot

How old is your u-boot version? You need to fairly new one 2021.07 or newer if I recall correctly, there are also issues with 4k displays (I've only used 1080p and below). If you have (at least cheap adapters) you might also run into issues, https://wiki.freebsd.org/arm/RockChip#Known_issues

PCIe Gen2 training very sensitive from what I recall, it seems to work on my boards at least but I would imagine it's highly dependent on device being used.
Code:
igb0@pci0:1:0:0:        class=0x020000 rev=0x01 hdr=0x00 vendor=0x8086 device=0x1521 subvendor=0x1734 subdevice=0x11cf
    vendor     = 'Intel Corporation'
    device     = 'I350 Gigabit Network Connection'
    class      = network
    subclass   = ethernet
    cap 01[40] = powerspec 3  supports D0 D3  current D0
    cap 05[50] = MSI supports 1 message, 64 bit, vector masks
    cap 11[70] = MSI-X supports 10 messages, enabled
                 Table in map 0x1c[0x0], PBA in map 0x1c[0x2000]
    cap 10[a0] = PCI-Express 2 endpoint max data 128(512) FLR RO NS
                 max read 512
                 link x2(x4) speed 2.5(5.0) ASPM disabled(L0s/L1)
    ecap 0001[100] = AER 2 0 fatal 0 non-fatal 2 corrected
    ecap 0003[140] = Serial 1 001999fffffe8651
    ecap 000e[150] = ARI 1
    ecap 0010[160] = SR-IOV 1 IOV disabled, Memory Space disabled, ARI disabled
                     0 VFs configured out of 8 supported
                     First VF RID Offset 0x0180, VF RID Stride 0x0004
                     VF Device ID 0x1520
                     Page Sizes: 4096 (enabled), 8192, 65536, 262144, 1048576, 4194304
    ecap 0017[1a0] = TPH Requester 1
    ecap 0018[1c0] = LTR 1
    ecap 000d[1d0] = ACS 1

I'd be happy to add any PCIe you test on your RockPro64 success or failure, just send me a PM of what you've tested etc.
You can look at the table to determine required information, https://wiki.freebsd.org/arm/RockChip#Tested_PCIe_devices_on_RockPro64
 
I see my PCIe bus is only running at GEN1 and GEN2 is possible. Anybody figure this out?
Mine shows Gen2 for NVMe:
Code:
nda0: nvme version 1.2 x4 (max x4) lanes PCIe Gen2 (max Gen3) link
nda0: 244198MB (500118192 512 byte sectors)

Probably because of "max-link-speed". Don't know if it has real impact on performance.
Code:
grep -A5 pcie0 my.dts
&pcie0 {
        bus-scan-delay-ms = <1000>;
        ep-gpios = <&gpio2 RK_PA4 GPIO_ACTIVE_HIGH>;
        max-link-speed = <2>;
        num-lanes = <4>;
        pinctrl-names = "default";
 
Yes I actually saw somebody using an overlay for GEN2 PCIe when researching.
That is why I asked.
Looking at U-boot I see nothing about PCIe link speeds in either pci or nvme .

Which brings me to my next question:
What is your source for DTS overlays on RockPro64. I see some for rockchip64 and rk3399?
I see sources for RockPi4 overlays from Raxda that might work.

I want to add some goodies via overlay starting with one-wire.
 
From that I found my second LED.
Code:
diy_led: led-1 {
            label = "diy";
            default-state = "off";
            gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;

So gpioctl -f /dev/gpioc0 -t 2 or shorthand (because gpioc0 is default bus) gpioctl -t 2
It is already set to an OUTPUT and is ready to use. It controls the Red LED right next to the White LED.
 
I am compiling a custom kernel. Stripped out anything but rk3399 from GENERIC arm64 kernconf.
Stupidly I forgot to use the -j flag.
How many cores do I have? Is it really 6 or 4+2? 4 rockchip cores plus 2 cortez cores?
What should I use for optimal compiling?
 
I am getting down to the nitty gritty now decompiling the dtb
dtc -I dtb -O dts rk3399-rockpro64.dtb > rk3399-rockpro64.dts

Looks like kernel compiling caught all 6 cores too.
Code:
>>> Kernel build for ROCKPRO64 completed on Sun Oct 23 21:19:57 EDT 2022
--------------------------------------------------------------
>>> Kernel(s)  ROCKPRO64 built in 13058 seconds, ncpu: 6
--------------------------------------------------------------
 
I have a starting point for OneWire overlay on Header Pin 15. GPIO1_A1

rockpro64-w1-gpio.dts
Code:
/dts-v1/;
/plugin/;

/ {
    compatible = "rockchip,rk3399";
    fragment@0 {
        target-path = "/";
        __overlay__ {
            w1: onewire@0 {
                compatible = "w1-gpio";
                pinctrl-names = "default";
                gpios = <&gpio1 1 0>;
                status = "okay";
            };
        };
    };
};

dtc -O dtb -o /boot/dtb/overlays/rockpro64-w1-gpio.dtbo -@ rockpro64-w1-gpio.dts

Add your loader settings:
/boot/loader.conf
Code:
ow_load="YES"
owc_load="YES"
ow_temp_load="YES"
fdt_overlays="rockpro64-w1-gpio.dtbo"

Reboot and check the output:

Code:
sysctl -a | grep ow_temp
ow_temp0: <Advanced One Wire Temperature> romid 28:ee:6c:0c:20:16:01:8a on ow0
dev.ow_temp.0.parasite: 0
dev.ow_temp.0.reading_interval: 10000
dev.ow_temp.0.badread: 0
dev.ow_temp.0.badcrc: 25
dev.ow_temp.0.temperature: 22.812C
dev.ow_temp.0.%parent: ow0
dev.ow_temp.0.%pnpinfo: romid=28:ee:6c:0c:20:16:01:8a
dev.ow_temp.0.%location:
dev.ow_temp.0.%driver: ow_temp
dev.ow_temp.0.%desc: Advanced One Wire Temperature
dev.ow_temp.%parent:
 
I had to recompile kernel and it is much quicker using 6 cores.
Code:
--------------------------------------------------------------
>>> Kernel build for ROCKPRO64 completed on Mon Oct 24 19:02:44 EDT 2022
--------------------------------------------------------------
>>> Kernel(s)  ROCKPRO64 built in 2710 seconds, ncpu: 6, make -j6
--------------------------------------------------------------
 
I have a bench-top adjustable DC Power Supply with meters.
My RockPro64 is using .3 amps at 12VDC at bootup and during kernel compile it spikes at .4A.
I was expecting much more with NVMe.

Rigging up Meanwell DRC-40A with 12V-3.4ah SLA battery and I wanted to get a grip on power consumption.
 
Back
Top