27 May 2019, 00:00

H96 Max+ Android box as a Linux server

Share

The H96 Max + is an Android 8.1 box with a Rockchip 3328, 4Gb RAM and 32G or 64G builtin eMMC, it’s the same chipset as the Rock64, it costs around 60 USD.
The only downside of this board is the 100Mb network link, can be a non issue using a USB network adapter.

Here are some notes how to install Arch Linux on the H96 to make it a small server appliance.

Serial Console Pins

Video output won’t work while installing you need to establish a serial connection to the board.

Baudrate 1500000 8N1 3.3V

DTB

DTS/DTB are Device Tree Blob describing the hardware to the kernel.

You can extract the DTB from the Android H96 image but I’m using rk3328-t9.dtb from armbian forum

Unbrick

If you write to mmcblk2 you may override the rockchip firmware located on the eMMC, which will result in a non booting device …

Since this box does not have any reset button you need to short two pins as described in this post.

You also need a male male USB connector (it’s a straight cable, black, green, white and red on both ends).

Shorts the two pins while inserting the USB cable, do not plug the power cable.

Find an image for the H96 somewhere or dump yours, it’s only useful to recover the boot image, then write it to the eMMC with upgrade_tool

sudo ./upgrade_tool uf RK3328-H96MAX+_hs2734_8.1.0_20180823.1108.img

Installation

Prepare an SD card as described in the Rock64 Arch installation.

Note the output of blkid for this partition.

Before unmounting root, create a new file root/boot/boot.txt.

part uuid ${devtype} ${devnum}:${bootpart} uuid
setenv bootargs console=ttyS2,1500000 root=UUID=a3490212-03b6-46a6-9e6b-7733513a3efa storagemedia=emmc rw rootwait earlycon=uart8250,mmio32,0xff130000
setenv fdtfile rockchip/rk3328-t9.dtb

if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/Image; then
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
              fdt addr ${fdt_addr_r}
              fdt resize
              if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
                booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
              else
                booti ${kernel_addr_r} - ${fdt_addr_r};
        fi;
    fi;
fi

Copy the dtb file:

cp rk3328-t9.dtb root/boot/dtbs/rockchip

Update the bootloader:

cd root/boot
mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d boot.txt boot.scr

mkimage is provided by uboot-tools on Arch.

Mainline kernel won’t work properly for now here is a copy ayufan kernel 1187 untar in root/boot

This is a one time thing only…

First boot

Boot with the SD, you should be able to see /dev/mmblck2. It should be safe to write after the block 32768, create a partition, (it’s here I’ve bricked then unbricked mine).

Device         Boot Start       End   Sectors  Size Id Type
/dev/mmcblk2p1      32768 122142719 122109952 58.2G 83 Linux

You can safely perform a normal Arch install on it, then remember to modify the UUID in boot.txt from the SD Card to boot / from the newly created /dev/mmblck2p1 partition, (the SD card is /dev/mmblck0).

Reboot, the SD card is only needed to find the kernel, the rest is read off the eMMC.

Kernel Updates

Until mainline is stable for the rk3328, you can use my updated Arch rockchip ayufan pkg.

mount /dev/mmblck0 /mnt
mount --bind /mnt/boot /boot
cd linux-aarch64-rock64-bin
makepkg -si

Stability

I had tons of issues but it seems it was related to USB 3.0.

I’ve blacklisted video output since it’s not used , create /etc/modprobe.d/video-blacklist.conf

blacklist mali 
blacklist dw_hdmi_i2s_audio

Do not use USB 3 port and you should be fine, (until mainline is stable).

3D Printed rack

Since this board is not standard, I’ve made a 3D printed rack for the H96 and with a support for Rpis/Odroid and Rock64.

Conclusions

It should be possible to boot directly from the eMMC without the SD Card.

This board is incredibly fast and convenient for the price, it’s a perfect target to play with edge clusters.
It’s a bit hacky and I don’t recommend it if you are not ready to debug from a serial console.