Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


Sidebar

products:sbc:vim3:add-ons:m2xeth

VIM3/3L M2X Ethernet

Introduction

This document mainly introduces the usage of Ethernet on M2X . Mainly about how to use it under Linux.

Linux

Please make sure you use the latest image, if not please follow Upgrade The System to upgrade your system.

Linux 4.9

Enable M2X Eth:

Open /boot/env.txt, add m2x-eth to overlay.

$ sudo vim /boot/env.txt
 
overlays=uart3 pwm_f i2c3 os08a10 --> overlays=uart3 pwm_f i2c3 os08a10 m2x-eth
$ sync

Reboot to effect.

Linux 5.15

Enable M2X Eth:

Open kvim*.dtb.overlay.env, add m2x-eth to overlay,take VIM3 as an example.

$ sudo vim /boot/dtb/amlogic/kvim3.dtb.overlay.env
 
fdt_overlays=m2x-eth
$ sync

Reboot to effect.

Check

Get IP addresss.

khadas@Khadas:~$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.100  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::c531:9c16:df20:94f9  prefixlen 64  scopeid 0x20<link>
        ether 02:42:82:4b:1d:2f  txqueuelen 1000  (Ethernet)
        RX packets 113  bytes 13320 (13.3 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 122  bytes 10072 (10.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 14

Go online!

khadas@Khadas:~$ ping www.khadas.com
PING td-balancer-sv5-61-96.wixdns.net (185.230.61.96) 56(84) bytes of data.
64 bytes from 185.230.61.96 (185.230.61.96): icmp_seq=1 ttl=241 time=183 ms
64 bytes from 185.230.61.96 (185.230.61.96): icmp_seq=2 ttl=241 time=164 ms
64 bytes from 185.230.61.96 (185.230.61.96): icmp_seq=3 ttl=241 time=165 ms
...

Android

Enable M2X ethernet via settings

Enter SettingsMore settingsNetwork & InternetEthernet , Switch on Ethernet Port as following

Enable m2x ethernet by kbi command

About KBI usage, you can refer KBI guide, enter the following commands.

kvim3#kbi
kbi - Khadas Bootloader Instructions sub-system
 
Usage:
kbi [function] [mode] [write|read] <value>
 
kbi version - read version information
kbi usid - read usid information
kbi powerstate - read power on state
kbi poweroff - power off device
kbi ethmac - read ethernet mac address
kbi hwver - read board hardware version
 
kbi led [systemoff|systemon] w <off|on|breathe|heartbeat> - set blue led mode
kbi led [systemoff|systemon] r - read blue led mode
 
kbi forcereset [wol|gpio] w <0|1> - disable/enable force-reset
kbi forcereset [wol|gpio] r - read state of force-reset
[notice: the wol|gpio boot trigger must be enabled if you want to enable force-reset]
 
kbi bootmode w <emmc|spi> - set bootmode to emmc or spi
kbi bootmode r - read current bootmode
 
kbi portmode w <0|1> - set port as usb3.0 or pcie
kbi portmode r - read current port mode
kbi ext_ethernet w <0|1> - set ethernet from internal or m2x
kbi ext_ethernet r - read current ethernet mode
kbi tststatus r - read TST status
kbi tststatus clear - clear TST status
 
kbi forcebootsd
kbi wolreset
 
kbi ircode [customer1|customer2] w <ircode>
kbi ircode [customer1|customer2] r
kbi trigger [wol|rtc|ir|dcin|key|gpio] w <0|1> - disable/enable boot trigger
kbi trigger [wol|rtc|ir|dcin|key|gpio] r - read mode of a boot trigger
kvim3#kbi ext_ethernet w 1
[reg_31] 0x1d9a
[reg_16] 0x40
[reg_17] 0x7fbf
[reg_19] 0x0
[reg_31] 0x0
[reg_31] 0xd40
[reg_22] 0x0
[reg_31] 0x0
set m2x ethernet
kvim3#kbi ext_ethernet r
use m2x ethernet
kvim3#
  • kbi ext_ethernet w 1 is to use M2X ethernet
  • kbi ext_ethernet w 0 is to use internal ethernet
2022/07/06 05:12 · frank
Last modified: 2022/07/13 23:44 by frank