# AMX MST701 Reverse Engineering The [AMX MST701](https://www.amx.com/en/products/mst-701) is a nice little tablet intended for media control in conference rooms. It features a nice full-color TFT, a speaker, and touchscreen for user input, all powered over PoE. This repository aims to document the hardware to allow repurposing as this device has now reached its end of life. ## Hardware * LCD: Custom 1024x600 full-color TFT, connected over LVDS * Touchscreen: TSC2048, connected over SPI * Ethernet: AX88772BLF, connected over USB (usbh1) * Ethernet (unused): SMSC8720A, connected via (R)MII+SMI * USB: Internal USB-OTG port _or_ External USB-A port (via usbotg) * Audio: SGTL5000 + Speaker amp + Microphone, connected over i2s/i2c * Power: TPS65150, DA9053 * CPU: i.MX53 (single-core @ 1 GHz) * RAM: 512 MB, 327 MB usable (rest is for GPU/VPU) * Storage: 4 GB Micro-SD card * Power: PoE * Misc: Power/User button on the top right, LED notification lights (unpopulated) * Misc dev: Debug LED on SoM, UART header on J3: \[?, TX, GND, RX\] Note: The "generic" system components are placed on a little SoM mounted on the main PCB. ## Original Software The original system runs on an ancient 2.6 kernel, with a giant monolithic binary for the official functionality. Audio runs through ALSA, display output is directly written to the framebuffer/DRM. The system is booted by a heavily modified U-Boot that also appears a little broken (e.g. passing kernel arguments doesn't really work). ### How to Explore? * Passive: Open the device, grab the SD card, browse. * Active: Remove the SD card, patch the root login password, boot the system, log in over serial. See (uncurated) details in [notes.md](notes/notes.md) and [misc files](notes/). ## Running Custom Linux All system components have mainline Linux support. The necessary device tree can be found in `linux`. To set up your custom SD card, follow these steps: 1. Write `linux/sd_card_head.img` to an SD card. 2. Partition the SD card as needed for your distribution, keeping a 40 MB space before the first partition 3. Write rootfs to SD card (e.g. [ArchLinuxArm](http://fl.us.mirror.archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz)) 4. Compile Linux kernel (see below) and use `scripts/flash_sd.sh /dev/sdX` to flash kernel to the SD card (it goes into that "empty" 40 MB space) 5. Copy Linux kernel modules to rootfs For future updates via SSH, look into `scripts/upload_and_flash.sh`. ### Compiling Linux * Make sure to include the full cmdline hardcoded in the kernel as the U-Boot is a little flaky: * `console=ttymxc0,115200 root=/dev/mmcblk0p1 rw fbcon=rotate:2` * or for debugging: `earlyprintk=serial,ttymxc0,115200 console=ttymxc0,115200 root=/dev/mmcblk0p2 rw fbcon=rotate:2 loglevel=7` * Make sure to include all drivers for the hardware * Copy and compile the device tree provided in `linux/imx53-amx-mst701.dts` to the kernel dir and add it to the build system. * Use build script `scripts/build.sh` to build a patched uImage with DTB attached to the kernel ## Open Issues * Not yet implemented * Backlight (configured active by bootloader for now) * Notification LEDs (not populated on HW anyways) * Broken * Touchscreen mapping is off (offset and skewed), prossibly fixable in libinput via transformation matrix. * Speaker-amp (gpiochip4,2) not turned on automatically (needs to be activated using gpioset for now)