VIM3[L] : Request Linux USB OTG device mode overlay

Could we add an overlay “otg-device.dts” to fenix kernel so users can activate the device mode without changing the kvim3[l]_linux.dts. the following overlay has been tested and is working for me.

/dts-v1/;
/plugin/;

/ {
fragment@0 {
target = <&dwc2_a>;

            __overlay__ {
                    controller-type = <2>;
            };
    };

};

2 Likes

Hello @shyAm

Thanks for your suggestions. We will add this to kernel. :wink:

3 Likes

For vim3 as well please ! :blush:

2 Likes

Thank you @numbqq . I can confirm the overlay has been added and working.

For anyone waiting for this update.

$ sudo apt update && sudo apt dist-upgrade -y

Enable the option in /boot/env.txt
overlays=uart3 pwm_f i2c3 os08a10 otg-device

2 Likes

@shyAm are you using a USB-C dock of sorts to use the USB-C port, or direct USB-C peripherals ?

@Electr1, I am using one of the following based on my needs

  • Direct to Desktop/Laptop for VIM3L (no fan and TS050) with Android/Linux
  • Using Dell Dock that supports either Type-C (1.5/3 A), Type-A (1.5A)
  • After market Hub that supports either Type-C (1.5/3 A), Type-A (1.5A)
  • Finally in-house multi-port Hub with PD (45W), Type-C (1.5/3 A), Type-A(2.4A)
1 Like

@numbqq,

I want to point out that android u-boot built from khadas-vims-pie branch and flashed to EMMC would not load the overlays for VIM3L Linux booting from SD/USB.
– u-boot log –

Apply dtbo uart3
reading /dtb/overlays//uart3.dtbo
** Unable to read file /dtb/overlays//uart3.dtbo **
Apply dtbo pwm_f
reading /dtb/overlays//pwm_f.dtbo
** Unable to read file /dtb/overlays//pwm_f.dtbo **
Apply dtbo i2c3
reading /dtb/overlays//i2c3.dtbo
** Unable to read file /dtb/overlays//i2c3.dtbo **
Apply dtbo otg-device
reading /dtb/overlays//otg-device.dtbo
** Unable to read file /dtb/overlays//otg-device.dtbo **

The reason is the bootscript(s) is looking for hostname=KVIM3L to set overlaydir to kvim3l.

The hostname in android u-boot is set to
#define CONFIG_HOSTNAME arm_gxbb

whereas the hostname in u-boot-khadas-vims-v2015.01 is set to
#define CONFIG_HOSTNAME KVIM3L

I think this block in the bootscript(s) should be revisited to support for various scenarios

setenv uboottype “vendor”;
if test “X${maxcpus}” = “X4”; then
if test “X${hostname}” = “XKVIM3L”; then
setenv khadas_board “VIM3L”;
setenv overlaydir “kvim3l”;
else
setenv khadas_board “VIM1”;
setenv overlaydir “kvim”;
fi;
else if test “X${maxcpus}” = “X8”; then
setenv khadas_board “VIM2”;
setenv overlaydir “kvim2”;
else if test “X${maxcpus}” = “X6”; then
setenv khadas_board “VIM3”;
setenv overlaydir “kvim3”;
fi;fi;fi;

For my purposes I just added setenv overlaydir "kvim3l" in the beginning of the bootscript.

3 Likes

Hello @shyAm

Thanks for your feedback, you are right, we will fix this.

1 Like

Hello @shyAm

I have send a patch to fix this issue, you can update your code and try again.

2 Likes