A20-OLinuXino-MICRO Rev. J no modern/mainline kernel

Started by fromcologne, July 11, 2017, 07:57:05 PM

Previous topic - Next topic

fromcologne

My last order I got an new hardware revision A20-OLinuXino-MICRO Rev. J.

Because of a new LAN Phy this board is not supported by Armbian Images I use on other A20-OLinuXino-MICRO.
The Olimex Debian image has a quiet old kernel 3.4.103.
With this kernel an upgrade to Debian Stretch was very difficult because systemd wants some modern kernel features. I had to patch the file
/etc/systemd/system/multi-user.target.wants/NetworkManager.service
because of this.

The developer of the Armbian images answers my question that he can´t offer a new kernel, because the patch file by Olimex doesn´t work. I tested the last version 5.30. Ethernet doesn´t  work.

Any idea when we will get an modern kernel for the rev. J boards?

SR-Digitronic

Mainline Linux does not fully support A20 yet: http://linux-sunxi.org/Linux_mainlining_effort#Status_Matrix (4.13 and 4.14 are not yet released)

That page says: HDMI support is work in progress and only SLC NAND is supported, but MICRO-n4GB/-n8GB use MLC NAND

A further problem with NAND is, that the new driver works completely different from the old one (block device vs MTD). But the Allwinner U-Boot (the bootloader) uses the NAND like a block device. Linux would need to use ubifs, U-Boot had to use vfat and both wouldn't be able to read the partition of the other. Mainline U-Boot is not yet able to use and boot from NAND.

igorpec

Support for Micro revision J has just been merged into Armbian. No prebuild images at the moment, but it's possible to build them from main build repository: https://github.com/armbian/build

Debian Stretch is also possible to build, but it's not very well tested and it remains hidden under parameter EXPERT="yes"
linux for ARM development boards
www.armbian.com

LubOlimex

<<< ...Because of a new LAN Phy this board is not supported by Armbian Images I use on other A20-OLinuXino-MICRO... The developer of the Armbian images answers my question that he can´t offer a new kernel, because the patch file by Olimex doesn´t work. I tested the last version 5.30. Ethernet doesn´t  work.

The new controller has an extra pin called ETXERR, which is connected to processor's pin C13 (PA17). When ETXERR is in high position it means error. This line is pulled-up and this indicates error, the problem is that the current drivers doesn't take care of ETXERR and until a better driver gets available you'd need to set ETXERR to low position manually.

There is an easy workaround to enable the new Ethernet controller in Armbian. Just set GPIO 17 to low position:

echo 17 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio17/direction
echo 0 > /sys/class/gpio/gpio17/value

You can edit the dtb dts definitions so that GPIO gets set to low position each time in your image. If you don't know how to edit the dtb dts file you can put the above three lines of code in local.rc file or other start-up script so they would execute automatically on reboot.
Technical support and documentation manager at Olimex

gregh

I needed a working network already in initramfs for dropbear. Since custom dts/dtb compilation might infer with mainline debian kernel updates, I made a initramfs-tools script to set the pin to 0:

root@schubert:/usr/share/initramfs-tools/scripts/init-top# cat net-eth0.conf
#!/bin/sh

echo "eth set gpio 17 to 0"
echo 17 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio17/direction
echo 0 > /sys/class/gpio/gpio17/value


JFP_FR

#5
Thank you for this information, it's a great help for us.

I am not able to correct myself the A20 micro image in buildroot, but I've added the commands to fix ethernet issue with success in the file:
/etc/init.d/S40network

Here's the new S40network file with modification in red:

# cat /etc/init.d/S40network
#!/bin/sh
#
# Start the network....
#
# Debian ifupdown needs the /run/network lock directory
mkdir -p /run/network

echo "eth set gpio 17 to 0 for Ethernet A20 rev J"
echo 17 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio17/direction
echo 0 > /sys/class/gpio/gpio17/value

case "$1" in
  start)
        printf "Starting network: "
        /sbin/ifup -a
        [ $? = 0 ] && echo "OK" || echo "FAIL"
        ;;
  stop)
        printf "Stopping network: "
        /sbin/ifdown -a
        [ $? = 0 ] && echo "OK" || echo "FAIL"
        ;;
  restart|reload)
        "$0" stop
        "$0" start
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac

exit $?
[/i]

#

our version:

# uname -a
Linux a20-olinuxino 4.12.0 #2 SMP PREEMPT Tue Feb 13 15:37:58 CET 2018 armv7l GNU/Linux

ilya0606