OTG on Rock Pi E

Jerry from the WLAN Pi team managed to enable OTG on the Rock Pi E running Armbian. Here are his instructions for everyone’s reference:

Convert DTB to DTS

sudo dtc -I dtb /boot/dtb/rockchip/rk3328-rock-pi-e.dtb -O dts -o /boot/dtb/rockchip/rk3328-rock-pi-e.dts

Modify rk3328-rock-pi-e.dts

sudo nano /boot/dtb/rockchip/rk3328-rock-pi-e.dts

Locate section usb@ff580000

    usb@ff580000 {
            compatible = "rockchip,rk3328-usb\0rockchip,rk3066-usb\0snps,dwc2";
            reg = < 0x00 0xff580000 0x00 0x40000 >;
            interrupts = < 0x00 0x17 0x04 >;
            clocks = < 0x02 0x14d >;
            clock-names = "otg";
            dr_mode = "host";
            g-np-tx-fifo-size = < 0x10 >;
            g-rx-fifo-size = < 0x118 >;
            g-tx-fifo-size = < 0x100 0x80 0x80 0x40 0x20 0x10 >;
            phys = < 0x5a >;
            phy-names = "usb2-phy";
            status = "okay";
            phandle = < 0x9d >;
    };

Modify dr_mode

Change
dr_mode = “host”;
To
dr_mode = “otg”;

Convert DTS file back to DTB format

sudo dtc -I dts /boot/dtb/rockchip/rk3328-rock-pi-e.dts -O dtb -o /boot/dtb/rockchip/rk3328-rock-pi-e-rev01.dtb

Add DTB to armbianEnv.txt

sudo nano /boot/armbianEnv.txt

Add the following line

fdtfile=rockchip/rk3328-rock-pi-e-rev01.dtb

Should look like this - armbianEnv.txt

verbosity=1
bootlogo=false
overlay_prefix=rockchip
rootdev=UUID=8a77dff9-013f-4a2f-8c9b-4e2c0afb076d
rootfstype=ext4
console=serial
overlays=i2c7 i2c8
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
fdtfile=rockchip/rk3328-rock-pi-e-rev01.dtb

Add g_ether module

sudo nano /etc/modules

Add the following to /etc/modules

g_ether

Reboot and OTG should be working!

Cc: @igorp

3 Likes