linux/drivers/misc/ocxl/main.c
Frederic Barrat 5ef3166e8a ocxl: Driver code for 'generic' opencapi devices
Add an ocxl driver to handle generic opencapi devices. Of course, it's
not meant to be the only opencapi driver, any device is free to
implement its own. But if a host application only needs basic services
like attaching to an opencapi adapter, have translation faults handled
or allocate AFU interrupts, it should suffice.

The AFU config space must follow the opencapi specification and use
the expected vendor/device ID to be seen by the generic driver.

The driver exposes the device AFUs as a char device in /dev/ocxl/

Note that the driver currently doesn't handle memory attached to the
opencapi device.

Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-01-24 11:42:58 +11:00

34 lines
560 B
C

// SPDX-License-Identifier: GPL-2.0+
// Copyright 2017 IBM Corp.
#include <linux/module.h>
#include <linux/pci.h>
#include "ocxl_internal.h"
static int __init init_ocxl(void)
{
int rc = 0;
rc = ocxl_file_init();
if (rc)
return rc;
rc = pci_register_driver(&ocxl_pci_driver);
if (rc) {
ocxl_file_exit();
return rc;
}
return 0;
}
static void exit_ocxl(void)
{
pci_unregister_driver(&ocxl_pci_driver);
ocxl_file_exit();
}
module_init(init_ocxl);
module_exit(exit_ocxl);
MODULE_DESCRIPTION("Open Coherent Accelerator");
MODULE_LICENSE("GPL");