There are two GPIO buttons on the MBLX2160A. They are bound to the gpio-keys driver, and can be tested with the evtest tool.
Reference | Button |
---|
The buttons are available in the sysfs via the device and can be tested with the evtest tool.
“|button_device=”/dev/input/event0“|button_test=“evtest /dev/input/event0”}}
The MBLX2160A provides the CAN interfaces CAN0 and CAN1.
DIP switches SW2 and SW3 are used to configure the CAN interfaces CAN0 and CAN1.
Function | SWx-1 | SWx-2 |
---|---|---|
CAN-Bus not terminated | OFF | OFF |
not defined (illegal state) | OFF | ON |
not defined (illegal state) | ON | OFF |
CAN-Bus terminated with 120 Ohm | ON | ON |
“{{ :en:layerscape:tqmlx2160a:linux:yocto:tqmlsx210a_can_loopback.png?nolink&400 |
candump can0& cansend can1 5A1#11.2233.44556677.88
candump can1& cansend can0 5A1#11.2233.44556677.88
”}}
The STKLX2160A provides ten 10/100/1000 Ethernet Interfaces, two 10 Gbit Ethernet Interfaces and one 100 Gbit Ethernet Interface.
The RCW Configuration specifies the Ethernet Configuration. The following SerDes Protocols are configured in the default Image.
SerDes Block | SerDes Protocol |
---|---|
1 | 14 |
2 | 11 |
3 | 2 |
For the default SerDes (14-11-x) configuration, the Ethernet interfaces are assigned as follows:
X14 | X29 | X6/X8 | X10 | X11 | X12 | X13 | |||||||
DPMAC17 | DPMAC16 | DPMAC14 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DPMAC18 | DPMAC12 | DPMAC13 |
For the default SerDes (12-7-x) configuration, the Ethernet interfaces are assigned as follows:
X14 | X29 | X6/X8 | X10 | X11 | X12 | X13 | |||||||
DPMAC17 | DPMAC16 | DPMAC10 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DPMAC18 | DPMAC12 | DPMAC9 |
The Ethernet interfaces are managed via DPAA2 and not configured by default. The interfaces have to be configured in Linux:
ls-addni dpmac.X
Example configuration of DPMAC17:
ls-addni dpmac.17
Afterwards you can save the configuration to a dts file with:
restool dprc generate-dpl dprc.1 > <my_dpl>.dts
To generate a dtb file you have to use
dtc -I dts -O dtb <my_dpl>.dts -o <my_dpl>.dtb
Copy the generated dtb file to the boot partition (/dev/mmcblk0p1) and change in U-Boot the name of the dts_file variable to your dtb file name with
setenv dpl_file <my_dpl>.dtb saveenv
To check which DPMAC device is routed to which ETH device the following command can be used:
ls-listni
In U-Boot eth0 is configured as default interface. The IP configuration can be done statically or by a DHCP server in the network.
IP configuration via DHCP
For a configuration via a DHCP server, use the dhcp
command in U-Boot.
Static IP configuration For a static IP configuration the following, U-Boot environment variables must be set:
setenv ipaddr <ipaddr> (e.g.: setenv ipaddr 192.168.100.111) setenv netmask <netmask> (e.g.: setenv netmask 255.255.255.0)
The ethernet configuration in Linux is determined by the DPL file. The ethernet interfaces are activated in Linux.
For a temporary static configuration the ip command can be used, below some useful ip commands are listed:
Activate a specific interface
e.g. eth0
ip link set eth0 up
Disable a specific interace
e.g. eth0
ip link set eth0 down
Show ip address for a specific interface
e.g. eth0
ip addr show eth0
Show statistic for a specific interface
e.g. eth0
ip -s link show eth0
Set ip address for a specific interface
e.g. eth0
ip addr add 192.168.1.100/24 dev eth0
Show statistic of all interfaces
ip -s link
Set default gateway for a specific interfaces
e.g. set gateway ip 192.168.1.1 for eth0
ip route add default via 192.168.1.1 dev eth0
If a DHCP server is available in the network environment the ip configuration can be received from it. To do so execute the udhcpc
command, by default eth0 is used.
To configure another interface via dhcp the parameter -i
followed by the interface name e.g. eth1 must be given.
e.g. eth1
udhcpc -i eth1
An overview of the onboard i2c devices is available here
Select i2c bus device
i2c dev [0,4,8,9,10]
Show all devices connected to the i2c bus currently selected:
i2c probe
Detect all devices connected to a i2c bus:
i2cdetect [0,1,5,9,10]
To set the hardware clock to the actual time and date use the following commands:
date -s [YYYY.]MM.DD-hh:mm[:ss] hwclock -w
@temp_description@ @temp_sensors@
With lsusb
you can see all connected usb devices. To mount a partition of an usb stick you can excute mount /dev/<partition> <mount dir>
(e.g. mount /dev/sdb1 /mnt)
. This will mount the first partition of sdb to /mnt. To unmount the device execute umount <mount dir>
(e.g. umount /mnt
).
The MBLX2160A has two user controllable LEDs, the behavior of these LEDs can be selected by several triggers.
Reference | LED name | color | linux filesystem |
---|
“{{ :en:layerscape:tqmlx2160a:linux:yocto:mblx2160a_user_led.png?nolink&400 |
The user LED's are located in .
To change the behaviour a specific LED, the value in the file trigger must be overwritten.
The following values are valid:
For example set the trigger of to heartbeat
echo heartbeat >
“|userled_location=”/sys/devices/platform/leds/leds/“|led_example=“led:user1”|userled_example=”/sys/class/leds/led\:user1/trigger“}}