powerpc/vas: Move VAS API to book3s common platform
authorHaren Myneni <haren@linux.ibm.com>
Thu, 17 Jun 2021 20:29:48 +0000 (13:29 -0700)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 20 Jun 2021 11:58:55 +0000 (21:58 +1000)
The pseries platform will share vas and nx code and interfaces
with the PowerNV platform, so create the
arch/powerpc/platforms/book3s/ directory and move VAS API code
there. Functionality is not changed.

Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/e05c8db17b9eabe3545b902d034238e4c6c08180.camel@linux.ibm.com
arch/powerpc/include/asm/vas.h
arch/powerpc/platforms/Kconfig
arch/powerpc/platforms/Makefile
arch/powerpc/platforms/book3s/Kconfig [new file with mode: 0644]
arch/powerpc/platforms/book3s/Makefile [new file with mode: 0644]
arch/powerpc/platforms/book3s/vas-api.c [moved from arch/powerpc/platforms/powernv/vas-api.c with 99% similarity]
arch/powerpc/platforms/powernv/Kconfig
arch/powerpc/platforms/powernv/Makefile
arch/powerpc/platforms/powernv/vas.h

index e33f80b0ea81952525a68d5cc8587517210730b3..3be76e813e2ddc7cb16abec4b63400b05735c624 100644 (file)
@@ -162,6 +162,9 @@ int vas_copy_crb(void *crb, int offset);
  */
 int vas_paste_crb(struct vas_window *win, int offset, bool re);
 
+void vas_win_paste_addr(struct vas_window *window, u64 *addr,
+                       int *len);
+
 /*
  * Register / unregister coprocessor type to VAS API which will be exported
  * to user space. Applications can use this API to open / close window
index 7a5e8f4541e3fd299d312ba899f7b0aaaa40903f..594544a65b0245163209d099fee8a160b38e1bbc 100644 (file)
@@ -20,6 +20,7 @@ source "arch/powerpc/platforms/embedded6xx/Kconfig"
 source "arch/powerpc/platforms/44x/Kconfig"
 source "arch/powerpc/platforms/40x/Kconfig"
 source "arch/powerpc/platforms/amigaone/Kconfig"
+source "arch/powerpc/platforms/book3s/Kconfig"
 
 config KVM_GUEST
        bool "KVM Guest support"
index 143d4417f6cccf65486126f508d0a7db48de4801..0e75d7df387bbcfb8fcf5c59eb981ac4cd5fd7e1 100644 (file)
@@ -22,3 +22,4 @@ obj-$(CONFIG_PPC_CELL)                += cell/
 obj-$(CONFIG_PPC_PS3)          += ps3/
 obj-$(CONFIG_EMBEDDED6xx)      += embedded6xx/
 obj-$(CONFIG_AMIGAONE)         += amigaone/
+obj-$(CONFIG_PPC_BOOK3S)       += book3s/
diff --git a/arch/powerpc/platforms/book3s/Kconfig b/arch/powerpc/platforms/book3s/Kconfig
new file mode 100644 (file)
index 0000000..34c9315
--- /dev/null
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: GPL-2.0
+config PPC_VAS
+       bool "IBM Virtual Accelerator Switchboard (VAS)"
+       depends on (PPC_POWERNV || PPC_PSERIES) && PPC_64K_PAGES
+       default y
+       help
+         This enables support for IBM Virtual Accelerator Switchboard (VAS).
+
+         VAS devices are found in POWER9-based and later systems, they
+         provide access to accelerator coprocessors such as NX-GZIP and
+         NX-842. This config allows the kernel to use NX-842 accelerators,
+         and user-mode APIs for the NX-GZIP accelerator on POWER9 PowerNV
+         and POWER10 PowerVM platforms.
+
+         If unsure, say "N".
diff --git a/arch/powerpc/platforms/book3s/Makefile b/arch/powerpc/platforms/book3s/Makefile
new file mode 100644 (file)
index 0000000..e790f19
--- /dev/null
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-$(CONFIG_PPC_VAS)  += vas-api.o
similarity index 99%
rename from arch/powerpc/platforms/powernv/vas-api.c
rename to arch/powerpc/platforms/book3s/vas-api.c
index 98ed5d8c5441a17b29a7e239af7046eab0f9a514..cfc9d7dd65abc92019372100755b0b76bdd10e44 100644 (file)
@@ -10,9 +10,9 @@
 #include <linux/fs.h>
 #include <linux/slab.h>
 #include <linux/uaccess.h>
+#include <linux/io.h>
 #include <asm/vas.h>
 #include <uapi/asm/vas-api.h>
-#include "vas.h"
 
 /*
  * The driver creates the device node that can be used as follows:
index 619b093a0657bac262ae2c794f74e29f8e06ddf2..043eefbbdd286f8f8175c9689415b269a2c89ac5 100644 (file)
@@ -33,20 +33,6 @@ config PPC_MEMTRACE
          Enabling this option allows for runtime allocation of memory (RAM)
          for hardware tracing.
 
-config PPC_VAS
-       bool "IBM Virtual Accelerator Switchboard (VAS)"
-       depends on PPC_POWERNV && PPC_64K_PAGES
-       default y
-       help
-         This enables support for IBM Virtual Accelerator Switchboard (VAS).
-
-         VAS allows accelerators in co-processors like NX-GZIP and NX-842
-         to be accessible to kernel subsystems and user processes.
-
-         VAS adapters are found in POWER9 based systems.
-
-         If unsure, say N.
-
 config SCOM_DEBUGFS
        bool "Expose SCOM controllers via debugfs"
        depends on DEBUG_FS
index be2546b968165e639612eeb0860fc64f71556992..dc7b37c23b60dccf7c87d31ca9d8bb2aa7d61143 100644 (file)
@@ -18,7 +18,7 @@ obj-$(CONFIG_MEMORY_FAILURE)  += opal-memory-errors.o
 obj-$(CONFIG_OPAL_PRD) += opal-prd.o
 obj-$(CONFIG_PERF_EVENTS) += opal-imc.o
 obj-$(CONFIG_PPC_MEMTRACE)     += memtrace.o
-obj-$(CONFIG_PPC_VAS)  += vas.o vas-window.o vas-debug.o vas-fault.o vas-api.o
+obj-$(CONFIG_PPC_VAS)  += vas.o vas-window.o vas-debug.o vas-fault.o
 obj-$(CONFIG_OCXL_BASE)        += ocxl.o
 obj-$(CONFIG_SCOM_DEBUGFS) += opal-xscom.o
 obj-$(CONFIG_PPC_SECURE_BOOT) += opal-secvar.o
index c7db3190baca4976e0053de0b8c09f44168c828f..e5027c4226dfc582c63ec95a1e88e2b73ffb5327 100644 (file)
@@ -438,8 +438,6 @@ extern irqreturn_t vas_fault_handler(int irq, void *dev_id);
 extern void vas_return_credit(struct vas_window *window, bool tx);
 extern struct vas_window *vas_pswid_to_window(struct vas_instance *vinst,
                                                uint32_t pswid);
-extern void vas_win_paste_addr(struct vas_window *window, u64 *addr,
-                                       int *len);
 
 static inline int vas_window_pid(struct vas_window *window)
 {