Staging: ipack/bridges/tpci200: Reorganize tpci200_probe in preparation for functional changes.

These changes make it easier to add more initialization steps later on.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack/bridges/tpci200: Use the TPCI200 in big endian mode.

During initialization we configure the TPCI200 so it does not swap data
lanes on IndustryPack module access.  The read and write functions are
changed accordingly.

We are taking this approach in the hope that all IP Carriers are able to
present the Module memory layout unchanged.  We can thus directly access
the memory and registers of IP Modules without having to rely on the
read and write wrappers currently exposed in ipack_bus_opts.  A later
patch will convert the existing driver and remove the wrappers.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack/devices/ipoctal: Convert ipoctal to directly use ioread/write functions.

Before it was using the functions in ipack_bus_ops.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack/bridges/tpci200: Remove the read/write functions from ipack_bus_ops.

They are not used any longer.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack: remove read/write operations from ipack_bus_ops

They are not used any longer.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack/devices/ipoctal: ipoctal cleanups.

Define memory address space, fix sparse warnings and mark the structs
reflecting hardware memory layout "packed" to be on the safe side.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack/devices/ipoctal: Tidy up ipoctal some more.

No need to have a struct when it has only one field.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack: implement ipack device table.

The modaliases look like ipack:fXvNdM, where X is the format version (8
bit) and N and M are the vendor and device ID represented as 32 bit
hexadecimal numbers each. Using 32 bits allows us to define IPACK_ANY_ID
as (~0) without interfering with the valid ids.

The resulting modalias string for ipoctal.ko looks like this (once
ipoctal provides a device table):
alias:          ipack:f01v000000F0d00000048*
alias:          ipack:f01v000000F0d0000002A*
alias:          ipack:f01v000000F0d00000022*
(output from modinfo)

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack: Read the ID space during device registration.

We keep a copy of the ID space for later use.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack: Parse vendor and device id.

Also expose the values through sysfs.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack: Move device ids from ipoctal.c to ipack_ids.h.

Rename them in the process.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack: Make ipack_driver_ops const.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack/devices/ipoctal: Expose DEVICE_TABLE for ipoctal.

The modalias entries for the module are now created.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack: Implement device matching on the bus level.

Devices are match based upon their vendor and device ids.  Since
the individual drivers provide a list of supported ids they do not
need to implement the matching themselves.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack: Expose modalias through sysfs.

Also include it in the hotplug event so that udev can
provide the respective driver.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack: Provide ID Prom through sysfs.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack/bridges/tpci200: Put the TPCI200 control registers into a struct.

This saves us from a little pointer arithmetic and cleans up the code a bit.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack: Provide several carrier callbacks.

We provide callbacks to:
 - set/get the clockrate a module is accessed at,
 - get the error state of a slot,
 - get/reset the timeout state of a slot.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack/bridges/tpci200: provide new callbacks to tpci200

Provide get_clockrate, set_clockrate, get_error, get_timeout and reset_timeout
callbacks.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Staging: ipack: Obtain supported speeds from ID ROM.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>