Based on work by naxalite, wth, frontalot, and noName.
Originally by frontalot.
The MIPSel LS2 actually does not contain an AVR (other LS versions do). AVRs are microcontrollers from Atmel and an Atmel brand, while the LS2 contains a Freescale (Motorola) microcontroller MC68HC908JL8, which is based upon the Motorola 6808 microprocessor, which is a decendant of the classic Motorola 6800 microprocessor, first released in 1975 at the dawn of microprocessors.
The microcontroller serves the same purpose as the AVRs in other LinkStation models. It controls much of the LinkStation hardware, including the power button and LED indicator. It is controlled by the commands sent to /dev/ttyS0.
To send commands to the microcontroller use e.g.:
echo -n "commands" > /dev/ttyS0
|\30\30\30\30||Stops smbd and atalkd if /dev/hda3 is not mounted to /mnt. Sent by /www/script/melsub_diskcheck.sh.|
|[[[[||Starts slowly blinking power LED (sleep).|
|]]]]||High-speed cooling fan rotation.|
|\\\\||Low-speed cooling fan rotation.|
|>>>>||Unknown. Sent by mc_ctld on boot.|
|AAAA||Unknown. Sent by mc_ctld on boot.|
|CCCC||Sent by shutdown -r now (reboot).|
|EEEE||Sent by shutdown -h now (halt).|
|FFFF||Unknown. Sent by mc_ctld on boot.|
|JJJJ||Unknown. Sent by mc_ctld on boot.|
|KKKK||Unknown. Sent by mc_ctld on boot.|
|QQQQ||Unknown. Sent by mc_ctld on set timer.|
|RRRR||End of clear flash memory.|
|SSSS||Start of clear flash memory and /www/script/melsub_init.sh. Sent by /www/script/melsub_flash.sh.|
|TTTT||Flash memory update completed (stops blinking power, disk full, and diagnostic LEDs).|
|UUUU||Flash memory update started (starts blinking power, disk full, and diagnostic LEDs).|
|VVVV||Turns off disk full LED.|
|WWWW||Turns on disk full LED.|
|XXXX||Stops blinking disk full LED.|
|YYYY||Starts blinking disk full LED.|
|ZZZZ||Stops slowly blinking power LED. Sent by mc_ctld.|
|gggg||Diagnostic LED blinks 3 times and system shutdown (partition error).|
|iiii||Diagnostic LED blinks 4 times and system shutdown (cooling fan error).|
|kkkk||Diagnostic LED blinks 5 times and system powers off (flash memory error).|
|mmmm||Diagnostic LED blinks 6 times and system shutdown (hard drive or mc_ctld error).|
|oooo||Diagnostic LED blinks 7 times and system shutdown (RAM, NIC, or HDD controller error).|
Most of this information courtesy of http://www.yamasita.jp/linkstation.en/index.html.
For an in depth description of the pin functions of the microcontroller see Kuroguy's analysis of the pin functions