^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) // Copyright 2017 IBM Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #include <linux/pci.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <asm/mmu.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #include "ocxl_internal.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) static int __init init_ocxl(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) int rc = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) if (!tlbie_capable)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) rc = ocxl_file_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) if (rc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) return rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) rc = pci_register_driver(&ocxl_pci_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) if (rc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) ocxl_file_exit();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) return rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) static void exit_ocxl(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) pci_unregister_driver(&ocxl_pci_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) ocxl_file_exit();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) module_init(init_ocxl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) module_exit(exit_ocxl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) MODULE_DESCRIPTION("Open Coherent Accelerator");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) MODULE_LICENSE("GPL");