Installing Debian on the ASPEED AST2600 EVB

Debian testing, as of the 5.16.0-3 kernel, has working eMMC and Ethernet such that the stock kernel can be used to install Debian on the eMMC.

These are my notes from memory. Please send me corrections.

Downloading the installer

Visit the Debian installer page and select armhf under ‘other images’:

https://www.debian.org/devel/debian-installer/

Select netboot and download the vmlinuz and initrd.gz files:

wget http://ftp.nl.debian.org/debian/dists/testing/main/installer-armhf/current/images/netboot/vmlinuz
wget http://ftp.nl.debian.org/debian/dists/testing/main/installer-armhf/current/images/netboot/initrd.gz
wget http://ftp.nl.debian.org/debian/dists/testing/main/installer-armhf/current/images/device-tree/aspeed-ast2600-evb.dtb

Netboot

Make a fit image and serve it over tftp:

mkimage -f auto -A arm -O linux -T kernel -C none -a 0x83000000 \
 -e 0 -d vmlinuz -b aspeed-ast2600-evb.dtb -i initrd.gz debian-installer.itb

mv debian-installer.itb /srv/tftp/
Hit any key to stop autoboot:  0
ast# dhcp
ast# tftp 192.168.86.233:debian.itb
ftgmac@1e670000: link up, 1000 Mbps full-duplex mac:92:0d:e5:c8:70:96
Using ftgmac@1e670000 device
TFTP from server 192.168.86.233; our IP address is 192.168.86.244
Filename 'debian.itb'.
Load address: 0x82000000
Loading: #################################################################
         #############
         3.7 MiB/s
done
Bytes transferred = 27020090 (19c4b3a hex)

ast# bootm

The Debian kernel as of v5.16 has support for networking and eMMC, but not SPI NOR. This means you are limited to installing on a nfsroot or on eMMC. I chose eMMC.

After installing

Create a FIT image:

mkimage -f auto -A arm -O linux -T kernel -C none -a 0x83000000 -e 0 \
 -d /boot/vmlinuz -i /boot/initrd.img \
 -b /usr/lib/linux-image-5.16.0-3-armmp-lpae/aspeed-ast2600-evb.dtb \
 /boot/debian.itb

Configure the u-boot environment. This assumes /etc/fw.config is set up.

Set the bootargs to boot from eMMC:

fw_setenv bootargs "console=ttyS4,115200n8 root=/dev/mmcblk0p1 rootwait"
fw_setenv bootcmd "ext4load mmc 0:1 0x81000000 /boot/debian.itb && bootm"

Other tricks

Set the default network device

Linux seems to have trouble with MAC0 on my EVB so I use MAC1. We can set the default network device in u-boot to speed up dhcp:

ast# setenv ethact ftgmac@1e670000
ast# saveenv

Broken ethernet on SMP

The ftgmac100 device has a bug. The patch has not been merged upstream, but can be found here:

https://github.com/openbmc/linux/commit/a35e7e3160af01433212b84b4f61ac889e605126

Some discussion on how to fix it is here:

https://lore.kernel.org/netdev/CAK8P3a1xxefNQqhZN6QWC0-uQ=b7hu4JzoidXt8TgemZFb0ykw@mail.gmail.com/

Configuring fw_setenv

The u-boot-tools package allows setting of the u-boot environment from Linux. It needs to be configured. This config is for u-boot on the SPI NOR:

apt isntall u-boot-tools
cat > /etc/fw_env.config << EOF
/dev/mtd2               0x0000          0x10000
EOF

You can instead place the config on the eMMC. This requires reconfiguring u-boot.

Written on December 16, 2020