About this driver
=================

This driver allows you to upload / download and delete pictures from
appotech ax203 and ax206 based picture frames. This are small, cheap
picture frames with a 1.1, 1.5, 1.8 or 2.4 inch display and a USB id of:
1908:0102
1908:1315
1908:1320

ax203 based frames present themselves as a usb mass storage cdrom, which
contains the windows software. Communication with the device happens by
issuing special (custom) scsi commands. This driver uses the special
"usbscsi" port driver, which allows sending the custom scsi commands.

Note that if your ax203 frame has a usb-id of 1908:1315, you need to tell
Linux not to touch the HID device this version also presents in its USB
descriptor, otherwise the frame gets confused and resets.
Here is a kernel patch for this:
http://marc.info/?l=linux-usb&m=126985692106903

Alternative one could add the following on the linux kernel cmdline:
usbhid.quirks=0x1908:0x1315:0x4
But that does not help as it triggers this bug:
http://www.spinics.net/lists/linux-input/msg07870.html

Also if you have a 1908:1315 or 1908:1320 frame, these will work better
(faster, no reset errors in dmesg), if you do the following as root, before
plugging them in:
modprobe usb-storage
echo 1908:1315:b,1908:1320:b > /sys/module/usb_storage/parameters/quirks

A patch for this is on its way upstream (7th april 2010).


About the ax203 access protocol
===============================

The scsi commands for these devices was reverse engineered by several people,
the ax203 camlib builds on top of their work, see:
http://picframe.spritesserver.nl/wiki/index.php/Talk:HK_Unbranded_with_AppoTech_chipset

The protocol consists of directly sending SPI commands to and from the SPI
flash inside these devices, giving very raw access to the flash chip
For example you need to do separate erase and program commands, and
as an erase block is larger then what you program in a single program command
you must make sure to always reprogram the entire range the single erase
command cleared (and read the entire range before clearing, so you can write
it back).

In order to be sure we are sending the right commands the ax203 driver starts
by reading the SPI flash's ID string, and if this is unknown it refuses to
work. In this case please do "gphoto2 -L --debug 2> log" and mail me
the log file.


About the ax203 image compression
==================================

The ax203 family of picframe controllers actually comes with 3 different
flavors of compression, see README.ax203-compression.


Random ax203 notes
==================

Firmware versions 3.3.x and 3.4.x frames have a 2nd Parameter block at
ABFS start + 0x1000, about which the following is known:
bytes 4-5: 16 bit rgb 5-6-5 color value for menu background, big endian
bytes 6-7: 16 bit rgb 5-6-5 color value for menu text, big endian
byte 0xffe: 0x55  this byte and the next one are a magic marker to
byte 0xfff: 0xaa  indicate the parameter block is valid


Hans de Goede <hdegoede@redhat.com>
7 April 2010
