Skip to content

Commit

Permalink
powerpc/pseries: Add PFO support to the VIO bus
Browse files Browse the repository at this point in the history
Add support for the Platform Facilities Option (PFO) to the VIO bus.
These devices have a separate root node in OpenFirmware which
requires additional parsing to map into the existing VIO device
structure fields. This adds the interface for PFO device drivers to
make synchronous hypervisor calls.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Kent Yoder authored and Benjamin Herrenschmidt committed May 14, 2012
1 parent 4726b7b commit f2ab621
Show file tree
Hide file tree
Showing 2 changed files with 280 additions and 39 deletions.
46 changes: 46 additions & 0 deletions arch/powerpc/include/asm/vio.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,48 @@

struct iommu_table;

/*
* Platform Facilities Option (PFO)-specific data
*/

/* Starting unit address for PFO devices on the VIO BUS */
#define VIO_BASE_PFO_UA 0x50000000

/**
* vio_pfo_op - PFO operation parameters
*
* @flags: h_call subfunctions and modifiers
* @in: Input data block logical real address
* @inlen: If non-negative, the length of the input data block. If negative,
* the length of the input data descriptor list in bytes.
* @out: Output data block logical real address
* @outlen: If non-negative, the length of the input data block. If negative,
* the length of the input data descriptor list in bytes.
* @csbcpb: Logical real address of the 4k naturally-aligned storage block
* containing the CSB & optional FC field specific CPB
* @timeout: # of milliseconds to retry h_call, 0 for no timeout.
* @hcall_err: pointer to return the h_call return value, else NULL
*/
struct vio_pfo_op {
u64 flags;
s64 in;
s64 inlen;
s64 out;
s64 outlen;
u64 csbcpb;
void *done;
unsigned long handle;
unsigned int timeout;
long hcall_err;
};

/* End PFO specific data */

enum vio_dev_family {
VDEVICE, /* The OF node is a child of /vdevice */
PFO, /* The OF node is a child of /ibm,platform-facilities */
};

/**
* vio_dev - This structure is used to describe virtual I/O devices.
*
Expand All @@ -58,13 +100,15 @@ struct vio_dev {
const char *name;
const char *type;
uint32_t unit_address;
uint32_t resource_id;
unsigned int irq;
struct {
size_t desired;
size_t entitled;
size_t allocated;
atomic_t allocs_failed;
} cmo;
enum vio_dev_family family;
struct device dev;
};

Expand Down Expand Up @@ -95,6 +139,8 @@ extern void vio_cmo_set_dev_desired(struct vio_dev *viodev, size_t desired);

extern void __devinit vio_unregister_device(struct vio_dev *dev);

extern int vio_h_cop_sync(struct vio_dev *vdev, struct vio_pfo_op *op);

struct device_node;

extern struct vio_dev *vio_register_device_node(
Expand Down
Loading

0 comments on commit f2ab621

Please sign in to comment.