Update imx_usb.c

i.mx bootloader needs to look a little farther if you are booting from nor or nand.
Add i.MX6SL product ID

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Makefile: use pkg-config for LDFLAGS, too

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Merge pull request #3 from racerx/patch-1

Update imx_usb.c
imx_usb: add support for Vybrid

Add Vybrid PID and initial configuration file. Tested on Toradex
Colibri VF61 module.
imx_usb: initial separtion of protocol and communication

Initial seperation of serial download protocol (SDP) and the USB
communication part. This is in prepartion for UART communication
layer support.
imx_usb: moved struct mach_id to usb specific part

Moved struct mach_id to usb specific part. In the USB case, we have
the chance to actually detect what type of machine is connected.
The imx_usb.conf file represents the database for this machines,
however in the UART case we don't have a reliable solution to
detect the machine. The plan is to ask the user to select the right
machine configuration file. Hence, move this to the USB part and
pass the filename only.
imx_sdp: rename usb_work/usb_id

The usb_id struct is actually a device instance struct, rename it
to sdp_dev. Also rename usb_work to sdp_work, a physical layer
independent name for the same struct.
imx_sdp: decoppled transfer function

Add a pointer to the transfer function. This allows to pass a
interface dependent transfer function to the protocol implementation.
imx_sdp: read number of bytes specified by protocol
imx_uart: implemented serial loader for UART

Initial implementation of serial loader for UART.
imx_sdp: define dbg_printf

Print less on the console, implemented dbg_printf which is only enabled
conditionally when DEBUG is defined.
imx_usb/imx_uart: merged command line parsing code

Merge command line parsing code to common function. Pass parsed
work item back to the callee, which then makes sure those items
are processed. Also print work struct in a more readable format.
imx_loader: add basic README
imx_sdp: implement expected receive size

Distinguish between receive buffer size and expected message size
according to SDP specification. In USB mode, the device seems to
send more data than specified: Using a buffer of size 4 for report
4 leads to error LIBUSB_ERROR_OVERFLOW (-8). However in UART mode
only 4 bytes are received.

Having both information, buffer size and expected data size, allows
us to read only specified size in UART mode while using the
whole buffer size in USB mode.
imx_sdp: less debug print

Remove some debug print from do_status, but print result of do_status
and file download.
imx_uart: use hardware flow control

The boot ROM uses hardware flow control, configure tty accordingly
and add this to documentation.
use pkgconf for LDFLAGS, include default CFLAGS and LDFLAGS too
add configuration files and use prefix and bindir in Makefile
use prefix for /etc too in Makefile