ums: respect CONFIG_USB_CABLE_CHECK

Not all boards support usb_cable_connected(). CONFIG_USB_CABLE_CHECK is
used elsewhere to indicate whether a board does support that function.
Enhance cmd_usb_mass_storage.c to honor that config variable.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
ums: support block devices not MMC devices

The USB Mass Storage function could equally well support a SATA device
as support an MMC device. Update struct ums to contain a block device
descriptor, not an MMC device descriptor.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
ums: remove UMS_{NUM,START}_SECTORS + UMS_START_SECTOR

These values aren't set anywhere at present, and hence have no effect.
The concept of a single global offset/number of sectors to expose through
USB Mass Storage doesn't even make sense in the face of multiple storage
devices. Remove these defines to simplify the code.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
ums: remove error-checking of MMC device size

There's no reason to believe that an MMC device will incorrectly report
its capacity. Remove error checking of this value from ums_disk_init()
to simplify it.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
ums: remove ums_disk_init()

Now that ums_disk_init() is so simple, there's no need for it to be a
separate function. Instead, just add it to the tail end of ums_init().

Signed-off-by: Stephen Warren <swarren@nvidia.com>
ums: move IO support code to common location

There's nothing Samsung-/board-specfic about the implementation of
ums_init(). Move the code into cmd_usb_mass_storage.c, so that it can
be shared by any user of that command.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
ums: use get_device() not find_mmc_device();

get_device() is a generic routine that will support any type of block
device. Use this instead of the type-specific find_mmc_device(), for
future flexibility.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
ums: move all variable declarations to the start of the block

It's easier to assign values to the variables inside an if statement body
if the assignment and declaration are separate.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
ums: allow the user to specify the device type

Allow an optional devtype parameter to the ums command, which specifies
the type of the device to be exported. This could allow exporting a SATA
or even another USB device.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
WIP: ARM: tegra: USB device mode/mass storage board enablement

Signed-off-by: Stephen Warren <swarren@nvidia.com>